@ngocsangairvds/vsaf 5.6.2 → 5.7.0
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/README.md +2 -2
- package/package.json +2 -1
- package/packages/cli/dist/adapters/claude.d.ts.map +1 -1
- package/packages/cli/dist/adapters/claude.js +49 -3
- package/packages/cli/dist/adapters/claude.js.map +1 -1
- package/packages/cli/dist/adapters/codex.d.ts.map +1 -1
- package/packages/cli/dist/adapters/codex.js +54 -6
- package/packages/cli/dist/adapters/codex.js.map +1 -1
- package/packages/cli/dist/server/routes/runs.d.ts +12 -0
- package/packages/cli/dist/server/routes/runs.d.ts.map +1 -1
- package/packages/cli/dist/server/routes/runs.js +53 -8
- package/packages/cli/dist/server/routes/runs.js.map +1 -1
- package/packages/web/dist/web/3rdpartylicenses.txt +0 -26
- package/packages/web/dist/web/browser/{chunk-OBMUVQWL.js → chunk-FFYMNCCZ.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-VJ3UNUDS.js → chunk-IBSRIWBK.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-K4VRVZWF.js → chunk-LPQARKUF.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-FQUOTTEA.js → chunk-NSKD5KW7.js} +1 -1
- package/packages/web/dist/web/browser/chunk-S76O6O57.js +1 -0
- package/packages/web/dist/web/browser/{chunk-4LHJGOIU.js → chunk-TTPORHEG.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-FWLQWWZ3.js → chunk-UN7U5NAR.js} +1 -1
- package/packages/web/dist/web/browser/chunk-VA6YRKIE.js +1 -0
- package/packages/web/dist/web/browser/chunk-WDOCF7IL.js +5 -0
- package/packages/web/dist/web/browser/{chunk-3LPWUDNW.js → chunk-YBYKUHHQ.js} +1 -1
- package/packages/web/dist/web/browser/index.html +2 -2
- package/packages/web/dist/web/browser/{main-7FONYLE6.js → main-7PKVTIG7.js} +1 -1
- package/packages/web/dist/web/browser/styles-MG7ITKTI.css +1 -0
- package/packages/web/dist/web/browser/chunk-UJHVWNPU.js +0 -1
- package/packages/web/dist/web/browser/chunk-UXRT7NQK.js +0 -1
- package/packages/web/dist/web/browser/chunk-W7ZKECPT.js +0 -5
- package/packages/web/dist/web/browser/styles-PWTTI45T.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w,e as E,g as O,h as N,i as D,j as k,k as T}from"./chunk-
|
|
1
|
+
import{b as w,e as E,g as O,h as N,i as D,j as k,k as T}from"./chunk-LPQARKUF.js";import{Ba as M,La as x,Ma as u,O as v,Qa as S,Ra as t,Sa as n,T as p,U as m,Xa as b,Ya as P,Za as l,da as d,gb as i,hb as c,ib as y,kb as C,lb as h,mb as _,qa as r}from"./chunk-WDOCF7IL.js";function I(o,a){o&1&&(t(0,"p",2),i(1,"Loading\u2026"),n())}function V(o,a){if(o&1&&(t(0,"span",21),i(1),n()),o&2){let e=l(2);r(),c(e.savedMsg())}}function L(o,a){if(o&1&&(t(0,"span",22),i(1),n()),o&2){let e=l(2);r(),c(e.errorMsg())}}function W(o,a){if(o&1){let e=b();t(0,"div",4)(1,"div",5)(2,"label"),i(3,"Provider"),n(),t(4,"span"),i(5),n()(),t(6,"div",5)(7,"label"),i(8,"Default model"),n(),t(9,"span"),i(10),n()(),t(11,"div",6)(12,"label",7),i(13,"Effort"),n(),t(14,"select",8),_("ngModelChange",function(s){p(e);let f=l();return h(f.effort,s)||(f.effort=s),m(s)}),t(15,"option",9),i(16,"Default (CLI default \u2014 most thorough)"),n(),t(17,"option",10),i(18,"low \u2014 fastest, least thorough"),n(),t(19,"option",11),i(20,"medium"),n(),t(21,"option",12),i(22,"high"),n(),t(23,"option",13),i(24,"xhigh \u2014 slowest, most thorough"),n()(),t(25,"small"),i(26,"Trades intelligence for speed. Lower = faster + fewer tokens."),n()(),t(27,"div",6)(28,"label",14),i(29,"Loop session (fresh_context)"),n(),t(30,"select",15),_("ngModelChange",function(s){p(e);let f=l();return h(f.freshContext,s)||(f.freshContext=s),m(s)}),t(31,"option",16),i(32,"Per-workflow default"),n(),t(33,"option",17),i(34,"Reuse session \u2014 much faster on long loops"),n(),t(35,"option",18),i(36,"Fresh session each iteration \u2014 no context rot"),n()(),t(37,"small"),i(38,"Run-level override for every until-loop. Reuse is ~3\xD7 faster; fresh matches Archon's ralph/piv loops."),n()()(),t(39,"div",19)(40,"button",20),P("click",function(){p(e);let s=l();return m(s.save())}),i(41),n(),x(42,V,2,1,"span",21),x(43,L,2,1,"span",22),n()}if(o&2){let e=l();r(5),c(e.config().provider),r(5),c(e.config().model),r(4),C("ngModel",e.effort),r(16),C("ngModel",e.freshContext),r(10),S("disabled",e.saving()),r(),y(" ",e.saving()?"Saving\u2026":"Save"," "),r(),u(e.savedMsg()?42:-1),r(),u(e.errorMsg()?43:-1)}}function j(o,a){if(o&1&&(t(0,"p",3),i(1),n()),o&2){let e=l();r(),c(e.errorMsg()||"No config available.")}}var z=class o{api=v(T);loading=d(!0);saving=d(!1);config=d(null);savedMsg=d("");errorMsg=d("");effort="";freshContext="default";constructor(){this.load()}load(){this.loading.set(!0),this.api.getConfig().subscribe({next:a=>{this.config.set(a),this.effort=a.effort??"",this.freshContext=a.freshContext===null||a.freshContext===void 0?"default":String(a.freshContext),this.loading.set(!1)},error:a=>{this.errorMsg.set(a?.error?.error??"Failed to load config"),this.loading.set(!1)}})}save(){this.saving.set(!0),this.savedMsg.set(""),this.errorMsg.set("");let a={effort:this.effort===""?null:this.effort,freshContext:this.freshContext==="default"?null:this.freshContext==="true"};this.api.updateConfig(a).subscribe({next:e=>{this.config.set(e),this.saving.set(!1),this.savedMsg.set("Saved \u2713")},error:e=>{this.saving.set(!1),this.errorMsg.set(e?.error?.error??"Save failed")}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-settings"]],decls:11,vars:1,consts:[[1,"wrap"],[1,"sub"],[1,"muted"],[1,"err"],[1,"grid"],[1,"ro"],[1,"field"],["for","effort"],["id","effort","data-testid","effort-select",3,"ngModelChange","ngModel"],["value",""],["value","low"],["value","medium"],["value","high"],["value","xhigh"],["for","fresh"],["id","fresh","data-testid","fresh-select",3,"ngModelChange","ngModel"],["value","default"],["value","false"],["value","true"],[1,"actions"],["data-testid","save-config",1,"save",3,"click","disabled"],["data-testid","saved-msg",1,"saved"],["data-testid","config-error",1,"err"]],template:function(e,g){e&1&&(t(0,"div",0)(1,"h1"),i(2,"Project settings"),n(),t(3,"p",1),i(4,"Speed knobs the engine reads from "),t(5,"code"),i(6,".vsaf/config.yaml"),n(),i(7,". Applied to every run of this project."),n(),x(8,I,2,0,"p",2)(9,W,44,8)(10,j,2,1,"p",3),n()),e&2&&(r(8),u(g.loading()?8:g.config()?9:10))},dependencies:[k,N,D,O,w,E],styles:["[_nghost-%COMP%]{display:block}.wrap[_ngcontent-%COMP%]{max-width:720px;margin:0 auto;padding:28px 20px;color:#e7e7ea}h1[_ngcontent-%COMP%]{font-size:20px;font-weight:800;margin:0 0 4px}.sub[_ngcontent-%COMP%]{color:#a1a1aa;font-size:13px;margin:0 0 22px}code[_ngcontent-%COMP%]{background:#20222a;border:1px solid #2b2d33;border-radius:5px;padding:1px 5px;font-size:12px}.grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:18px}.ro[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;font-size:13px}.ro[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:130px;color:#a1a1aa}.ro[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#e7e7ea;font-weight:650}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:13px;font-weight:650}.field[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#8b8b93;font-size:12px}select[_ngcontent-%COMP%]{border:1px solid #2b2d33;border-radius:7px;background:#20222a;color:#e7e7ea;padding:8px 10px;font:inherit;font-size:13px;max-width:460px}select[_ngcontent-%COMP%]:focus{outline:none;border-color:#6366f1}.actions[_ngcontent-%COMP%]{margin-top:26px;display:flex;align-items:center;gap:14px}.save[_ngcontent-%COMP%]{border:0;border-radius:8px;background:#6366f1;color:#fff;padding:9px 20px;font:inherit;font-weight:700;cursor:pointer}.save[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:default}.saved[_ngcontent-%COMP%]{color:#4ade80;font-size:13px}.err[_ngcontent-%COMP%]{color:#f87171;font-size:13px}.muted[_ngcontent-%COMP%]{color:#a1a1aa}"]})};export{z as SettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as D,Bb as me,Ca as Y,Cb as Q,Da as u,Ea as h,G as k,Ha as pe,I as m,J as Z,Ja as ge,K as X,M as v,O as g,Qb as ve,Sb as _e,Ya as w,Z as ce,a as l,b as d,da as b,db as K,ea as he,fa as P,g as ae,ha as A,j as le,mb as _,o as ue,tb as f,u as de,ua as fe,ub as F,wa as M,xa as o,zb as J}from"./chunk-W7ZKECPT.js";var Fe=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,i){this._renderer=t,this._elementRef=i}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A))};static \u0275dir=u({type:n})}return n})(),ne=(()=>{class n extends Fe{static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,features:[h]})}return n})(),L=new v("");var qe={provide:L,useExisting:m(()=>Ee),multi:!0};function ze(){let n=Q()?Q().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Ze=new v(""),Ee=(()=>{class n extends Fe{_compositionMode;_composing=!1;constructor(t,i,r){super(t,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!ze())}writeValue(t){let i=t??"";this.setProperty("value",i)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A),o(Ze,8))};static \u0275dir=u({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&w("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},standalone:!1,features:[_([qe]),h]})}return n})();var Se=new v(""),Ie=new v("");function Oe(n){return n!=null}function Ne(n){return pe(n)?le(n):n}function Re(n){let e={};return n.forEach(t=>{e=t!=null?l(l({},e),t):e}),Object.keys(e).length===0?null:e}function xe(n,e){return e.map(t=>t(n))}function Xe(n){return!n.validate}function ke(n){return n.map(e=>Xe(e)?e:t=>e.validate(t))}function Ye(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){return Re(xe(t,e))}}function ie(n){return n!=null?Ye(ke(n)):null}function Ke(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){let i=xe(t,e).map(Ne);return de(i).pipe(ue(Re))}}function re(n){return n!=null?Ke(ke(n)):null}function ye(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function Je(n){return n._rawValidators}function Qe(n){return n._rawAsyncValidators}function ee(n){return n?Array.isArray(n)?n:[n]:[]}function G(n,e){return Array.isArray(n)?n.includes(e):n===e}function Ce(n,e){let t=ee(e);return ee(n).forEach(r=>{G(t,r)||t.push(r)}),t}function Ve(n,e){return ee(e).filter(t=>!G(n,t))}var T=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=ie(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=re(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control?.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},V=class extends T{name;get formDirective(){return null}get path(){return null}},R=class extends T{_parent=null;name=null;valueAccessor=null},B=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var Ht=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(R,2))};static \u0275dir=u({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[h]})}return n})(),Wt=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(V,10))};static \u0275dir=u({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[h]})}return n})();var E="VALID",j="INVALID",y="PENDING",S="DISABLED",p=class{},U=class extends p{value;source;constructor(e,t){super(),this.value=e,this.source=t}},O=class extends p{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},N=class extends p{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},C=class extends p{status;source;constructor(e,t){super(),this.status=e,this.source=t}},te=class extends p{source;constructor(e){super(),this.source=e}},H=class extends p{source;constructor(e){super(),this.source=e}};function Pe(n){return(q(n)?n.validators:n)||null}function et(n){return Array.isArray(n)?ie(n):n||null}function je(n,e){return(q(e)?e.asyncValidators:n)||null}function tt(n){return Array.isArray(n)?re(n):n||null}function q(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function nt(n,e,t){let i=n.controls;if(!(e?Object.keys(i):i).length)throw new k(1e3,"");if(!i[t])throw new k(1001,"")}function it(n,e,t){n._forEachChild((i,r)=>{if(t[r]===void 0)throw new k(-1002,"")})}var W=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return f(this.statusReactive)}set status(e){f(()=>this.statusReactive.set(e))}_status=F(()=>this.statusReactive());statusReactive=b(void 0);get valid(){return this.status===E}get invalid(){return this.status===j}get pending(){return this.status===y}get disabled(){return this.status===S}get enabled(){return this.status!==S}errors;get pristine(){return f(this.pristineReactive)}set pristine(e){f(()=>this.pristineReactive.set(e))}_pristine=F(()=>this.pristineReactive());pristineReactive=b(!0);get dirty(){return!this.pristine}get touched(){return f(this.touchedReactive)}set touched(e){f(()=>this.touchedReactive.set(e))}_touched=F(()=>this.touchedReactive());touchedReactive=b(!1);get untouched(){return!this.touched}_events=new ae;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(Ce(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(Ce(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(Ve(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(Ve(e,this._rawAsyncValidators))}hasValidator(e){return G(this._rawValidators,e)}hasAsyncValidator(e){return G(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsTouched(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new N(!0,i))}markAllAsDirty(e={}){this.markAsDirty({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(e))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:i})}),e.onlySelf||this._parent?._updateTouched(e,i),t&&e.emitEvent!==!1&&this._events.next(new N(!1,i))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsDirty(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new O(!1,i))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),e.onlySelf||this._parent?._updatePristine(e,i),t&&e.emitEvent!==!1&&this._events.next(new O(!0,i))}markAsPending(e={}){this.status=y;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new C(this.status,t)),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.markAsPending(d(l({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=S,this.errors=null,this._forEachChild(r=>{r.disable(d(l({},e),{onlySelf:!0}))}),this._updateValue();let i=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,i)),this._events.next(new C(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=E,this._forEachChild(i=>{i.enable(d(l({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e,t){e.onlySelf||(this._parent?.updateValueAndValidity(e),e.skipPristineCheck||this._parent?._updatePristine({},t),this._parent?._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===E||this.status===y)&&this._runAsyncValidator(i,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,t)),this._events.next(new C(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.updateValueAndValidity(d(l({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?S:E}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=y,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:e!==!1};let i=Ne(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((i,r)=>i&&i._find(r),this)}getError(e,t){let i=t?this.get(t):this;return i?.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,i){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||i)&&this._events.next(new C(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,i)}_initObservables(){this.valueChanges=new D,this.statusChanges=new D}_calculateStatus(){return this._allControlsDisabled()?S:this.errors?j:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(y)?y:this._anyControlsHaveStatus(j)?j:E}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,e.onlySelf||this._parent?._updatePristine(e,t),r&&this._events.next(new O(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new N(this.touched,t)),e.onlySelf||this._parent?._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){q(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=et(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=tt(this._rawAsyncValidators)}},$=class extends W{constructor(e,t,i){super(Pe(t),je(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){it(this,!0,e),Object.keys(e).forEach(i=>{nt(this,!0,i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(Object.keys(e).forEach(i=>{let r=this.controls[i];r&&r.patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e?e[r]:null,d(l({},t),{onlySelf:!0}))}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t),t?.emitEvent!==!1&&this._events.next(new H(this))}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>i._syncPendingControls()?!0:t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{let i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[t,i]of Object.entries(this.controls))if(this.contains(t)&&e(i))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(t,i,r)=>((i.enabled||this.disabled)&&(t[r]=i.value),t))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var se=new v("",{factory:()=>oe}),oe="always";function rt(n,e){return[...e.path,n]}function Ge(n,e,t=oe){Te(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),ot(n,e),lt(n,e),at(n,e),st(n,e)}function De(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function st(n,e){if(e.valueAccessor.setDisabledState){let t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function Te(n,e){let t=Je(n);e.validator!==null?n.setValidators(ye(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let i=Qe(n);e.asyncValidator!==null?n.setAsyncValidators(ye(i,e.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();De(e._rawValidators,r),De(e._rawAsyncValidators,r)}function ot(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&Be(n,e)})}function at(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&Be(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function Be(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function lt(n,e){let t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function ut(n,e){n==null,Te(n,e)}function dt(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function ct(n){return Object.getPrototypeOf(n.constructor)===ne}function ht(n,e){n._syncPendingControls(),e.forEach(t=>{let i=t.control;i.updateOn==="submit"&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function ft(n,e){if(!e)return null;Array.isArray(e);let t,i,r;return e.forEach(s=>{s.constructor===Ee?t=s:ct(s)?i=s:r=s}),r||i||t||null}var pt={provide:V,useExisting:m(()=>gt)},I=Promise.resolve(),gt=(()=>{class n extends V{callSetDisabledState;get submitted(){return f(this.submittedReactive)}_submitted=F(()=>this.submittedReactive());submittedReactive=b(!1);_directives=new Set;form;ngSubmit=new D;options;constructor(t,i,r){super(),this.callSetDisabledState=r,this.form=new $({},ie(t),re(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){I.then(()=>{let i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Ge(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){I.then(()=>{this._findContainer(t.path)?.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){I.then(()=>{let i=this._findContainer(t.path),r=new $({});ut(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){I.then(()=>{this._findContainer(t.path)?.removeControl?.(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){I.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),ht(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new te(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(i){return new(i||n)(o(Se,10),o(Ie,10),o(se,8))};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&w("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[_([pt]),h]})}return n})();function be(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function Ae(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var mt=class extends W{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,i){super(Pe(t),je(i,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),q(t)&&(t.nonNullable||t.initialValueIsDefault)&&(Ae(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),t.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,t?.emitEvent!==!1&&this._events.next(new H(this))}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){be(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){be(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){Ae(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var vt={provide:R,useExisting:m(()=>_t)},Me=Promise.resolve(),_t=(()=>{class n extends R{_changeDetectorRef;callSetDisabledState;control=new mt;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new D;constructor(t,i,r,s,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=ft(this,s)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let i=t.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),dt(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Ge(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){Me.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let i=t.isDisabled.currentValue,r=i!==0&&me(i);Me.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?rt(t,this._parent):[t]}static \u0275fac=function(i){return new(i||n)(o(V,9),o(Se,10),o(Ie,10),o(L,10),o(J,8),o(se,8))};static \u0275dir=u({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[_([vt]),h,he]})}return n})();var Lt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var yt={provide:L,useExisting:m(()=>He),multi:!0};function Ue(n,e){return n==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Ct(n){return n.split(":")[0]}var He=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;appRefInjector=g(ge).injector;destroyRef=g(ce);cdr=g(J);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,fe({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(t){this.cdr.markForCheck(),this.value=t;let i=this._getOptionId(t),r=Ue(i,t);this.setProperty("value",r)}registerOnChange(t){this.onChange=i=>{this.value=this._getOptionValue(i),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),t))return i;return null}_getOptionValue(t){let i=Ct(t);return this._optionMap.has(i)?this._optionMap.get(i):t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([yt]),h]})}return n})(),qt=(()=>{class n{_element;_renderer;_select;id;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(Ue(this.id,t)),this._select._writeValueAfterRender())}set value(t){this._setElementValue(t),this._select?._writeValueAfterRender()}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender()}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(He,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),Vt={provide:L,useExisting:m(()=>We),multi:!0};function we(n,e){return n==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Dt(n){return n.split(":")[0]}var We=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;let i;if(Array.isArray(t)){let r=t.map(s=>this._getOptionId(s));i=(s,a)=>{s._setSelected(r.indexOf(a)>-1)}}else i=r=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(t){this.onChange=i=>{let r=[],s=i.selectedOptions;if(s!==void 0){let a=s;for(let c=0;c<a.length;c++){let x=a[c],z=this._getOptionValue(x.value);r.push(z)}}else{let a=i.options;for(let c=0;c<a.length;c++){let x=a[c];if(x.selected){let z=this._getOptionValue(x.value);r.push(z)}}}this.value=r,t(r)}}_registerOption(t){let i=(this._idCounter++).toString();return this._optionMap.set(i,t),i}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,t))return i;return null}_getOptionValue(t){let i=Dt(t);return this._optionMap.has(i)?this._optionMap.get(i)._value:t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([Vt]),h]})}return n})(),zt=(()=>{class n{_element;_renderer;_select;id;_value;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(We,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();var bt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({})}return n})();var Zt=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:se,useValue:t.callSetDisabledState??oe}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({imports:[bt]})}return n})();var $e=class n{http=g(ve);projectService=g(_e);params(e={}){let t=this.projectService.currentId;return t?d(l({},e),{project:t}):e}getProjects(){return this.http.get("/api/projects")}getProviders(){return this.http.get("/api/providers",{params:this.params()})}getWorkflows(){return this.http.get("/api/workflows",{params:this.params()})}getWorkflowFolders(){return this.http.get("/api/workflows/folders",{params:this.params()})}createWorkflowFolder(e){return this.http.post("/api/workflows/folders",{path:e},{params:this.params()})}getWorkflow(e){return this.http.get("/api/workflows/detail",{params:this.params({id:e})})}getRuns(){return this.http.get("/api/runs",{params:this.params()})}getRun(e){return this.http.get(`/api/runs/${e}`,{params:this.params()})}getNodeOutput(e,t){return this.http.get(`/api/runs/${e}/nodes/${t}/output`,{params:this.params()})}startRun(e,t,i={}){let r={workflow:e,args:t};i.provider&&(r.provider=i.provider),i.model&&(r.model=i.model);let s=this.projectService.currentId;return s&&(r.project=s),this.http.post("/api/runs",r)}saveWorkflow(e,t){return this.http.put("/api/workflows",{id:e,content:t},{params:this.params()})}resumeRun(e,t){return this.http.post(`/api/runs/${e}/resume`,{message:t},{params:this.params()})}approveRun(e,t){let i=t?{response:t}:{};return this.http.post(`/api/runs/${e}/approve`,i,{params:this.params()})}rejectRun(e,t){return this.http.post(`/api/runs/${e}/reject`,{reason:t},{params:this.params()})}runAction(e,t,i){let r=`/api/runs/${e}${t==="delete"?"":`/${t}`}`;return t==="delete"?this.http.delete(r,{params:this.params()}):this.http.post(r,t==="reject"?{reason:i}:{},{params:this.params()})}listConversations(){return this.http.get("/api/conversations",{params:this.params()})}getConversationMessages(e){return this.http.get(`/api/conversations/${encodeURIComponent(e)}/messages`,{params:this.params()})}sendConversationMessage(e,t){return this.http.post(`/api/conversations/${encodeURIComponent(e)}/messages`,{message:t},{params:this.params()})}getConfig(){return this.http.get("/api/config",{params:this.params()})}updateConfig(e){return this.http.put("/api/config",e,{params:this.params()})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"})};export{Ee as a,Ht as b,Wt as c,gt as d,_t as e,Lt as f,He as g,qt as h,zt as i,Zt as j,$e as k};
|
|
1
|
+
import{$ as D,Ab as J,Ca as Y,Cb as me,Da as u,Db as Q,Ea as h,G as k,Ha as pe,I as m,J as Z,Ja as ge,K as X,M as v,O as g,Sb as ve,Ub as _e,Ya as w,Z as ce,a as l,b as d,da as b,ea as he,eb as K,fa as P,g as ae,ha as A,j as le,nb as _,o as ue,u as de,ua as fe,ub as f,vb as F,wa as M,xa as o}from"./chunk-WDOCF7IL.js";var Fe=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,i){this._renderer=t,this._elementRef=i}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A))};static \u0275dir=u({type:n})}return n})(),ne=(()=>{class n extends Fe{static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,features:[h]})}return n})(),L=new v("");var qe={provide:L,useExisting:m(()=>Ee),multi:!0};function ze(){let n=Q()?Q().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Ze=new v(""),Ee=(()=>{class n extends Fe{_compositionMode;_composing=!1;constructor(t,i,r){super(t,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!ze())}writeValue(t){let i=t??"";this.setProperty("value",i)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A),o(Ze,8))};static \u0275dir=u({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&w("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},standalone:!1,features:[_([qe]),h]})}return n})();var Se=new v(""),Ie=new v("");function Oe(n){return n!=null}function Ne(n){return pe(n)?le(n):n}function Re(n){let e={};return n.forEach(t=>{e=t!=null?l(l({},e),t):e}),Object.keys(e).length===0?null:e}function xe(n,e){return e.map(t=>t(n))}function Xe(n){return!n.validate}function ke(n){return n.map(e=>Xe(e)?e:t=>e.validate(t))}function Ye(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){return Re(xe(t,e))}}function ie(n){return n!=null?Ye(ke(n)):null}function Ke(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){let i=xe(t,e).map(Ne);return de(i).pipe(ue(Re))}}function re(n){return n!=null?Ke(ke(n)):null}function ye(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function Je(n){return n._rawValidators}function Qe(n){return n._rawAsyncValidators}function ee(n){return n?Array.isArray(n)?n:[n]:[]}function G(n,e){return Array.isArray(n)?n.includes(e):n===e}function Ce(n,e){let t=ee(e);return ee(n).forEach(r=>{G(t,r)||t.push(r)}),t}function Ve(n,e){return ee(e).filter(t=>!G(n,t))}var T=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=ie(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=re(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control?.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},V=class extends T{name;get formDirective(){return null}get path(){return null}},R=class extends T{_parent=null;name=null;valueAccessor=null},B=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var Ht=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(R,2))};static \u0275dir=u({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[h]})}return n})(),Wt=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(V,10))};static \u0275dir=u({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[h]})}return n})();var E="VALID",j="INVALID",y="PENDING",S="DISABLED",p=class{},U=class extends p{value;source;constructor(e,t){super(),this.value=e,this.source=t}},O=class extends p{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},N=class extends p{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},C=class extends p{status;source;constructor(e,t){super(),this.status=e,this.source=t}},te=class extends p{source;constructor(e){super(),this.source=e}},H=class extends p{source;constructor(e){super(),this.source=e}};function Pe(n){return(q(n)?n.validators:n)||null}function et(n){return Array.isArray(n)?ie(n):n||null}function je(n,e){return(q(e)?e.asyncValidators:n)||null}function tt(n){return Array.isArray(n)?re(n):n||null}function q(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function nt(n,e,t){let i=n.controls;if(!(e?Object.keys(i):i).length)throw new k(1e3,"");if(!i[t])throw new k(1001,"")}function it(n,e,t){n._forEachChild((i,r)=>{if(t[r]===void 0)throw new k(-1002,"")})}var W=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return f(this.statusReactive)}set status(e){f(()=>this.statusReactive.set(e))}_status=F(()=>this.statusReactive());statusReactive=b(void 0);get valid(){return this.status===E}get invalid(){return this.status===j}get pending(){return this.status===y}get disabled(){return this.status===S}get enabled(){return this.status!==S}errors;get pristine(){return f(this.pristineReactive)}set pristine(e){f(()=>this.pristineReactive.set(e))}_pristine=F(()=>this.pristineReactive());pristineReactive=b(!0);get dirty(){return!this.pristine}get touched(){return f(this.touchedReactive)}set touched(e){f(()=>this.touchedReactive.set(e))}_touched=F(()=>this.touchedReactive());touchedReactive=b(!1);get untouched(){return!this.touched}_events=new ae;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(Ce(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(Ce(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(Ve(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(Ve(e,this._rawAsyncValidators))}hasValidator(e){return G(this._rawValidators,e)}hasAsyncValidator(e){return G(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsTouched(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new N(!0,i))}markAllAsDirty(e={}){this.markAsDirty({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(e))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:i})}),e.onlySelf||this._parent?._updateTouched(e,i),t&&e.emitEvent!==!1&&this._events.next(new N(!1,i))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsDirty(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new O(!1,i))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),e.onlySelf||this._parent?._updatePristine(e,i),t&&e.emitEvent!==!1&&this._events.next(new O(!0,i))}markAsPending(e={}){this.status=y;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new C(this.status,t)),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.markAsPending(d(l({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=S,this.errors=null,this._forEachChild(r=>{r.disable(d(l({},e),{onlySelf:!0}))}),this._updateValue();let i=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,i)),this._events.next(new C(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=E,this._forEachChild(i=>{i.enable(d(l({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e,t){e.onlySelf||(this._parent?.updateValueAndValidity(e),e.skipPristineCheck||this._parent?._updatePristine({},t),this._parent?._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===E||this.status===y)&&this._runAsyncValidator(i,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,t)),this._events.next(new C(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.updateValueAndValidity(d(l({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?S:E}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=y,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:e!==!1};let i=Ne(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((i,r)=>i&&i._find(r),this)}getError(e,t){let i=t?this.get(t):this;return i?.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,i){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||i)&&this._events.next(new C(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,i)}_initObservables(){this.valueChanges=new D,this.statusChanges=new D}_calculateStatus(){return this._allControlsDisabled()?S:this.errors?j:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(y)?y:this._anyControlsHaveStatus(j)?j:E}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,e.onlySelf||this._parent?._updatePristine(e,t),r&&this._events.next(new O(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new N(this.touched,t)),e.onlySelf||this._parent?._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){q(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=et(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=tt(this._rawAsyncValidators)}},$=class extends W{constructor(e,t,i){super(Pe(t),je(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){it(this,!0,e),Object.keys(e).forEach(i=>{nt(this,!0,i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(Object.keys(e).forEach(i=>{let r=this.controls[i];r&&r.patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e?e[r]:null,d(l({},t),{onlySelf:!0}))}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t),t?.emitEvent!==!1&&this._events.next(new H(this))}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>i._syncPendingControls()?!0:t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{let i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[t,i]of Object.entries(this.controls))if(this.contains(t)&&e(i))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(t,i,r)=>((i.enabled||this.disabled)&&(t[r]=i.value),t))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var se=new v("",{factory:()=>oe}),oe="always";function rt(n,e){return[...e.path,n]}function Ge(n,e,t=oe){Te(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),ot(n,e),lt(n,e),at(n,e),st(n,e)}function De(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function st(n,e){if(e.valueAccessor.setDisabledState){let t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function Te(n,e){let t=Je(n);e.validator!==null?n.setValidators(ye(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let i=Qe(n);e.asyncValidator!==null?n.setAsyncValidators(ye(i,e.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();De(e._rawValidators,r),De(e._rawAsyncValidators,r)}function ot(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&Be(n,e)})}function at(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&Be(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function Be(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function lt(n,e){let t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function ut(n,e){n==null,Te(n,e)}function dt(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function ct(n){return Object.getPrototypeOf(n.constructor)===ne}function ht(n,e){n._syncPendingControls(),e.forEach(t=>{let i=t.control;i.updateOn==="submit"&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function ft(n,e){if(!e)return null;Array.isArray(e);let t,i,r;return e.forEach(s=>{s.constructor===Ee?t=s:ct(s)?i=s:r=s}),r||i||t||null}var pt={provide:V,useExisting:m(()=>gt)},I=Promise.resolve(),gt=(()=>{class n extends V{callSetDisabledState;get submitted(){return f(this.submittedReactive)}_submitted=F(()=>this.submittedReactive());submittedReactive=b(!1);_directives=new Set;form;ngSubmit=new D;options;constructor(t,i,r){super(),this.callSetDisabledState=r,this.form=new $({},ie(t),re(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){I.then(()=>{let i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Ge(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){I.then(()=>{this._findContainer(t.path)?.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){I.then(()=>{let i=this._findContainer(t.path),r=new $({});ut(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){I.then(()=>{this._findContainer(t.path)?.removeControl?.(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){I.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),ht(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new te(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(i){return new(i||n)(o(Se,10),o(Ie,10),o(se,8))};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&w("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[_([pt]),h]})}return n})();function be(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function Ae(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var mt=class extends W{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,i){super(Pe(t),je(i,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),q(t)&&(t.nonNullable||t.initialValueIsDefault)&&(Ae(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),t.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,t?.emitEvent!==!1&&this._events.next(new H(this))}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){be(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){be(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){Ae(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var vt={provide:R,useExisting:m(()=>_t)},Me=Promise.resolve(),_t=(()=>{class n extends R{_changeDetectorRef;callSetDisabledState;control=new mt;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new D;constructor(t,i,r,s,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=ft(this,s)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let i=t.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),dt(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Ge(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){Me.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let i=t.isDisabled.currentValue,r=i!==0&&me(i);Me.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?rt(t,this._parent):[t]}static \u0275fac=function(i){return new(i||n)(o(V,9),o(Se,10),o(Ie,10),o(L,10),o(J,8),o(se,8))};static \u0275dir=u({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[_([vt]),h,he]})}return n})();var Lt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var yt={provide:L,useExisting:m(()=>He),multi:!0};function Ue(n,e){return n==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Ct(n){return n.split(":")[0]}var He=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;appRefInjector=g(ge).injector;destroyRef=g(ce);cdr=g(J);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,fe({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(t){this.cdr.markForCheck(),this.value=t;let i=this._getOptionId(t),r=Ue(i,t);this.setProperty("value",r)}registerOnChange(t){this.onChange=i=>{this.value=this._getOptionValue(i),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),t))return i;return null}_getOptionValue(t){let i=Ct(t);return this._optionMap.has(i)?this._optionMap.get(i):t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([yt]),h]})}return n})(),qt=(()=>{class n{_element;_renderer;_select;id;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(Ue(this.id,t)),this._select._writeValueAfterRender())}set value(t){this._setElementValue(t),this._select?._writeValueAfterRender()}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender()}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(He,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),Vt={provide:L,useExisting:m(()=>We),multi:!0};function we(n,e){return n==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Dt(n){return n.split(":")[0]}var We=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;let i;if(Array.isArray(t)){let r=t.map(s=>this._getOptionId(s));i=(s,a)=>{s._setSelected(r.indexOf(a)>-1)}}else i=r=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(t){this.onChange=i=>{let r=[],s=i.selectedOptions;if(s!==void 0){let a=s;for(let c=0;c<a.length;c++){let x=a[c],z=this._getOptionValue(x.value);r.push(z)}}else{let a=i.options;for(let c=0;c<a.length;c++){let x=a[c];if(x.selected){let z=this._getOptionValue(x.value);r.push(z)}}}this.value=r,t(r)}}_registerOption(t){let i=(this._idCounter++).toString();return this._optionMap.set(i,t),i}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,t))return i;return null}_getOptionValue(t){let i=Dt(t);return this._optionMap.has(i)?this._optionMap.get(i)._value:t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([Vt]),h]})}return n})(),zt=(()=>{class n{_element;_renderer;_select;id;_value;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(We,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();var bt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({})}return n})();var Zt=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:se,useValue:t.callSetDisabledState??oe}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({imports:[bt]})}return n})();var $e=class n{http=g(ve);projectService=g(_e);params(e={}){let t=this.projectService.currentId;return t?d(l({},e),{project:t}):e}getProjects(){return this.http.get("/api/projects")}getProviders(){return this.http.get("/api/providers",{params:this.params()})}getWorkflows(){return this.http.get("/api/workflows",{params:this.params()})}getWorkflowFolders(){return this.http.get("/api/workflows/folders",{params:this.params()})}createWorkflowFolder(e){return this.http.post("/api/workflows/folders",{path:e},{params:this.params()})}getWorkflow(e){return this.http.get("/api/workflows/detail",{params:this.params({id:e})})}getRuns(){return this.http.get("/api/runs",{params:this.params()})}getRun(e){return this.http.get(`/api/runs/${e}`,{params:this.params()})}getNodeOutput(e,t){return this.http.get(`/api/runs/${e}/nodes/${t}/output`,{params:this.params()})}startRun(e,t,i={}){let r={workflow:e,args:t};i.provider&&(r.provider=i.provider),i.model&&(r.model=i.model);let s=this.projectService.currentId;return s&&(r.project=s),this.http.post("/api/runs",r)}saveWorkflow(e,t){return this.http.put("/api/workflows",{id:e,content:t},{params:this.params()})}resumeRun(e,t){return this.http.post(`/api/runs/${e}/resume`,{message:t},{params:this.params()})}approveRun(e,t){let i=t?{response:t}:{};return this.http.post(`/api/runs/${e}/approve`,i,{params:this.params()})}rejectRun(e,t){return this.http.post(`/api/runs/${e}/reject`,{reason:t},{params:this.params()})}runAction(e,t,i){let r=`/api/runs/${e}${t==="delete"?"":`/${t}`}`;return t==="delete"?this.http.delete(r,{params:this.params()}):this.http.post(r,t==="reject"?{reason:i}:{},{params:this.params()})}listConversations(){return this.http.get("/api/conversations",{params:this.params()})}getConversationMessages(e){return this.http.get(`/api/conversations/${encodeURIComponent(e)}/messages`,{params:this.params()})}sendConversationMessage(e,t){return this.http.post(`/api/conversations/${encodeURIComponent(e)}/messages`,{message:t},{params:this.params()})}getConfig(){return this.http.get("/api/config",{params:this.params()})}updateConfig(e){return this.http.put("/api/config",e,{params:this.params()})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"})};export{Ee as a,Ht as b,Wt as c,gt as d,_t as e,Lt as f,He as g,qt as h,zt as i,Zt as j,$e as k};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as H,d as J,e as K}from"./chunk-FWLQWWZ3.js";import{a as U,b as X,e as Q,g as Z,h as ee,i as te,j as ne,k as oe}from"./chunk-K4VRVZWF.js";import{Ba as V,Fa as _,Ib as j,Jb as q,Ka as F,Mb as G,O as M,Qa as u,Ra as i,Sa as r,T as m,Ta as O,U as g,Ua as D,V as S,Va as $,W as I,Xa as C,Ya as f,Za as p,a as B,b as T,bb as z,cb as L,db as P,eb as R,fb as d,gb as w,hb as v,ib as N,jb as h,kb as x,lb as b,ob as Y,qa as s,rb as A}from"./chunk-W7ZKECPT.js";var le=l=>["/runs",l];function de(l,n){if(l&1){let e=C();i(0,"button",39),f("dragstart",function(o){let a=m(e).$implicit,c=p();return g(c.onPaletteDragStart(o,a.type))})("click",function(){let o=m(e).$implicit,a=p();return g(a.addNode(o.type))}),i(1,"span",40),d(2),r(),i(3,"span")(4,"strong"),d(5),r(),i(6,"small"),d(7),r()()()}if(l&2){let e=n.$implicit,t=p();s(2),w(t.iconFor(e.type)),s(3),w(e.label),s(2),w(e.description)}}function se(l,n){if(l&1){let e=C();i(0,"button",41),f("click",function(){let o=m(e).$implicit,a=p();return g(a.loadWorkflow(o.id))}),i(1,"span"),d(2),r(),i(3,"small"),d(4),r()()}if(l&2){let e=n.$implicit;s(2),w(e.name),s(2),v("",e.nodeCount," nodes")}}function ce(l,n){if(l&1&&(i(0,"div",42),d(1),r()),l&2){let e=p();P("error",e.saveState==="error"),s(),v(" ",e.statusMessage," ")}}function pe(l,n){l&1&&(i(0,"div",43)(1,"h2"),d(2,"Drop nodes here"),r(),i(3,"p"),d(4,"Build a DAG by adding Bash, Command, and Prompt nodes."),r()())}function me(l,n){if(l&1&&(S(),O(0,"line")),l&2){let e=n.$implicit;F("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2)}}function ge(l,n){if(l&1){let e=C();i(0,"button",44),f("click",function(){let o=m(e).$implicit,a=p();return g(a.selectNode(o))})("dragstart",function(o){let a=m(e).$implicit,c=p();return g(c.onNodeDragStart(o,a))}),i(1,"span",45),d(2),r(),i(3,"span",46)(4,"strong"),d(5),r(),i(6,"small"),d(7),r()()()}if(l&2){let e=n.$implicit,t=p();L("left",e.x,"px")("top",e.y,"px"),P("selected",(t.selectedNode==null?null:t.selectedNode.id)===e.id),s(2),w(t.iconFor(e.type)),s(3),w(e.id),s(2),N("",e.type," \xB7 ",e.dependsOn.length||0," deps")}}function ue(l,n){if(l&1&&(i(0,"option",67),d(1),r()),l&2){let e=n.$implicit;u("value",e.name)("disabled",!e.available),s(),N(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function fe(l,n){if(l&1&&O(0,"option",68),l&2){let e=n.$implicit;u("value",e)}}function _e(l,n){if(l&1){let e=C();i(0,"label",69)(1,"input",70),f("change",function(o){let a=m(e).$implicit,c=p(2);return g(c.toggleDependency(a.id,o))}),r(),i(2,"span"),d(3),r()()}if(l&2){let e=n.$implicit,t=p(2);s(),u("checked",t.selectedNode.dependsOn.includes(e.id)),s(2),w(e.id)}}function we(l,n){if(l&1){let e=C();D(0),i(1,"div",34),d(2,"Inspector"),r(),i(3,"label",47),d(4,"Node ID"),r(),i(5,"input",48),f("ngModelChange",function(o){m(e);let a=p();return g(a.renameSelectedNode(o))}),r(),i(6,"label",49),d(7,"Type"),r(),i(8,"select",50),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.type,o)||(a.selectedNode.type=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),i(9,"option",51),d(10,"bash"),r(),i(11,"option",52),d(12,"command"),r(),i(13,"option",53),d(14,"prompt"),r()(),i(15,"label",54),d(16,"Content"),r(),i(17,"textarea",55),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.content,o)||(a.selectedNode.content=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),r(),i(18,"label",56),d(19,"Provider"),r(),i(20,"select",57),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.provider,o)||(a.selectedNode.provider=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),i(21,"option",58),d(22,"(inherit workflow)"),r(),_(23,ue,2,4,"option",59),r(),i(24,"label",60),d(25,"Model"),r(),i(26,"input",61),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.model,o)||(a.selectedNode.model=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),r(),i(27,"datalist",62),_(28,fe,1,1,"option",63),r(),i(29,"label",64),d(30,"Depends on"),r(),_(31,_e,4,2,"label",65),i(32,"button",66),f("click",function(){m(e);let o=p();return g(o.deleteSelectedNode())}),d(33,"Delete Node"),r(),$()}if(l&2){let e=p();s(5),u("ngModel",e.selectedNode.id),s(3),h("ngModel",e.selectedNode.type),s(9),h("ngModel",e.selectedNode.content),s(3),h("ngModel",e.selectedNode.provider),s(3),u("ngForOf",e.providers),s(3),h("ngModel",e.selectedNode.model),s(2),u("ngForOf",e.modelSuggestions),s(3),u("ngForOf",e.dependencyCandidates)}}function he(l,n){l&1&&(i(0,"div",34),d(1,"Inspector"),r(),i(2,"p",71),d(3,"Select a node to edit its ID, type, command body, and dependencies."),r())}function xe(l,n){if(l&1&&(i(0,"a",72)(1,"span")(2,"strong"),d(3),r(),i(4,"small"),d(5),r()(),i(6,"em"),d(7),r()()),l&2){let e=n.$implicit,t=p();u("routerLink",Y(6,le,e.runId)),s(3),w(e.workflow),s(2),w(e.runId),s(),R(t.statusClass(e.status)),s(),w(e.status)}}function be(l,n){l&1&&(i(0,"p",71),d(1,"No runs yet."),r())}var ie=class l{api=M(oe);router=M(J);route=M(H);palette=[{type:"bash",label:"Bash",description:"Run a shell step"},{type:"command",label:"Command",description:"Use a .vsaf command"},{type:"prompt",label:"Prompt",description:"Call an AI provider"}];workflowName="new-workflow";workflowFolder="";description="Draft workflow";nodes=[];selectedNode;workflows=[];runs=[];providers=[];yamlPreview="";saveState="idle";statusMessage="";draggingType;draggingNodeId;ngOnInit(){this.workflowFolder=W(this.route.snapshot.queryParamMap.get("folder")??""),this.refreshData(),this.resetBuilder();let n=this.route.snapshot.queryParamMap.get("edit");n&&this.loadWorkflow(n)}refreshData(){this.api.getWorkflows().subscribe(n=>this.workflows=n),this.api.getRuns().subscribe(n=>this.runs=n.slice().reverse().slice(0,8)),this.api.getProviders().subscribe({next:n=>this.providers=n.providers??[],error:()=>this.providers=[]})}get modelSuggestions(){let n=this.selectedNode?.provider||re;return this.providers.find(e=>e.name===n)?.defaultModels??[]}resetBuilder(){this.workflowName="new-workflow",this.description="Draft workflow",this.nodes=[this.makeNode("bash",80,100,"setup"),this.makeNode("command",330,170,"review")],this.nodes[1].dependsOn=[this.nodes[0].id],this.selectedNode=this.nodes[0],this.setStatus(""),this.refreshYaml()}get workflowId(){let n=W(this.workflowFolder),e=y(this.workflowName);return n?`${n}/${e}`:e}onPaletteDragStart(n,e){this.draggingType=e,n.dataTransfer?.setData("application/x-vsaf-node-type",e),n.dataTransfer?.setData("text/plain",e)}onNodeDragStart(n,e){this.draggingNodeId=e.id,n.dataTransfer?.setData("application/x-vsaf-node-id",e.id)}onCanvasDragOver(n){n.preventDefault()}onCanvasDrop(n){n.preventDefault();let e=n.currentTarget.getBoundingClientRect(),t=Math.max(18,n.clientX-e.left-95),o=Math.max(18,n.clientY-e.top-24),a=n.dataTransfer?.getData("application/x-vsaf-node-id")||this.draggingNodeId;if(a){let k=this.nodes.find(ae=>ae.id===a);k&&(k.x=t,k.y=o,this.selectNode(k),this.refreshYaml()),this.draggingNodeId=void 0;return}let c=n.dataTransfer?.getData("application/x-vsaf-node-type")||this.draggingType;c&&this.addNode(c,t,o),this.draggingType=void 0}addNode(n,e=90+this.nodes.length*34,t=90+this.nodes.length*42){let o=this.makeNode(n,e,t);this.nodes=[...this.nodes,o],this.selectNode(o),this.refreshYaml()}selectNode(n){this.selectedNode=n}renameSelectedNode(n){if(!this.selectedNode)return;let e=y(n);if(!e)return;let t=this.selectedNode.id;if(t!==e){if(this.nodes.some(o=>o.id===e)){this.setStatus(`Node ID already exists: ${e}`,"error");return}this.selectedNode.id=e;for(let o of this.nodes)o.dependsOn=o.dependsOn.map(a=>a===t?e:a);this.refreshYaml()}}toggleDependency(n,e){if(!this.selectedNode)return;e.target.checked?this.selectedNode.dependsOn=[...new Set([...this.selectedNode.dependsOn,n])]:this.selectedNode.dependsOn=this.selectedNode.dependsOn.filter(o=>o!==n),this.refreshYaml()}deleteSelectedNode(){if(!this.selectedNode)return;let n=this.selectedNode.id;this.nodes=this.nodes.filter(e=>e.id!==n).map(e=>T(B({},e),{dependsOn:e.dependsOn.filter(t=>t!==n)})),this.selectedNode=this.nodes[0],this.refreshYaml()}loadWorkflow(n){this.api.getWorkflow(n).subscribe(e=>{let t=e.id.lastIndexOf("/");this.workflowFolder=t>=0?e.id.slice(0,t):"",this.workflowName=t>=0?e.id.slice(t+1):e.id,this.description=e.description||"Workflow loaded from disk",this.nodes=e.nodes.map((o,a)=>({id:o.id,type:o.type,title:o.id,content:o.content,dependsOn:o.dependsOn,provider:o.provider??"",model:o.model??"",x:80+a%3*250,y:80+Math.floor(a/3)*120})),this.selectedNode=this.nodes[0],this.setStatus(`Loaded ${e.name}`),this.refreshYaml()})}saveWorkflow(){this.saveCurrentWorkflow()}runWorkflow(){this.saveCurrentWorkflow(n=>{this.api.startRun(n,"").subscribe({next:e=>this.router.navigate(["/runs",e.runId]),error:e=>this.setStatus(e?.error?.error??e?.message??"Run failed","error")})})}refreshYaml(){this.yamlPreview=ye(this.workflowName,this.description,this.nodes),this.saveState==="saved"&&(this.saveState="idle")}get dependencyCandidates(){return this.selectedNode?this.nodes.filter(n=>n.id!==this.selectedNode.id):[]}get edges(){let n=new Map(this.nodes.map(t=>[t.id,t])),e=[];for(let t of this.nodes)for(let o of t.dependsOn){let a=n.get(o);a&&e.push({x1:a.x+190,y1:a.y+28,x2:t.x,y2:t.y+28})}return e}iconFor(n){switch(n){case"bash":return"$";case"command":return"/";case"prompt":return"AI"}}statusClass(n){switch(n){case"completed":return"status-completed";case"failed":return"status-failed";case"running":return"status-running";default:return"status-default"}}saveCurrentWorkflow(n){let e=y(this.workflowName),t=W(this.workflowFolder),o=t?`${t}/${e}`:e;if(!e||this.nodes.length===0){this.setStatus("Workflow name and at least one node are required.","error");return}this.workflowName=e,this.refreshYaml(),this.saveState="saving",this.api.saveWorkflow(o,this.yamlPreview).subscribe({next:()=>{this.saveState="saved",this.setStatus(`Saved ${o}`),this.refreshData(),n?.(o)},error:a=>{this.saveState="error",this.setStatus(a?.error?.error??a?.message??"Save failed","error")}})}makeNode(n,e,t,o=n){let a=ve(this.nodes.map(c=>c.id),`${n}-${o}`);return{id:a,type:n,title:a,content:Ce(n,a),dependsOn:[],provider:"",model:"",x:e,y:t}}setStatus(n,e="idle"){this.statusMessage=n,this.saveState=e}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=V({type:l,selectors:[["app-workflow-builder"]],decls:63,vars:19,consts:[["noSelection",""],[1,"builder-shell"],[1,"sidebar"],[1,"brand-row"],[1,"brand-mark"],[1,"brand-title"],[1,"brand-subtitle"],["for","workflow-folder",1,"field-label"],["id","workflow-folder","placeholder","e.g. sdlc/release",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-name",1,"field-label"],["id","workflow-name",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-description",1,"field-label"],["id","workflow-description","rows","3",1,"text-area",3,"ngModelChange","ngModel"],[1,"section-title"],["type","button","class","palette-item","draggable","true",3,"dragstart","click",4,"ngFor","ngForOf"],["type","button","class","workflow-link",3,"click",4,"ngFor","ngForOf"],[1,"workspace"],[1,"toolbar"],[1,"toolbar-actions"],["type","button",1,"ghost-button",3,"click"],["type","button",1,"primary-button",3,"click","disabled"],["type","button",1,"run-button",3,"click","disabled"],["class","status-row",3,"error",4,"ngIf"],[1,"builder-grid"],[1,"canvas",3,"dragover","drop"],[1,"canvas-grid"],["class","empty-state",4,"ngIf"],["aria-hidden","true",1,"edges"],[4,"ngFor","ngForOf"],["type","button","class","node-card","draggable","true",3,"selected","left","top","click","dragstart",4,"ngFor","ngForOf"],[1,"inspector"],[4,"ngIf","ngIfElse"],[1,"bottom-grid"],[1,"yaml-panel"],[1,"panel-title"],[1,"yaml-editor",3,"ngModelChange","ngModel"],[1,"runs-panel"],["class","run-row",3,"routerLink",4,"ngFor","ngForOf"],["class","muted",4,"ngIf"],["type","button","draggable","true",1,"palette-item",3,"dragstart","click"],[1,"palette-icon"],["type","button",1,"workflow-link",3,"click"],[1,"status-row"],[1,"empty-state"],["type","button","draggable","true",1,"node-card",3,"click","dragstart"],[1,"node-kind"],[1,"node-copy"],["for","node-id",1,"field-label"],["id","node-id",1,"text-input",3,"ngModelChange","ngModel"],["for","node-type",1,"field-label"],["id","node-type",1,"text-input",3,"ngModelChange","ngModel"],["value","bash"],["value","command"],["value","prompt"],["for","node-content",1,"field-label"],["id","node-content","rows","7",1,"text-area","mono",3,"ngModelChange","ngModel"],["for","node-provider",1,"field-label"],["id","node-provider",1,"text-input",3,"ngModelChange","ngModel"],["value",""],[3,"value","disabled",4,"ngFor","ngForOf"],["for","node-model",1,"field-label"],["id","node-model","list","builder-model-suggestions","placeholder","(inherit)",1,"text-input",3,"ngModelChange","ngModel"],["id","builder-model-suggestions"],[3,"value",4,"ngFor","ngForOf"],[1,"field-label"],["class","check-row",4,"ngFor","ngForOf"],["type","button",1,"danger-button",3,"click"],[3,"value","disabled"],[3,"value"],[1,"check-row"],["type","checkbox",3,"change","checked"],[1,"muted"],[1,"run-row",3,"routerLink"]],template:function(e,t){if(e&1){let o=C();i(0,"section",1)(1,"aside",2)(2,"div",3)(3,"div",4),d(4,"V"),r(),i(5,"div")(6,"div",5),d(7,"VSAF Builder"),r(),i(8,"div",6),d(9,"Workflow canvas"),r()()(),i(10,"label",7),d(11,"Folder"),r(),i(12,"input",8),b("ngModelChange",function(c){return m(o),x(t.workflowFolder,c)||(t.workflowFolder=c),g(c)}),r(),i(13,"label",9),d(14,"Workflow name"),r(),i(15,"input",10),b("ngModelChange",function(c){return m(o),x(t.workflowName,c)||(t.workflowName=c),g(c)}),f("ngModelChange",function(){return t.refreshYaml()}),r(),i(16,"label",11),d(17,"Description"),r(),i(18,"textarea",12),b("ngModelChange",function(c){return m(o),x(t.description,c)||(t.description=c),g(c)}),f("ngModelChange",function(){return t.refreshYaml()}),r(),i(19,"div",13),d(20,"Node Palette"),r(),_(21,de,8,3,"button",14),i(22,"div",13),d(23,"Existing"),r(),_(24,se,5,2,"button",15),r(),i(25,"main",16)(26,"header",17)(27,"div")(28,"h1"),d(29),r(),i(30,"p"),d(31),r()(),i(32,"div",18)(33,"button",19),f("click",function(){return t.resetBuilder()}),d(34,"New"),r(),i(35,"button",19),f("click",function(){return t.refreshData()}),d(36,"Reload"),r(),i(37,"button",20),f("click",function(){return t.saveWorkflow()}),d(38),r(),i(39,"button",21),f("click",function(){return t.runWorkflow()}),d(40,"Run"),r()()(),_(41,ce,2,3,"div",22),i(42,"div",23)(43,"section",24),f("dragover",function(c){return t.onCanvasDragOver(c)})("drop",function(c){return t.onCanvasDrop(c)}),O(44,"div",25),_(45,pe,5,0,"div",26),S(),i(46,"svg",27),_(47,me,1,4,"line",28),r(),_(48,ge,8,10,"button",29),r(),I(),i(49,"aside",30),_(50,we,34,8,"ng-container",31)(51,he,4,0,"ng-template",null,0,A),r()(),i(53,"section",32)(54,"div",33)(55,"div",34),d(56,"Workflow YAML"),r(),i(57,"textarea",35),b("ngModelChange",function(c){return m(o),x(t.yamlPreview,c)||(t.yamlPreview=c),g(c)}),r()(),i(58,"div",36)(59,"div",34),d(60,"Recent Runs"),r(),_(61,xe,8,8,"a",37)(62,be,2,0,"p",38),r()()()()}if(e&2){let o=z(52);s(12),h("ngModel",t.workflowFolder),s(3),h("ngModel",t.workflowName),s(3),h("ngModel",t.description),s(3),u("ngForOf",t.palette),s(3),u("ngForOf",t.workflows),s(5),w(t.workflowId||"untitled-workflow"),s(2),v("",t.nodes.length," nodes \xB7 drag from palette or click a node to edit"),s(6),u("disabled",t.saveState==="saving"),s(),v(" ",t.saveState==="saving"?"Saving...":"Save Workflow"," "),s(),u("disabled",t.nodes.length===0),s(2),u("ngIf",t.statusMessage),s(4),u("ngIf",t.nodes.length===0),s(2),u("ngForOf",t.edges),s(),u("ngForOf",t.nodes),s(2),u("ngIf",t.selectedNode)("ngIfElse",o),s(7),h("ngModel",t.yamlPreview),s(4),u("ngForOf",t.runs),s(),u("ngIf",t.runs.length===0)}},dependencies:[G,j,q,ne,ee,te,U,Z,X,Q,K],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}button[_ngcontent-%COMP%], input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit}.builder-shell[_ngcontent-%COMP%]{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:calc(100vh - 56px)}.sidebar[_ngcontent-%COMP%]{border-right:1px solid #2b2d33;background:#17181d;padding:16px;overflow:auto}.brand-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-bottom:22px}.brand-mark[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#6366f1;color:#fff;font-weight:700}.brand-title[_ngcontent-%COMP%]{font-size:15px;font-weight:700}.brand-subtitle[_ngcontent-%COMP%], .muted[_ngcontent-%COMP%], small[_ngcontent-%COMP%]{color:#9ca3af}.field-label[_ngcontent-%COMP%], .section-title[_ngcontent-%COMP%]{display:block;margin:14px 0 7px;color:#a1a1aa;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}.text-input[_ngcontent-%COMP%], .text-area[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#101114;color:#f4f4f5;padding:9px 10px;outline:none}.text-input[_ngcontent-%COMP%]:focus, .text-area[_ngcontent-%COMP%]:focus, .yaml-editor[_ngcontent-%COMP%]:focus{border-color:#6366f1;box-shadow:0 0 0 2px #6366f12e}.text-area[_ngcontent-%COMP%]{resize:vertical}.mono[_ngcontent-%COMP%], .yaml-editor[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.palette-item[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #2b2d33;border-radius:8px;background:#1f2128;color:#e7e7ea;padding:10px;margin-bottom:8px;text-align:left;cursor:grab}.palette-item[_ngcontent-%COMP%]:hover, .workflow-link[_ngcontent-%COMP%]:hover{border-color:#4f46e5;background:#242633}.palette-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:28px;height:28px;border-radius:7px;background:#111827;color:#a5b4fc}.palette-item[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:13px}.palette-item[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;font-size:11px;margin-top:2px}.workflow-link[_ngcontent-%COMP%]{justify-content:space-between;cursor:pointer}.workspace[_ngcontent-%COMP%]{min-width:0;padding:18px;overflow:auto}.toolbar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:12px}.toolbar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:20px}.toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:#9ca3af;font-size:13px}.toolbar-actions[_ngcontent-%COMP%]{display:flex;gap:8px;flex-wrap:wrap}.ghost-button[_ngcontent-%COMP%], .primary-button[_ngcontent-%COMP%], .run-button[_ngcontent-%COMP%], .danger-button[_ngcontent-%COMP%]{border:1px solid #333640;border-radius:7px;padding:8px 12px;color:#f4f4f5;background:#20222a;cursor:pointer}.primary-button[_ngcontent-%COMP%]{background:#4f46e5;border-color:#4f46e5}.run-button[_ngcontent-%COMP%]{background:#059669;border-color:#059669}.danger-button[_ngcontent-%COMP%]{width:100%;margin-top:14px;background:#3f1d24;border-color:#7f1d1d;color:#fecaca}.primary-button[_ngcontent-%COMP%]:disabled, .run-button[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed}.status-row[_ngcontent-%COMP%]{border:1px solid #1f5f45;border-radius:8px;background:#092d22;color:#a7f3d0;padding:10px 12px;margin-bottom:12px;font-size:13px}.status-row.error[_ngcontent-%COMP%]{border-color:#7f1d1d;background:#2a1217;color:#fecaca}.builder-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(520px,1fr) 320px;gap:14px;min-height:470px}.canvas[_ngcontent-%COMP%]{position:relative;overflow:hidden;min-height:470px;border:1px solid #2b2d33;border-radius:8px;background:#15161b}.canvas-grid[_ngcontent-%COMP%]{position:absolute;inset:0;background-image:linear-gradient(#24262e 1px,transparent 1px),linear-gradient(90deg,#24262e 1px,transparent 1px);background-size:28px 28px;opacity:.45}.empty-state[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-content:center;text-align:center;color:#9ca3af;pointer-events:none}.empty-state[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 6px;color:#e7e7ea}.edges[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.edges[_ngcontent-%COMP%] line[_ngcontent-%COMP%]{stroke:#6366f1;stroke-width:2;stroke-dasharray:5 5;opacity:.8}.node-card[_ngcontent-%COMP%]{position:absolute;z-index:2;display:flex;align-items:center;gap:10px;width:190px;border:1px solid #3f4250;border-radius:8px;background:#20222a;color:#f4f4f5;padding:11px;cursor:move;text-align:left;box-shadow:0 12px 28px #00000038}.node-card.selected[_ngcontent-%COMP%]{border-color:#818cf8;box-shadow:0 0 0 2px #6366f147,0 12px 28px #00000038}.node-kind[_ngcontent-%COMP%]{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;background:#111827;color:#a5b4fc}.node-copy[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-copy[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-copy[_ngcontent-%COMP%]{min-width:0}.inspector[_ngcontent-%COMP%], .yaml-panel[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%]{border:1px solid #2b2d33;border-radius:8px;background:#17181d;padding:14px}.panel-title[_ngcontent-%COMP%]{margin-bottom:12px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#d4d4d8}.check-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:8px 0;color:#d4d4d8;font-size:13px}.bottom-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;margin-top:14px}.yaml-editor[_ngcontent-%COMP%]{width:100%;min-height:260px;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#0f1014;color:#d4d4d8;padding:12px;resize:vertical}.run-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:10px 0;color:#e7e7ea;text-decoration:none;border-bottom:1px solid #252730}.run-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.status-completed[_ngcontent-%COMP%]{color:#34d399}.status-failed[_ngcontent-%COMP%]{color:#f87171}.status-running[_ngcontent-%COMP%]{color:#60a5fa}.status-default[_ngcontent-%COMP%]{color:#a1a1aa}@media(max-width:980px){.builder-shell[_ngcontent-%COMP%], .builder-grid[_ngcontent-%COMP%], .bottom-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.sidebar[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid #2b2d33}.toolbar[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column}}"]})};function Ce(l,n){switch(l){case"bash":return`echo "${n}"`;case"command":return n;case"prompt":return`Complete ${n} and summarize the result.`}}var re="claude";function ye(l,n,e){let t=[`name: ${y(l)||"new-workflow"}`,`description: ${E(n||"Draft workflow")}`,`provider: ${re}`,"model: sonnet","nodes:"];for(let o of e)if(t.push(` - id: ${o.id}`),o.dependsOn.length>0&&t.push(` depends_on: [${o.dependsOn.join(", ")}]`),o.provider&&t.push(` provider: ${o.provider}`),o.model&&t.push(` model: ${o.model}`),o.type==="bash")t.push(` bash: ${E(o.content||"echo ok")}`);else if(o.type==="command")t.push(` command: ${E(o.content||o.id)}`);else{t.push(" prompt: |");for(let a of(o.content||`Complete ${o.id}`).split(`
|
|
1
|
+
import{b as H,d as J,e as K}from"./chunk-UN7U5NAR.js";import{a as U,b as X,e as Q,g as Z,h as ee,i as te,j as ne,k as oe}from"./chunk-LPQARKUF.js";import{Ba as V,Fa as _,Jb as j,Ka as F,Kb as q,O as M,Ob as G,Qa as u,Ra as i,Sa as r,T as m,Ta as O,U as g,Ua as D,V as S,Va as $,W as I,Xa as C,Ya as f,Za as p,a as B,b as T,cb as z,db as L,eb as P,fb as R,gb as d,hb as w,ib as v,jb as N,kb as h,lb as x,mb as b,pb as Y,qa as s,sb as A}from"./chunk-WDOCF7IL.js";var le=l=>["/runs",l];function de(l,n){if(l&1){let e=C();i(0,"button",39),f("dragstart",function(o){let a=m(e).$implicit,c=p();return g(c.onPaletteDragStart(o,a.type))})("click",function(){let o=m(e).$implicit,a=p();return g(a.addNode(o.type))}),i(1,"span",40),d(2),r(),i(3,"span")(4,"strong"),d(5),r(),i(6,"small"),d(7),r()()()}if(l&2){let e=n.$implicit,t=p();s(2),w(t.iconFor(e.type)),s(3),w(e.label),s(2),w(e.description)}}function se(l,n){if(l&1){let e=C();i(0,"button",41),f("click",function(){let o=m(e).$implicit,a=p();return g(a.loadWorkflow(o.id))}),i(1,"span"),d(2),r(),i(3,"small"),d(4),r()()}if(l&2){let e=n.$implicit;s(2),w(e.name),s(2),v("",e.nodeCount," nodes")}}function ce(l,n){if(l&1&&(i(0,"div",42),d(1),r()),l&2){let e=p();P("error",e.saveState==="error"),s(),v(" ",e.statusMessage," ")}}function pe(l,n){l&1&&(i(0,"div",43)(1,"h2"),d(2,"Drop nodes here"),r(),i(3,"p"),d(4,"Build a DAG by adding Bash, Command, and Prompt nodes."),r()())}function me(l,n){if(l&1&&(S(),O(0,"line")),l&2){let e=n.$implicit;F("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2)}}function ge(l,n){if(l&1){let e=C();i(0,"button",44),f("click",function(){let o=m(e).$implicit,a=p();return g(a.selectNode(o))})("dragstart",function(o){let a=m(e).$implicit,c=p();return g(c.onNodeDragStart(o,a))}),i(1,"span",45),d(2),r(),i(3,"span",46)(4,"strong"),d(5),r(),i(6,"small"),d(7),r()()()}if(l&2){let e=n.$implicit,t=p();L("left",e.x,"px")("top",e.y,"px"),P("selected",(t.selectedNode==null?null:t.selectedNode.id)===e.id),s(2),w(t.iconFor(e.type)),s(3),w(e.id),s(2),N("",e.type," \xB7 ",e.dependsOn.length||0," deps")}}function ue(l,n){if(l&1&&(i(0,"option",67),d(1),r()),l&2){let e=n.$implicit;u("value",e.name)("disabled",!e.available),s(),N(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function fe(l,n){if(l&1&&O(0,"option",68),l&2){let e=n.$implicit;u("value",e)}}function _e(l,n){if(l&1){let e=C();i(0,"label",69)(1,"input",70),f("change",function(o){let a=m(e).$implicit,c=p(2);return g(c.toggleDependency(a.id,o))}),r(),i(2,"span"),d(3),r()()}if(l&2){let e=n.$implicit,t=p(2);s(),u("checked",t.selectedNode.dependsOn.includes(e.id)),s(2),w(e.id)}}function we(l,n){if(l&1){let e=C();D(0),i(1,"div",34),d(2,"Inspector"),r(),i(3,"label",47),d(4,"Node ID"),r(),i(5,"input",48),f("ngModelChange",function(o){m(e);let a=p();return g(a.renameSelectedNode(o))}),r(),i(6,"label",49),d(7,"Type"),r(),i(8,"select",50),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.type,o)||(a.selectedNode.type=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),i(9,"option",51),d(10,"bash"),r(),i(11,"option",52),d(12,"command"),r(),i(13,"option",53),d(14,"prompt"),r()(),i(15,"label",54),d(16,"Content"),r(),i(17,"textarea",55),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.content,o)||(a.selectedNode.content=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),r(),i(18,"label",56),d(19,"Provider"),r(),i(20,"select",57),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.provider,o)||(a.selectedNode.provider=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),i(21,"option",58),d(22,"(inherit workflow)"),r(),_(23,ue,2,4,"option",59),r(),i(24,"label",60),d(25,"Model"),r(),i(26,"input",61),b("ngModelChange",function(o){m(e);let a=p();return x(a.selectedNode.model,o)||(a.selectedNode.model=o),g(o)}),f("ngModelChange",function(){m(e);let o=p();return g(o.refreshYaml())}),r(),i(27,"datalist",62),_(28,fe,1,1,"option",63),r(),i(29,"label",64),d(30,"Depends on"),r(),_(31,_e,4,2,"label",65),i(32,"button",66),f("click",function(){m(e);let o=p();return g(o.deleteSelectedNode())}),d(33,"Delete Node"),r(),$()}if(l&2){let e=p();s(5),u("ngModel",e.selectedNode.id),s(3),h("ngModel",e.selectedNode.type),s(9),h("ngModel",e.selectedNode.content),s(3),h("ngModel",e.selectedNode.provider),s(3),u("ngForOf",e.providers),s(3),h("ngModel",e.selectedNode.model),s(2),u("ngForOf",e.modelSuggestions),s(3),u("ngForOf",e.dependencyCandidates)}}function he(l,n){l&1&&(i(0,"div",34),d(1,"Inspector"),r(),i(2,"p",71),d(3,"Select a node to edit its ID, type, command body, and dependencies."),r())}function xe(l,n){if(l&1&&(i(0,"a",72)(1,"span")(2,"strong"),d(3),r(),i(4,"small"),d(5),r()(),i(6,"em"),d(7),r()()),l&2){let e=n.$implicit,t=p();u("routerLink",Y(6,le,e.runId)),s(3),w(e.workflow),s(2),w(e.runId),s(),R(t.statusClass(e.status)),s(),w(e.status)}}function be(l,n){l&1&&(i(0,"p",71),d(1,"No runs yet."),r())}var ie=class l{api=M(oe);router=M(J);route=M(H);palette=[{type:"bash",label:"Bash",description:"Run a shell step"},{type:"command",label:"Command",description:"Use a .vsaf command"},{type:"prompt",label:"Prompt",description:"Call an AI provider"}];workflowName="new-workflow";workflowFolder="";description="Draft workflow";nodes=[];selectedNode;workflows=[];runs=[];providers=[];yamlPreview="";saveState="idle";statusMessage="";draggingType;draggingNodeId;ngOnInit(){this.workflowFolder=W(this.route.snapshot.queryParamMap.get("folder")??""),this.refreshData(),this.resetBuilder();let n=this.route.snapshot.queryParamMap.get("edit");n&&this.loadWorkflow(n)}refreshData(){this.api.getWorkflows().subscribe(n=>this.workflows=n),this.api.getRuns().subscribe(n=>this.runs=n.slice().reverse().slice(0,8)),this.api.getProviders().subscribe({next:n=>this.providers=n.providers??[],error:()=>this.providers=[]})}get modelSuggestions(){let n=this.selectedNode?.provider||re;return this.providers.find(e=>e.name===n)?.defaultModels??[]}resetBuilder(){this.workflowName="new-workflow",this.description="Draft workflow",this.nodes=[this.makeNode("bash",80,100,"setup"),this.makeNode("command",330,170,"review")],this.nodes[1].dependsOn=[this.nodes[0].id],this.selectedNode=this.nodes[0],this.setStatus(""),this.refreshYaml()}get workflowId(){let n=W(this.workflowFolder),e=y(this.workflowName);return n?`${n}/${e}`:e}onPaletteDragStart(n,e){this.draggingType=e,n.dataTransfer?.setData("application/x-vsaf-node-type",e),n.dataTransfer?.setData("text/plain",e)}onNodeDragStart(n,e){this.draggingNodeId=e.id,n.dataTransfer?.setData("application/x-vsaf-node-id",e.id)}onCanvasDragOver(n){n.preventDefault()}onCanvasDrop(n){n.preventDefault();let e=n.currentTarget.getBoundingClientRect(),t=Math.max(18,n.clientX-e.left-95),o=Math.max(18,n.clientY-e.top-24),a=n.dataTransfer?.getData("application/x-vsaf-node-id")||this.draggingNodeId;if(a){let k=this.nodes.find(ae=>ae.id===a);k&&(k.x=t,k.y=o,this.selectNode(k),this.refreshYaml()),this.draggingNodeId=void 0;return}let c=n.dataTransfer?.getData("application/x-vsaf-node-type")||this.draggingType;c&&this.addNode(c,t,o),this.draggingType=void 0}addNode(n,e=90+this.nodes.length*34,t=90+this.nodes.length*42){let o=this.makeNode(n,e,t);this.nodes=[...this.nodes,o],this.selectNode(o),this.refreshYaml()}selectNode(n){this.selectedNode=n}renameSelectedNode(n){if(!this.selectedNode)return;let e=y(n);if(!e)return;let t=this.selectedNode.id;if(t!==e){if(this.nodes.some(o=>o.id===e)){this.setStatus(`Node ID already exists: ${e}`,"error");return}this.selectedNode.id=e;for(let o of this.nodes)o.dependsOn=o.dependsOn.map(a=>a===t?e:a);this.refreshYaml()}}toggleDependency(n,e){if(!this.selectedNode)return;e.target.checked?this.selectedNode.dependsOn=[...new Set([...this.selectedNode.dependsOn,n])]:this.selectedNode.dependsOn=this.selectedNode.dependsOn.filter(o=>o!==n),this.refreshYaml()}deleteSelectedNode(){if(!this.selectedNode)return;let n=this.selectedNode.id;this.nodes=this.nodes.filter(e=>e.id!==n).map(e=>T(B({},e),{dependsOn:e.dependsOn.filter(t=>t!==n)})),this.selectedNode=this.nodes[0],this.refreshYaml()}loadWorkflow(n){this.api.getWorkflow(n).subscribe(e=>{let t=e.id.lastIndexOf("/");this.workflowFolder=t>=0?e.id.slice(0,t):"",this.workflowName=t>=0?e.id.slice(t+1):e.id,this.description=e.description||"Workflow loaded from disk",this.nodes=e.nodes.map((o,a)=>({id:o.id,type:o.type,title:o.id,content:o.content,dependsOn:o.dependsOn,provider:o.provider??"",model:o.model??"",x:80+a%3*250,y:80+Math.floor(a/3)*120})),this.selectedNode=this.nodes[0],this.setStatus(`Loaded ${e.name}`),this.refreshYaml()})}saveWorkflow(){this.saveCurrentWorkflow()}runWorkflow(){this.saveCurrentWorkflow(n=>{this.api.startRun(n,"").subscribe({next:e=>this.router.navigate(["/runs",e.runId]),error:e=>this.setStatus(e?.error?.error??e?.message??"Run failed","error")})})}refreshYaml(){this.yamlPreview=ye(this.workflowName,this.description,this.nodes),this.saveState==="saved"&&(this.saveState="idle")}get dependencyCandidates(){return this.selectedNode?this.nodes.filter(n=>n.id!==this.selectedNode.id):[]}get edges(){let n=new Map(this.nodes.map(t=>[t.id,t])),e=[];for(let t of this.nodes)for(let o of t.dependsOn){let a=n.get(o);a&&e.push({x1:a.x+190,y1:a.y+28,x2:t.x,y2:t.y+28})}return e}iconFor(n){switch(n){case"bash":return"$";case"command":return"/";case"prompt":return"AI"}}statusClass(n){switch(n){case"completed":return"status-completed";case"failed":return"status-failed";case"running":return"status-running";default:return"status-default"}}saveCurrentWorkflow(n){let e=y(this.workflowName),t=W(this.workflowFolder),o=t?`${t}/${e}`:e;if(!e||this.nodes.length===0){this.setStatus("Workflow name and at least one node are required.","error");return}this.workflowName=e,this.refreshYaml(),this.saveState="saving",this.api.saveWorkflow(o,this.yamlPreview).subscribe({next:()=>{this.saveState="saved",this.setStatus(`Saved ${o}`),this.refreshData(),n?.(o)},error:a=>{this.saveState="error",this.setStatus(a?.error?.error??a?.message??"Save failed","error")}})}makeNode(n,e,t,o=n){let a=ve(this.nodes.map(c=>c.id),`${n}-${o}`);return{id:a,type:n,title:a,content:Ce(n,a),dependsOn:[],provider:"",model:"",x:e,y:t}}setStatus(n,e="idle"){this.statusMessage=n,this.saveState=e}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=V({type:l,selectors:[["app-workflow-builder"]],decls:63,vars:19,consts:[["noSelection",""],[1,"builder-shell"],[1,"sidebar"],[1,"brand-row"],[1,"brand-mark"],[1,"brand-title"],[1,"brand-subtitle"],["for","workflow-folder",1,"field-label"],["id","workflow-folder","placeholder","e.g. sdlc/release",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-name",1,"field-label"],["id","workflow-name",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-description",1,"field-label"],["id","workflow-description","rows","3",1,"text-area",3,"ngModelChange","ngModel"],[1,"section-title"],["type","button","class","palette-item","draggable","true",3,"dragstart","click",4,"ngFor","ngForOf"],["type","button","class","workflow-link",3,"click",4,"ngFor","ngForOf"],[1,"workspace"],[1,"toolbar"],[1,"toolbar-actions"],["type","button",1,"ghost-button",3,"click"],["type","button",1,"primary-button",3,"click","disabled"],["type","button",1,"run-button",3,"click","disabled"],["class","status-row",3,"error",4,"ngIf"],[1,"builder-grid"],[1,"canvas",3,"dragover","drop"],[1,"canvas-grid"],["class","empty-state",4,"ngIf"],["aria-hidden","true",1,"edges"],[4,"ngFor","ngForOf"],["type","button","class","node-card","draggable","true",3,"selected","left","top","click","dragstart",4,"ngFor","ngForOf"],[1,"inspector"],[4,"ngIf","ngIfElse"],[1,"bottom-grid"],[1,"yaml-panel"],[1,"panel-title"],[1,"yaml-editor",3,"ngModelChange","ngModel"],[1,"runs-panel"],["class","run-row",3,"routerLink",4,"ngFor","ngForOf"],["class","muted",4,"ngIf"],["type","button","draggable","true",1,"palette-item",3,"dragstart","click"],[1,"palette-icon"],["type","button",1,"workflow-link",3,"click"],[1,"status-row"],[1,"empty-state"],["type","button","draggable","true",1,"node-card",3,"click","dragstart"],[1,"node-kind"],[1,"node-copy"],["for","node-id",1,"field-label"],["id","node-id",1,"text-input",3,"ngModelChange","ngModel"],["for","node-type",1,"field-label"],["id","node-type",1,"text-input",3,"ngModelChange","ngModel"],["value","bash"],["value","command"],["value","prompt"],["for","node-content",1,"field-label"],["id","node-content","rows","7",1,"text-area","mono",3,"ngModelChange","ngModel"],["for","node-provider",1,"field-label"],["id","node-provider",1,"text-input",3,"ngModelChange","ngModel"],["value",""],[3,"value","disabled",4,"ngFor","ngForOf"],["for","node-model",1,"field-label"],["id","node-model","list","builder-model-suggestions","placeholder","(inherit)",1,"text-input",3,"ngModelChange","ngModel"],["id","builder-model-suggestions"],[3,"value",4,"ngFor","ngForOf"],[1,"field-label"],["class","check-row",4,"ngFor","ngForOf"],["type","button",1,"danger-button",3,"click"],[3,"value","disabled"],[3,"value"],[1,"check-row"],["type","checkbox",3,"change","checked"],[1,"muted"],[1,"run-row",3,"routerLink"]],template:function(e,t){if(e&1){let o=C();i(0,"section",1)(1,"aside",2)(2,"div",3)(3,"div",4),d(4,"V"),r(),i(5,"div")(6,"div",5),d(7,"VSAF Builder"),r(),i(8,"div",6),d(9,"Workflow canvas"),r()()(),i(10,"label",7),d(11,"Folder"),r(),i(12,"input",8),b("ngModelChange",function(c){return m(o),x(t.workflowFolder,c)||(t.workflowFolder=c),g(c)}),r(),i(13,"label",9),d(14,"Workflow name"),r(),i(15,"input",10),b("ngModelChange",function(c){return m(o),x(t.workflowName,c)||(t.workflowName=c),g(c)}),f("ngModelChange",function(){return t.refreshYaml()}),r(),i(16,"label",11),d(17,"Description"),r(),i(18,"textarea",12),b("ngModelChange",function(c){return m(o),x(t.description,c)||(t.description=c),g(c)}),f("ngModelChange",function(){return t.refreshYaml()}),r(),i(19,"div",13),d(20,"Node Palette"),r(),_(21,de,8,3,"button",14),i(22,"div",13),d(23,"Existing"),r(),_(24,se,5,2,"button",15),r(),i(25,"main",16)(26,"header",17)(27,"div")(28,"h1"),d(29),r(),i(30,"p"),d(31),r()(),i(32,"div",18)(33,"button",19),f("click",function(){return t.resetBuilder()}),d(34,"New"),r(),i(35,"button",19),f("click",function(){return t.refreshData()}),d(36,"Reload"),r(),i(37,"button",20),f("click",function(){return t.saveWorkflow()}),d(38),r(),i(39,"button",21),f("click",function(){return t.runWorkflow()}),d(40,"Run"),r()()(),_(41,ce,2,3,"div",22),i(42,"div",23)(43,"section",24),f("dragover",function(c){return t.onCanvasDragOver(c)})("drop",function(c){return t.onCanvasDrop(c)}),O(44,"div",25),_(45,pe,5,0,"div",26),S(),i(46,"svg",27),_(47,me,1,4,"line",28),r(),_(48,ge,8,10,"button",29),r(),I(),i(49,"aside",30),_(50,we,34,8,"ng-container",31)(51,he,4,0,"ng-template",null,0,A),r()(),i(53,"section",32)(54,"div",33)(55,"div",34),d(56,"Workflow YAML"),r(),i(57,"textarea",35),b("ngModelChange",function(c){return m(o),x(t.yamlPreview,c)||(t.yamlPreview=c),g(c)}),r()(),i(58,"div",36)(59,"div",34),d(60,"Recent Runs"),r(),_(61,xe,8,8,"a",37)(62,be,2,0,"p",38),r()()()()}if(e&2){let o=z(52);s(12),h("ngModel",t.workflowFolder),s(3),h("ngModel",t.workflowName),s(3),h("ngModel",t.description),s(3),u("ngForOf",t.palette),s(3),u("ngForOf",t.workflows),s(5),w(t.workflowId||"untitled-workflow"),s(2),v("",t.nodes.length," nodes \xB7 drag from palette or click a node to edit"),s(6),u("disabled",t.saveState==="saving"),s(),v(" ",t.saveState==="saving"?"Saving...":"Save Workflow"," "),s(),u("disabled",t.nodes.length===0),s(2),u("ngIf",t.statusMessage),s(4),u("ngIf",t.nodes.length===0),s(2),u("ngForOf",t.edges),s(),u("ngForOf",t.nodes),s(2),u("ngIf",t.selectedNode)("ngIfElse",o),s(7),h("ngModel",t.yamlPreview),s(4),u("ngForOf",t.runs),s(),u("ngIf",t.runs.length===0)}},dependencies:[G,j,q,ne,ee,te,U,Z,X,Q,K],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}button[_ngcontent-%COMP%], input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit}.builder-shell[_ngcontent-%COMP%]{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:calc(100vh - 56px)}.sidebar[_ngcontent-%COMP%]{border-right:1px solid #2b2d33;background:#17181d;padding:16px;overflow:auto}.brand-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-bottom:22px}.brand-mark[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#6366f1;color:#fff;font-weight:700}.brand-title[_ngcontent-%COMP%]{font-size:15px;font-weight:700}.brand-subtitle[_ngcontent-%COMP%], .muted[_ngcontent-%COMP%], small[_ngcontent-%COMP%]{color:#9ca3af}.field-label[_ngcontent-%COMP%], .section-title[_ngcontent-%COMP%]{display:block;margin:14px 0 7px;color:#a1a1aa;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}.text-input[_ngcontent-%COMP%], .text-area[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#101114;color:#f4f4f5;padding:9px 10px;outline:none}.text-input[_ngcontent-%COMP%]:focus, .text-area[_ngcontent-%COMP%]:focus, .yaml-editor[_ngcontent-%COMP%]:focus{border-color:#6366f1;box-shadow:0 0 0 2px #6366f12e}.text-area[_ngcontent-%COMP%]{resize:vertical}.mono[_ngcontent-%COMP%], .yaml-editor[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.palette-item[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #2b2d33;border-radius:8px;background:#1f2128;color:#e7e7ea;padding:10px;margin-bottom:8px;text-align:left;cursor:grab}.palette-item[_ngcontent-%COMP%]:hover, .workflow-link[_ngcontent-%COMP%]:hover{border-color:#4f46e5;background:#242633}.palette-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:28px;height:28px;border-radius:7px;background:#111827;color:#a5b4fc}.palette-item[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:13px}.palette-item[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;font-size:11px;margin-top:2px}.workflow-link[_ngcontent-%COMP%]{justify-content:space-between;cursor:pointer}.workspace[_ngcontent-%COMP%]{min-width:0;padding:18px;overflow:auto}.toolbar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:12px}.toolbar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:20px}.toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:#9ca3af;font-size:13px}.toolbar-actions[_ngcontent-%COMP%]{display:flex;gap:8px;flex-wrap:wrap}.ghost-button[_ngcontent-%COMP%], .primary-button[_ngcontent-%COMP%], .run-button[_ngcontent-%COMP%], .danger-button[_ngcontent-%COMP%]{border:1px solid #333640;border-radius:7px;padding:8px 12px;color:#f4f4f5;background:#20222a;cursor:pointer}.primary-button[_ngcontent-%COMP%]{background:#4f46e5;border-color:#4f46e5}.run-button[_ngcontent-%COMP%]{background:#059669;border-color:#059669}.danger-button[_ngcontent-%COMP%]{width:100%;margin-top:14px;background:#3f1d24;border-color:#7f1d1d;color:#fecaca}.primary-button[_ngcontent-%COMP%]:disabled, .run-button[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed}.status-row[_ngcontent-%COMP%]{border:1px solid #1f5f45;border-radius:8px;background:#092d22;color:#a7f3d0;padding:10px 12px;margin-bottom:12px;font-size:13px}.status-row.error[_ngcontent-%COMP%]{border-color:#7f1d1d;background:#2a1217;color:#fecaca}.builder-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(520px,1fr) 320px;gap:14px;min-height:470px}.canvas[_ngcontent-%COMP%]{position:relative;overflow:hidden;min-height:470px;border:1px solid #2b2d33;border-radius:8px;background:#15161b}.canvas-grid[_ngcontent-%COMP%]{position:absolute;inset:0;background-image:linear-gradient(#24262e 1px,transparent 1px),linear-gradient(90deg,#24262e 1px,transparent 1px);background-size:28px 28px;opacity:.45}.empty-state[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-content:center;text-align:center;color:#9ca3af;pointer-events:none}.empty-state[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 6px;color:#e7e7ea}.edges[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.edges[_ngcontent-%COMP%] line[_ngcontent-%COMP%]{stroke:#6366f1;stroke-width:2;stroke-dasharray:5 5;opacity:.8}.node-card[_ngcontent-%COMP%]{position:absolute;z-index:2;display:flex;align-items:center;gap:10px;width:190px;border:1px solid #3f4250;border-radius:8px;background:#20222a;color:#f4f4f5;padding:11px;cursor:move;text-align:left;box-shadow:0 12px 28px #00000038}.node-card.selected[_ngcontent-%COMP%]{border-color:#818cf8;box-shadow:0 0 0 2px #6366f147,0 12px 28px #00000038}.node-kind[_ngcontent-%COMP%]{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;background:#111827;color:#a5b4fc}.node-copy[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-copy[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-copy[_ngcontent-%COMP%]{min-width:0}.inspector[_ngcontent-%COMP%], .yaml-panel[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%]{border:1px solid #2b2d33;border-radius:8px;background:#17181d;padding:14px}.panel-title[_ngcontent-%COMP%]{margin-bottom:12px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#d4d4d8}.check-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:8px 0;color:#d4d4d8;font-size:13px}.bottom-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;margin-top:14px}.yaml-editor[_ngcontent-%COMP%]{width:100%;min-height:260px;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#0f1014;color:#d4d4d8;padding:12px;resize:vertical}.run-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:10px 0;color:#e7e7ea;text-decoration:none;border-bottom:1px solid #252730}.run-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.status-completed[_ngcontent-%COMP%]{color:#34d399}.status-failed[_ngcontent-%COMP%]{color:#f87171}.status-running[_ngcontent-%COMP%]{color:#60a5fa}.status-default[_ngcontent-%COMP%]{color:#a1a1aa}@media(max-width:980px){.builder-shell[_ngcontent-%COMP%], .builder-grid[_ngcontent-%COMP%], .bottom-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.sidebar[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid #2b2d33}.toolbar[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column}}"]})};function Ce(l,n){switch(l){case"bash":return`echo "${n}"`;case"command":return n;case"prompt":return`Complete ${n} and summarize the result.`}}var re="claude";function ye(l,n,e){let t=[`name: ${y(l)||"new-workflow"}`,`description: ${E(n||"Draft workflow")}`,`provider: ${re}`,"model: sonnet","nodes:"];for(let o of e)if(t.push(` - id: ${o.id}`),o.dependsOn.length>0&&t.push(` depends_on: [${o.dependsOn.join(", ")}]`),o.provider&&t.push(` provider: ${o.provider}`),o.model&&t.push(` model: ${o.model}`),o.type==="bash")t.push(` bash: ${E(o.content||"echo ok")}`);else if(o.type==="command")t.push(` command: ${E(o.content||o.id)}`);else{t.push(" prompt: |");for(let a of(o.content||`Complete ${o.id}`).split(`
|
|
2
2
|
`))t.push(` ${a}`)}return`${t.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`}function y(l){return l.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function W(l){return l.split("/").map(y).filter(Boolean).join("/")}function ve(l,n){let e=y(n)||"node";if(!l.includes(e))return e;let t=2;for(;l.includes(`${e}-${t}`);)t++;return`${e}-${t}`}function E(l){return JSON.stringify(l)}export{ie as WorkflowBuilderComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as D,d as T,e as L}from"./chunk-UN7U5NAR.js";import{a as F,b as V,c as A,d as H,e as K,f as z,j as W,k as B}from"./chunk-LPQARKUF.js";import{Ba as S,Ka as x,La as g,Ma as f,O as u,Oa as v,Ob as R,Pa as C,Qa as _,Ra as o,Sa as a,T as y,U as h,Xa as k,Ya as w,Za as d,da as m,eb as O,gb as r,hb as p,jb as P,kb as I,lb as E,mb as N,qa as s}from"./chunk-WDOCF7IL.js";function $(t){let n=t.metadata?.category;return n==="gate"?"gate":n==="workflow_status"?"status":"text"}function j(t){return t.title?t.title:t.runs.length>0?t.runs[0].workflow_name:t.id}function b(t){return t.runs.length?t.runs[t.runs.length-1].id:void 0}var M=(t,n)=>n.id;function q(t,n){t&1&&(o(0,"p",2),r(1,"No conversations yet. Start a run or send a message."),a())}function J(t,n){if(t&1&&(o(0,"span",8),r(1),a()),t&2){let e=n.$implicit;x("data-status",e.status),s(),P("",e.workflow_name," \xB7 ",e.status)}}function Q(t,n){if(t&1&&(o(0,"a",5)(1,"span",6),r(2),a(),o(3,"span",7),v(4,J,2,3,"span",8,M),a()()),t&2){let e=n.$implicit,i=d();O("active",e.id===i.selectedId()),_("routerLink",i.linkFor(e)),s(2),p(i.label(e)),s(2),C(e.runs)}}function X(t,n){t&1&&(o(0,"p",2),r(1,"Select a conversation to view its messages."),a())}function Y(t,n){if(t&1&&(o(0,"div",10)(1,"span",15),r(2),a(),o(3,"p",16),r(4),a()()),t&2){let e=n.$implicit,i=d(2);x("data-role",e.role)("data-kind",i.kind(e)),s(2),p(e.role),s(2),p(e.content)}}function Z(t,n){if(t&1&&(o(0,"p",14),r(1),a()),t&2){let e=d(2);s(),p(e.lastReply())}}function ee(t,n){if(t&1){let e=k();o(0,"div",9),v(1,Y,5,4,"div",10,M),a(),o(3,"form",11),w("ngSubmit",function(){y(e);let l=d();return h(l.send())}),o(4,"input",12),N("ngModelChange",function(l){y(e);let c=d();return E(c.draft,l)||(c.draft=l),h(l)}),a(),o(5,"button",13),r(6,"Send"),a()(),g(7,Z,2,1,"p",14)}if(t&2){let e=d();s(),C(e.messages()),s(3),I("ngModel",e.draft),_("disabled",e.sending()),s(),_("disabled",e.sending()||!e.draft.trim()),s(2),f(e.lastReply()?7:-1)}}var G=class t{api=u(B);route=u(D);router=u(T);pollHandle;paramSub;conversations=m([]);messages=m([]);selectedId=m(null);sending=m(!1);lastReply=m("");draft="";ngOnInit(){this.paramSub=this.route.paramMap.subscribe(n=>{let e=n.get("conversationId");this.selectedId.set(e),this.refresh(),e&&this.api.listConversations().subscribe(i=>{let l=i.conversations.find(U=>U.id===e),c=l?b(l):void 0;c&&this.router.navigate(["/runs",c],{replaceUrl:!0})})}),this.pollHandle=setInterval(()=>this.refreshMessages(),4e3)}ngOnDestroy(){this.pollHandle&&clearInterval(this.pollHandle),this.paramSub?.unsubscribe()}label=j;kind=$;linkFor(n){let e=b(n);return e?["/runs",e]:["/conversations",n.id]}refresh(){this.api.listConversations().subscribe(n=>this.conversations.set(n.conversations)),this.refreshMessages()}refreshMessages(){let n=this.selectedId();n&&this.api.getConversationMessages(n).subscribe({next:e=>this.messages.set(e.messages),error:()=>this.messages.set([])})}send(){let n=this.selectedId(),e=this.draft.trim();!n||!e||(this.sending.set(!0),this.api.sendConversationMessage(n,e).subscribe({next:i=>{this.lastReply.set(i.reply),this.draft="",this.sending.set(!1),this.refresh()},error:()=>this.sending.set(!1)}))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=S({type:t,selectors:[["app-conversations"]],decls:10,vars:2,consts:[[1,"conversations-layout"],[1,"conversations-sidebar"],[1,"empty"],[1,"conversation-item",3,"active","routerLink"],[1,"chat-panel"],[1,"conversation-item",3,"routerLink"],[1,"conversation-title"],[1,"conversation-meta"],[1,"run-chip"],[1,"message-list"],[1,"message"],[1,"message-input",3,"ngSubmit"],["type","text","name","draft","placeholder","Reply to the paused run or leave a note\u2026","aria-label","Message",3,"ngModelChange","ngModel","disabled"],["type","submit",3,"disabled"],[1,"chat-hint"],[1,"message-role"],[1,"message-content"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"aside",1)(2,"h2"),r(3,"Conversations"),a(),g(4,q,2,0,"p",2),v(5,Q,6,4,"a",3,M),a(),o(7,"section",4),g(8,X,2,0,"p",2)(9,ee,8,4),a()()),e&2&&(s(4),f(i.conversations().length===0?4:-1),s(),C(i.conversations()),s(3),f(i.selectedId()?9:8))},dependencies:[R,W,z,F,V,A,K,H,L],styles:[".conversations-layout[_ngcontent-%COMP%]{display:flex;gap:1rem;min-height:70vh}.conversations-sidebar[_ngcontent-%COMP%]{width:280px;border-right:1px solid var(--border-color, #333);padding-right:1rem}.conversation-item[_ngcontent-%COMP%]{display:block;padding:.5rem;border-radius:6px;text-decoration:none;color:inherit}.conversation-item.active[_ngcontent-%COMP%]{background:#8080ff1f}.conversation-title[_ngcontent-%COMP%]{display:block;font-weight:600}.run-chip[_ngcontent-%COMP%]{font-size:.75rem;opacity:.75;margin-right:.5rem}.chat-panel[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column}.message-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{max-width:70%;padding:.5rem .75rem;border-radius:8px;background:#8080801f}.message[data-role=user][_ngcontent-%COMP%]{align-self:flex-end;background:#5078ff2e}.message[data-kind=gate][_ngcontent-%COMP%]{border-left:3px solid orange}.message[data-kind=status][_ngcontent-%COMP%]{opacity:.8;font-style:italic}.message-role[_ngcontent-%COMP%]{font-size:.7rem;text-transform:uppercase;opacity:.6}.message-content[_ngcontent-%COMP%]{margin:.25rem 0 0;white-space:pre-wrap}.message-input[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:1rem}.message-input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1}.empty[_ngcontent-%COMP%]{opacity:.7;padding:1rem 0}.chat-hint[_ngcontent-%COMP%]{opacity:.7;font-size:.85rem}"]})};export{G as ConversationsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as K,d as Q,e as U}from"./chunk-FWLQWWZ3.js";import{a as X,b as Z,e as ee,g as te,h as ne,i as ie,j as oe,k as re}from"./chunk-K4VRVZWF.js";import{$ as k,Ba as w,Fa as f,Ib as q,Jb as G,Ka as y,La as F,Lb as H,Ma as L,Mb as J,Na as A,O as C,Oa as S,Pa as E,Qa as s,Ra as n,Sa as t,T as g,Ta as B,U as x,Ua as j,Va as $,Xa as b,Ya as _,Za as p,db as v,fb as i,gb as c,hb as u,ib as Y,jb as h,k as N,kb as M,lb as P,ob as I,pb as D,qa as o,qb as R,u as V,w as z}from"./chunk-W7ZKECPT.js";var me=(r,a)=>a.name;function ge(r,a){if(r&1&&(n(0,"option",9),i(1),t()),r&2){let e=a.$implicit;s("value",e.name)("disabled",!e.available),o(),Y(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function xe(r,a){if(r&1&&(n(0,"option",10),i(1),t()),r&2){let e=a.$implicit;s("value",e),o(),c(e)}}function _e(r,a){if(r&1){let e=b();n(0,"div",1),_("click",function(){g(e);let l=p();return x(l.close())}),n(1,"div",2),_("click",function(l){return l.stopPropagation()}),n(2,"h3",3),i(3),t(),n(4,"label",4),i(5,"Arguments"),t(),n(6,"input",5),P("ngModelChange",function(l){g(e);let m=p();return M(m.args,l)||(m.args=l),x(l)}),_("keydown.enter",function(){g(e);let l=p();return x(l.submit())}),t(),n(7,"div",6)(8,"div")(9,"label",4),i(10,"Provider"),t(),n(11,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.provider,l)||(m.provider=l),x(l)}),_("ngModelChange",function(){g(e);let l=p();return x(l.onProviderChange())}),n(12,"option",8),i(13,"(workflow default)"),t(),S(14,ge,2,4,"option",9,me),t()(),n(16,"div")(17,"label",4),i(18,"Model"),t(),n(19,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.model,l)||(m.model=l),x(l)}),n(20,"option",8),i(21,"(workflow default)"),t(),S(22,xe,2,2,"option",10,A),t()()(),n(24,"div",11)(25,"button",12),_("click",function(){g(e);let l=p();return x(l.close())}),i(26,"Cancel"),t(),n(27,"button",13),_("click",function(){g(e);let l=p();return x(l.submit())}),i(28,"Start \u25B6"),t()()()()}if(r&2){let e=p();o(3),u("Run ",e.workflowName),o(3),h("ngModel",e.args),o(5),h("ngModel",e.provider),o(3),E(e.providers),o(5),h("ngModel",e.model),o(3),E(e.modelOptions)}}var O=class r{visible=!1;workflowName="";providers=[];run=new k;closed=new k;args="";provider="";model="";get modelOptions(){return this.provider?this.providers.find(a=>a.name===this.provider)?.defaultModels??[]:[...new Set(this.providers.flatMap(a=>a.defaultModels))]}onProviderChange(){this.model&&!this.modelOptions.includes(this.model)&&(this.model="")}submit(){this.run.emit({args:this.args,provider:this.provider||void 0,model:this.model||void 0}),this.reset()}close(){this.visible=!1,this.reset(),this.closed.emit()}reset(){this.args="",this.provider="",this.model=""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-run-dialog"]],inputs:{visible:"visible",workflowName:"workflowName",providers:"providers"},outputs:{run:"run",closed:"closed"},decls:1,vars:1,consts:[[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50"],[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50",3,"click"],[1,"bg-slate-800","rounded-lg","p-6","w-full","max-w-md","border","border-slate-700",3,"click"],[1,"text-lg","font-semibold","text-slate-100","mb-4"],[1,"block","text-sm","text-slate-400","mb-1"],["placeholder",'e.g. "fix #42"',1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500","mb-4",3,"ngModelChange","keydown.enter","ngModel"],[1,"grid","grid-cols-2","gap-3","mb-4"],[1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500",3,"ngModelChange","ngModel"],["value",""],[3,"value","disabled"],[3,"value"],[1,"flex","justify-end","gap-3"],[1,"px-4","py-2","text-sm","text-slate-400","hover:text-slate-200",3,"click"],[1,"px-4","py-2","text-sm","bg-blue-600","text-white","rounded","hover:bg-blue-500",3,"click"]],template:function(e,d){e&1&&F(0,_e,29,4,"div",0),e&2&&L(d.visible?0:-1)},dependencies:[oe,ne,ie,X,te,Z,ee],encapsulation:2})};function ae(r,a,e={}){let d=r.provider||a.provider||e.provider||"default",l=r.model||a.model||e.model||"";return{name:l?`${d}/${l}`:d,inherited:!r.provider&&!r.model}}var fe=r=>({edit:r}),ue=r=>["/runs",r];function be(r,a){if(r&1&&(n(0,"div",4),i(1),t()),r&2){let e=p();o(),c(e.error)}}function ve(r,a){r&1&&(n(0,"div",5),i(1,"Loading workflow definition..."),t())}function Ce(r,a){if(r&1&&(n(0,"span"),i(1),t()),r&2){let e=p(3);o(),c(e.runs.length)}}function we(r,a){if(r&1){let e=b();n(0,"button",24),_("click",function(){let l=g(e).$implicit,m=p(2);return x(m.tab=l.id)}),i(1),f(2,Ce,2,1,"span",3),t()}if(r&2){let e=a.$implicit,d=p(2);v("active",d.tab===e.id),o(),u(" ",e.label," "),o(),s("ngIf",e.id==="runs")}}function ye(r,a){if(r&1){let e=b();n(0,"button",30),_("click",function(){let l=g(e).$implicit,m=p(3);return x(m.selectedNode=l)}),n(1,"span",31),i(2),t(),n(3,"span",32),i(4),t(),n(5,"span",33)(6,"strong"),i(7),n(8,"span",34),i(9),t()(),n(10,"small"),i(11),t()(),n(12,"span",35),i(13),t()()}if(r&2){let e=a.$implicit,d=a.index,l=p(3);v("selected",(l.selectedNode==null?null:l.selectedNode.id)===e.id),o(2),c(d+1),o(),y("data-type",e.type),o(),c(l.typeLabel(e.type)),o(3),u("",e.id," "),o(),v("inherited",l.nodeProvider(e).inherited),o(),c(l.providerBadgeLabel(e)),o(2),c(e.content),o(2),c(e.dependsOn.length?"After "+e.dependsOn.join(", "):"Entry point")}}function he(r,a){if(r&1&&(n(0,"aside",36)(1,"div",37),i(2,"Node inspector"),t(),n(3,"h3"),i(4),t(),n(5,"span",38),i(6),t(),n(7,"dl")(8,"div")(9,"dt"),i(10,"Depends on"),t(),n(11,"dd"),i(12),t()(),n(13,"div")(14,"dt"),i(15,"Trigger"),t(),n(16,"dd"),i(17),t()(),n(18,"div")(19,"dt"),i(20,"Context"),t(),n(21,"dd"),i(22),t()(),n(23,"div")(24,"dt"),i(25,"Condition"),t(),n(26,"dd"),i(27),t()(),n(28,"div")(29,"dt"),i(30,"Provider"),t(),n(31,"dd"),i(32),t()(),n(33,"div")(34,"dt"),i(35,"Model"),t(),n(36,"dd"),i(37),t()()(),n(38,"label"),i(39,"Content"),t(),n(40,"pre"),i(41),t()()),r&2){let e=p(3);o(4),c(e.selectedNode.id),o(2),c(e.selectedNode.type),o(6),c(e.selectedNode.dependsOn.join(", ")||"None"),o(5),c(e.selectedNode.triggerRule),o(5),c(e.selectedNode.context),o(5),c(e.selectedNode.when||"Always"),o(5),c(e.selectedNode.provider||e.workflow.defaultProvider||"Default"),o(5),c(e.selectedNode.model||e.workflow.defaultModel||"Default"),o(4),c(e.selectedNode.content)}}function Me(r,a){if(r&1&&(n(0,"div",25)(1,"main",26)(2,"div",27)(3,"div")(4,"h2"),i(5,"Workflow steps"),t(),n(6,"p"),i(7,"Execution order and node configuration."),t()()(),f(8,ye,14,11,"button",28),t(),f(9,he,42,9,"aside",29),t()),r&2){let e=p(2);o(8),s("ngForOf",e.workflow.nodes),o(),s("ngIf",e.selectedNode)}}function Pe(r,a){if(r&1&&(n(0,"article")(1,"div")(2,"span",32),i(3),t(),n(4,"strong"),i(5),t()(),n(6,"span",34),i(7),t()()),r&2){let e=a.$implicit,d=p(4);o(2),y("data-type",e.type),o(),c(d.typeLabel(e.type)),o(2),c(e.id),o(),v("inherited",d.nodeProvider(e).inherited),o(),c(d.providerBadgeLabel(e))}}function Oe(r,a){if(r&1&&(n(0,"div",44)(1,"span",45),i(2),t(),f(3,Pe,8,6,"article",46),t()),r&2){let e=a.$implicit,d=a.index;o(2),u("Stage ",d+1),o(),s("ngForOf",e)}}function ke(r,a){if(r&1&&(n(0,"div",39)(1,"div",40)(2,"div")(3,"h2"),i(4,"DAG topology"),t(),n(5,"p"),i(6,"Dependencies flow from left to right."),t()(),n(7,"span"),i(8),t()(),n(9,"div",41)(10,"div",42),f(11,Oe,4,2,"div",43),t()()()),r&2){let e=p(2);o(8),u("",e.dagLayers.length," stages"),o(3),s("ngForOf",e.dagLayers)}}function Se(r,a){if(r&1){let e=b();n(0,"div",47)(1,"div",48)(2,"span"),i(3,"Read-only YAML definition"),t(),n(4,"button",24),_("click",function(){g(e);let l=p(2);return x(l.copyYaml())}),i(5),t()(),n(6,"pre"),i(7),t()()}if(r&2){let e=p(2);o(5),c(e.copied?"Copied":"Copy"),o(2),c(e.workflow.yaml)}}function Ee(r,a){r&1&&(n(0,"span",53),i(1,"history"),t())}function Ie(r,a){if(r&1&&(n(0,"a",54),i(1,"Open"),t()),r&2){let e=p().$implicit;s("routerLink",I(1,ue,e.runId))}}function De(r,a){if(r&1&&(n(0,"tr")(1,"td")(2,"code"),i(3),t()(),n(4,"td")(5,"span",50),i(6),t(),f(7,Ee,2,0,"span",51),t(),n(8,"td"),i(9),D(10,"date"),t(),n(11,"td"),i(12),D(13,"date"),t(),n(14,"td"),f(15,Ie,2,3,"a",52),t()()),r&2){let e=a.$implicit;o(3),c(e.runId),o(2),y("data-status",e.status),o(),c(e.status),o(),s("ngIf",e.source==="history"),o(2),c(R(10,7,e.startedAt,"medium")),o(3),c(e.completedAt?R(13,10,e.completedAt,"medium"):"In progress"),o(3),s("ngIf",e.source!=="history")}}function Re(r,a){r&1&&(n(0,"tr")(1,"td",55),i(2,"This workflow has not been run yet."),t()())}function We(r,a){if(r&1&&(n(0,"div",49)(1,"table")(2,"thead")(3,"tr")(4,"th"),i(5,"Run ID"),t(),n(6,"th"),i(7,"Status"),t(),n(8,"th"),i(9,"Started"),t(),n(10,"th"),i(11,"Completed"),t(),B(12,"th"),t()(),n(13,"tbody"),f(14,De,16,13,"tr",46)(15,Re,3,0,"tr",3),t()()()),r&2){let e=p(2);o(14),s("ngForOf",e.runs),o(),s("ngIf",!e.runs.length)}}function Te(r,a){if(r&1){let e=b();j(0),n(1,"nav",6)(2,"a",7),i(3,"Workflows"),t(),n(4,"span"),i(5,"/"),t(),n(6,"span"),i(7),t()(),n(8,"header",8)(9,"div",9),i(10,"Y"),t(),n(11,"div",10)(12,"span",11),i(13),t(),n(14,"h1"),i(15),t(),n(16,"p"),i(17),t()(),n(18,"div",12)(19,"a",13),i(20,"Edit"),t(),n(21,"button",14),_("click",function(){g(e);let l=p();return x(l.showRunDialog=!0)}),i(22,"Run workflow"),t()()(),n(23,"div",15)(24,"div")(25,"span"),i(26,"Nodes"),t(),n(27,"strong"),i(28),t()(),n(29,"div")(30,"span"),i(31,"Dependencies"),t(),n(32,"strong"),i(33),t()(),n(34,"div")(35,"span"),i(36,"Provider"),t(),n(37,"strong"),i(38),t()(),n(39,"div")(40,"span"),i(41,"Model"),t(),n(42,"strong"),i(43),t()(),n(44,"div")(45,"span"),i(46,"Runs"),t(),n(47,"strong"),i(48),t()()(),n(49,"div",16)(50,"span"),i(51,"Definition"),t(),n(52,"code"),i(53),t()(),n(54,"nav",17),f(55,we,3,4,"button",18),t(),f(56,Me,10,2,"div",19)(57,ke,12,2,"div",20)(58,Se,8,2,"div",21)(59,We,16,2,"div",22),n(60,"app-run-dialog",23),_("run",function(l){g(e);let m=p();return x(m.onStartRun(l))})("closed",function(){g(e);let l=p();return x(l.showRunDialog=!1)}),t(),$()}if(r&2){let e=p();o(7),c(e.workflow.id),o(6),c(e.workflow.id),o(2),c(e.workflow.name),o(2),c(e.workflow.description||"No description provided."),o(2),s("queryParams",I(19,fe,e.workflow.id)),o(9),c(e.workflow.nodeCount),o(5),c(e.dependencyCount),o(5),c(e.workflow.defaultProvider||"default"),o(5),c(e.workflow.defaultModel||"default"),o(5),c(e.runs.length),o(5),u(".vsaf/workflows/",e.workflow.file),o(2),s("ngForOf",e.tabs),o(),s("ngIf",e.tab==="overview"),o(),s("ngIf",e.tab==="dag"),o(),s("ngIf",e.tab==="yaml"),o(),s("ngIf",e.tab==="runs"),o(),s("visible",e.showRunDialog)("workflowName",e.workflow.id)("providers",e.providers)}}var le=class r{route=C(K);api=C(re);router=C(Q);workflow;runs=[];providers=[];selectedNode;tab="overview";showRunDialog=!1;loading=!0;error="";copied=!1;tabs=[{id:"overview",label:"Overview"},{id:"dag",label:"DAG"},{id:"yaml",label:"YAML"},{id:"runs",label:"Runs"}];ngOnInit(){let a=this.route.snapshot.queryParamMap.get("id");if(!a){this.loading=!1,this.error="Missing workflow id.";return}V({workflow:this.api.getWorkflow(a),runs:this.api.getRuns(),providers:this.api.getProviders().pipe(z(()=>N({providers:[]})))}).subscribe({next:e=>{this.workflow=e.workflow,this.selectedNode=e.workflow.nodes[0],this.runs=e.runs.filter(d=>d.workflow===a).reverse(),this.providers=e.providers.providers??[],this.loading=!1},error:e=>{this.loading=!1,this.error=e?.error?.error??"Failed to load workflow."}})}nodeProvider(a){return ae(a,{provider:this.workflow?.defaultProvider,model:this.workflow?.defaultModel})}providerBadgeLabel(a){let e=this.nodeProvider(a);return e.inherited?`\u2192 ${e.name}`:e.name}get dependencyCount(){return this.workflow?.nodes.reduce((a,e)=>a+e.dependsOn.length,0)??0}get dagLayers(){if(!this.workflow)return[];let a=new Map,e=(l,m=new Set)=>{if(a.has(l.id))return a.get(l.id);if(m.has(l.id)||!l.dependsOn.length)return 0;m.add(l.id);let W=1+Math.max(...l.dependsOn.map(de=>{let T=this.workflow.nodes.find(ce=>ce.id===de);return T?e(T,m):0}));return m.delete(l.id),a.set(l.id,W),W};for(let l of this.workflow.nodes)a.set(l.id,e(l));let d=[];for(let l of this.workflow.nodes)(d[a.get(l.id)??0]??=[]).push(l);return d}typeLabel(a){return a==="command"?"CMD":a==="prompt"?"AI":"SH"}onStartRun(a){this.showRunDialog=!1,this.api.startRun(this.workflow.id,a.args,{provider:a.provider,model:a.model}).subscribe(e=>this.router.navigate(["/runs",e.runId]))}copyYaml(){this.workflow&&navigator.clipboard.writeText(this.workflow.yaml).then(()=>{this.copied=!0,setTimeout(()=>this.copied=!1,1500)})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-workflow-detail"]],decls:4,vars:3,consts:[[1,"detail-page"],["class","state error",4,"ngIf"],["class","state",4,"ngIf"],[4,"ngIf"],[1,"state","error"],[1,"state"],[1,"breadcrumb"],["routerLink","/workflows"],[1,"hero"],[1,"workflow-icon"],[1,"hero-copy"],[1,"namespace"],[1,"hero-actions"],["routerLink","/workflows/builder",1,"button","secondary",3,"queryParams"],["type","button",1,"button","primary",3,"click"],[1,"stats"],[1,"file-strip"],["aria-label","Workflow detail sections",1,"tabs"],["type","button",3,"active","click",4,"ngFor","ngForOf"],["class","tab-content",4,"ngIf"],["class","dag-panel",4,"ngIf"],["class","yaml-panel",4,"ngIf"],["class","runs-panel",4,"ngIf"],[3,"run","closed","visible","workflowName","providers"],["type","button",3,"click"],[1,"tab-content"],[1,"node-list"],[1,"section-heading"],["type","button","class","node-row",3,"selected","click",4,"ngFor","ngForOf"],["class","inspector",4,"ngIf"],["type","button",1,"node-row",3,"click"],[1,"step-index"],[1,"type-icon"],[1,"node-main"],[1,"provider-badge"],[1,"dependency"],[1,"inspector"],[1,"inspector-title"],[1,"badge"],[1,"dag-panel"],[1,"dag-toolbar"],[1,"dag-scroll"],[1,"dag-canvas"],["class","dag-layer",4,"ngFor","ngForOf"],[1,"dag-layer"],[1,"layer-label"],[4,"ngFor","ngForOf"],[1,"yaml-panel"],[1,"yaml-toolbar"],[1,"runs-panel"],[1,"status"],["class","history-tag",4,"ngIf"],[3,"routerLink",4,"ngIf"],[1,"history-tag"],[3,"routerLink"],["colspan","5",1,"empty"]],template:function(e,d){e&1&&(n(0,"section",0),f(1,be,2,1,"div",1)(2,ve,2,0,"div",2)(3,Te,61,21,"ng-container",3),t()),e&2&&(o(),s("ngIf",d.error),o(),s("ngIf",d.loading),o(),s("ngIf",d.workflow))},dependencies:[J,q,G,U,O,H],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}.detail-page[_ngcontent-%COMP%]{max-width:1320px;margin:auto;padding:24px 28px 60px}.breadcrumb[_ngcontent-%COMP%]{display:flex;gap:7px;color:#737a87;font-size:12px;margin-bottom:18px}.breadcrumb[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#9ca3af;text-decoration:none}.hero[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:15px}.workflow-icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:0 0 46px;height:52px;border:1px solid #454957;border-radius:6px;color:#a5b4fc;font-weight:900}.hero-copy[_ngcontent-%COMP%]{min-width:0}.namespace[_ngcontent-%COMP%]{font:11px ui-monospace,monospace;color:#818cf8}.hero[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:26px;margin:4px 0}.hero[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#9ba1ad;margin:5px 0;line-height:1.5;max-width:800px}.hero-actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-left:auto}.button[_ngcontent-%COMP%]{padding:9px 13px;border-radius:5px;text-decoration:none;font:inherit;font-size:12px;font-weight:700;cursor:pointer}.button.secondary[_ngcontent-%COMP%]{border:1px solid #3b3e48;background:#1c1e24;color:#e5e7eb}.button.primary[_ngcontent-%COMP%]{border:1px solid #6366f1;background:#6366f1;color:#fff}.stats[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,1fr);border:1px solid #2d3038;border-radius:7px;margin-top:24px;background:#16171c}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:13px 16px;border-right:1px solid #2d3038}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border:0}.stats[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .file-strip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:#777e8b;font-size:10px;text-transform:uppercase;font-weight:700}.stats[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;font-size:14px}.file-strip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px;padding:10px 14px;border:1px solid #2d3038;border-top:0;background:#131419}.file-strip[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{color:#aab0bb;font-size:11px}.tabs[_ngcontent-%COMP%]{display:flex;border-bottom:1px solid #2d3038;margin-top:24px}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#858c98;padding:10px 14px;font-weight:700;cursor:pointer}.tabs[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{color:#fff;box-shadow:inset 0 -2px #6366f1}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background:#292c34;padding:1px 5px;border-radius:8px;font-size:10px}.tab-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;margin-top:18px}.section-heading[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:15px;margin:0}.section-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:12px;color:#7f8692;margin:4px 0 12px}.node-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:28px 38px minmax(180px,1fr) minmax(120px,.5fr);align-items:center;gap:11px;width:100%;border:1px solid #292c34;border-bottom:0;background:#16171c;color:#e5e7eb;padding:11px;text-align:left;cursor:pointer}.node-row[_ngcontent-%COMP%]:first-of-type{border-radius:6px 6px 0 0}.node-row[_ngcontent-%COMP%]:last-child{border-bottom:1px solid #292c34;border-radius:0 0 6px 6px}.node-row[_ngcontent-%COMP%]:hover, .node-row.selected[_ngcontent-%COMP%]{background:#1e2027;border-color:#494d5a}.step-index[_ngcontent-%COMP%]{color:#676e7a;font-size:11px;text-align:center}.type-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:28px;border-radius:4px;background:#242630;color:#c4b5fd;font-size:9px;font-weight:900;text-transform:uppercase}.type-icon[data-type=bash][_ngcontent-%COMP%]{color:#fbbf24}.type-icon[data-type=command][_ngcontent-%COMP%]{color:#67e8f9}.node-main[_ngcontent-%COMP%]{min-width:0}.node-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#777e8b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}.dependency[_ngcontent-%COMP%]{color:#858c98;font-size:11px;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%]{border:1px solid #2d3038;background:#16171c;border-radius:6px;padding:15px}.inspector-title[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px;font-weight:800}.inspector[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:8px 0;font-size:16px}.badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid #4b4f5c;padding:2px 6px;border-radius:4px;font-size:10px;color:#a5b4fc}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{margin:14px 0}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid #282a31;font-size:11px}.inspector[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:#777e8b}.inspector[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;text-align:right;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:10px;color:#777e8b;text-transform:uppercase}.inspector[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{white-space:pre-wrap;overflow-wrap:anywhere;background:#0d0e11;padding:10px;border-radius:5px;font-size:11px;max-height:240px;overflow:auto}.dag-panel[_ngcontent-%COMP%], .yaml-panel[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%]{margin-top:18px;border:1px solid #2d3038;border-radius:7px;overflow:hidden}.dag-toolbar[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #2d3038;background:#16171c}.dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.dag-toolbar[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{font-size:11px;color:#858c98}.dag-scroll[_ngcontent-%COMP%]{overflow-x:auto;background-color:var(--background)}.dag-canvas[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:20px;width:max-content;min-width:100%;box-sizing:border-box;padding:14px 16px;background-image:radial-gradient(#30333b 1px,transparent 1px);background-size:16px 16px}.dag-layer[_ngcontent-%COMP%]{display:flex;flex:0 0 auto;min-width:200px;flex-direction:column;gap:8px}.layer-label[_ngcontent-%COMP%]{font-size:10px;color:var(--text-tertiary);text-transform:uppercase}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%]{border:1px solid var(--border-bright);background:var(--surface);border-radius:6px;padding:8px 10px}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:12px;overflow-wrap:anywhere}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] .provider-badge[_ngcontent-%COMP%]{margin:7px 0 0}.yaml-toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #3a3d47;background:#22242b;color:#ddd;border-radius:4px;padding:5px 9px}.yaml-panel[_ngcontent-%COMP%] > pre[_ngcontent-%COMP%]{margin:0;padding:18px;min-height:420px;max-height:65vh;overflow:auto;background:#0d0e11;color:#cdd6f4;font:12px/1.6 ui-monospace,monospace;white-space:pre-wrap}.runs-panel[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;background:#16171c;font-size:12px}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px;text-align:left;border-bottom:1px solid #292c34}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px}.runs-panel[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#a5b4fc}.status[_ngcontent-%COMP%]{font-size:10px;text-transform:uppercase}.status[data-status=completed][_ngcontent-%COMP%]{color:#34d399}.status[data-status=failed][_ngcontent-%COMP%], .status[data-status=cancelled][_ngcontent-%COMP%]{color:#f87171}.status[data-status=running][_ngcontent-%COMP%]{color:#60a5fa}.provider-badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid var(--border-bright);border-radius:4px;background:var(--surface-elevated);color:#c4b5fd;font:10px ui-monospace,monospace;padding:1px 6px;margin-left:8px;vertical-align:1px}.provider-badge.inherited[_ngcontent-%COMP%]{color:var(--text-tertiary);border-style:dashed;background:transparent}.history-tag[_ngcontent-%COMP%]{border:1px dashed var(--border-bright);color:var(--text-tertiary);padding:1px 5px;border-radius:4px;font-size:9px;text-transform:uppercase;margin-left:6px}.empty[_ngcontent-%COMP%], .state[_ngcontent-%COMP%]{padding:24px;text-align:center;color:#858c98}.state.error[_ngcontent-%COMP%]{color:#fca5a5}@media(max-width:900px){.detail-page[_ngcontent-%COMP%]{padding:18px 14px}.hero[_ngcontent-%COMP%]{flex-wrap:wrap}.hero-actions[_ngcontent-%COMP%]{width:100%;margin-left:61px}.stats[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-bottom:1px solid #2d3038}.tab-content[_ngcontent-%COMP%]{grid-template-columns:1fr}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 38px 1fr}.dependency[_ngcontent-%COMP%]{grid-column:3}.inspector[_ngcontent-%COMP%]{position:static}}@media(max-width:600px){.stats[_ngcontent-%COMP%]{grid-template-columns:1fr}.hero-actions[_ngcontent-%COMP%]{margin-left:0}.tabs[_ngcontent-%COMP%]{overflow:auto}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 1fr}.type-icon[_ngcontent-%COMP%]{display:none}.node-main[_ngcontent-%COMP%], .dependency[_ngcontent-%COMP%]{grid-column:2}.dag-canvas[_ngcontent-%COMP%]{padding:18px}}"]})};export{le as WorkflowDetailComponent};
|
|
1
|
+
import{b as K,d as Q,e as U}from"./chunk-UN7U5NAR.js";import{a as X,b as Z,e as ee,g as te,h as ne,i as ie,j as oe,k as re}from"./chunk-LPQARKUF.js";import{$ as k,Ba as w,Fa as f,Jb as q,Ka as y,Kb as G,La as F,Ma as L,Mb as H,Na as A,O as C,Oa as S,Ob as J,Pa as E,Qa as s,Ra as n,Sa as t,T as g,Ta as B,U as x,Ua as j,Va as $,Xa as b,Ya as _,Za as p,eb as v,gb as i,hb as c,ib as u,jb as Y,k as N,kb as h,lb as M,mb as P,pb as I,qa as o,qb as D,rb as R,u as V,w as z}from"./chunk-WDOCF7IL.js";var me=(r,a)=>a.name;function ge(r,a){if(r&1&&(n(0,"option",9),i(1),t()),r&2){let e=a.$implicit;s("value",e.name)("disabled",!e.available),o(),Y(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function xe(r,a){if(r&1&&(n(0,"option",10),i(1),t()),r&2){let e=a.$implicit;s("value",e),o(),c(e)}}function _e(r,a){if(r&1){let e=b();n(0,"div",1),_("click",function(){g(e);let l=p();return x(l.close())}),n(1,"div",2),_("click",function(l){return l.stopPropagation()}),n(2,"h3",3),i(3),t(),n(4,"label",4),i(5,"Arguments"),t(),n(6,"input",5),P("ngModelChange",function(l){g(e);let m=p();return M(m.args,l)||(m.args=l),x(l)}),_("keydown.enter",function(){g(e);let l=p();return x(l.submit())}),t(),n(7,"div",6)(8,"div")(9,"label",4),i(10,"Provider"),t(),n(11,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.provider,l)||(m.provider=l),x(l)}),_("ngModelChange",function(){g(e);let l=p();return x(l.onProviderChange())}),n(12,"option",8),i(13,"(workflow default)"),t(),S(14,ge,2,4,"option",9,me),t()(),n(16,"div")(17,"label",4),i(18,"Model"),t(),n(19,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.model,l)||(m.model=l),x(l)}),n(20,"option",8),i(21,"(workflow default)"),t(),S(22,xe,2,2,"option",10,A),t()()(),n(24,"div",11)(25,"button",12),_("click",function(){g(e);let l=p();return x(l.close())}),i(26,"Cancel"),t(),n(27,"button",13),_("click",function(){g(e);let l=p();return x(l.submit())}),i(28,"Start \u25B6"),t()()()()}if(r&2){let e=p();o(3),u("Run ",e.workflowName),o(3),h("ngModel",e.args),o(5),h("ngModel",e.provider),o(3),E(e.providers),o(5),h("ngModel",e.model),o(3),E(e.modelOptions)}}var O=class r{visible=!1;workflowName="";providers=[];run=new k;closed=new k;args="";provider="";model="";get modelOptions(){return this.provider?this.providers.find(a=>a.name===this.provider)?.defaultModels??[]:[...new Set(this.providers.flatMap(a=>a.defaultModels))]}onProviderChange(){this.model&&!this.modelOptions.includes(this.model)&&(this.model="")}submit(){this.run.emit({args:this.args,provider:this.provider||void 0,model:this.model||void 0}),this.reset()}close(){this.visible=!1,this.reset(),this.closed.emit()}reset(){this.args="",this.provider="",this.model=""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-run-dialog"]],inputs:{visible:"visible",workflowName:"workflowName",providers:"providers"},outputs:{run:"run",closed:"closed"},decls:1,vars:1,consts:[[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50"],[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50",3,"click"],[1,"bg-slate-800","rounded-lg","p-6","w-full","max-w-md","border","border-slate-700",3,"click"],[1,"text-lg","font-semibold","text-slate-100","mb-4"],[1,"block","text-sm","text-slate-400","mb-1"],["placeholder",'e.g. "fix #42"',1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500","mb-4",3,"ngModelChange","keydown.enter","ngModel"],[1,"grid","grid-cols-2","gap-3","mb-4"],[1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500",3,"ngModelChange","ngModel"],["value",""],[3,"value","disabled"],[3,"value"],[1,"flex","justify-end","gap-3"],[1,"px-4","py-2","text-sm","text-slate-400","hover:text-slate-200",3,"click"],[1,"px-4","py-2","text-sm","bg-blue-600","text-white","rounded","hover:bg-blue-500",3,"click"]],template:function(e,d){e&1&&F(0,_e,29,4,"div",0),e&2&&L(d.visible?0:-1)},dependencies:[oe,ne,ie,X,te,Z,ee],encapsulation:2})};function ae(r,a,e={}){let d=r.provider||a.provider||e.provider||"default",l=r.model||a.model||e.model||"";return{name:l?`${d}/${l}`:d,inherited:!r.provider&&!r.model}}var fe=r=>({edit:r}),ue=r=>["/runs",r];function be(r,a){if(r&1&&(n(0,"div",4),i(1),t()),r&2){let e=p();o(),c(e.error)}}function ve(r,a){r&1&&(n(0,"div",5),i(1,"Loading workflow definition..."),t())}function Ce(r,a){if(r&1&&(n(0,"span"),i(1),t()),r&2){let e=p(3);o(),c(e.runs.length)}}function we(r,a){if(r&1){let e=b();n(0,"button",24),_("click",function(){let l=g(e).$implicit,m=p(2);return x(m.tab=l.id)}),i(1),f(2,Ce,2,1,"span",3),t()}if(r&2){let e=a.$implicit,d=p(2);v("active",d.tab===e.id),o(),u(" ",e.label," "),o(),s("ngIf",e.id==="runs")}}function ye(r,a){if(r&1){let e=b();n(0,"button",30),_("click",function(){let l=g(e).$implicit,m=p(3);return x(m.selectedNode=l)}),n(1,"span",31),i(2),t(),n(3,"span",32),i(4),t(),n(5,"span",33)(6,"strong"),i(7),n(8,"span",34),i(9),t()(),n(10,"small"),i(11),t()(),n(12,"span",35),i(13),t()()}if(r&2){let e=a.$implicit,d=a.index,l=p(3);v("selected",(l.selectedNode==null?null:l.selectedNode.id)===e.id),o(2),c(d+1),o(),y("data-type",e.type),o(),c(l.typeLabel(e.type)),o(3),u("",e.id," "),o(),v("inherited",l.nodeProvider(e).inherited),o(),c(l.providerBadgeLabel(e)),o(2),c(e.content),o(2),c(e.dependsOn.length?"After "+e.dependsOn.join(", "):"Entry point")}}function he(r,a){if(r&1&&(n(0,"aside",36)(1,"div",37),i(2,"Node inspector"),t(),n(3,"h3"),i(4),t(),n(5,"span",38),i(6),t(),n(7,"dl")(8,"div")(9,"dt"),i(10,"Depends on"),t(),n(11,"dd"),i(12),t()(),n(13,"div")(14,"dt"),i(15,"Trigger"),t(),n(16,"dd"),i(17),t()(),n(18,"div")(19,"dt"),i(20,"Context"),t(),n(21,"dd"),i(22),t()(),n(23,"div")(24,"dt"),i(25,"Condition"),t(),n(26,"dd"),i(27),t()(),n(28,"div")(29,"dt"),i(30,"Provider"),t(),n(31,"dd"),i(32),t()(),n(33,"div")(34,"dt"),i(35,"Model"),t(),n(36,"dd"),i(37),t()()(),n(38,"label"),i(39,"Content"),t(),n(40,"pre"),i(41),t()()),r&2){let e=p(3);o(4),c(e.selectedNode.id),o(2),c(e.selectedNode.type),o(6),c(e.selectedNode.dependsOn.join(", ")||"None"),o(5),c(e.selectedNode.triggerRule),o(5),c(e.selectedNode.context),o(5),c(e.selectedNode.when||"Always"),o(5),c(e.selectedNode.provider||e.workflow.defaultProvider||"Default"),o(5),c(e.selectedNode.model||e.workflow.defaultModel||"Default"),o(4),c(e.selectedNode.content)}}function Me(r,a){if(r&1&&(n(0,"div",25)(1,"main",26)(2,"div",27)(3,"div")(4,"h2"),i(5,"Workflow steps"),t(),n(6,"p"),i(7,"Execution order and node configuration."),t()()(),f(8,ye,14,11,"button",28),t(),f(9,he,42,9,"aside",29),t()),r&2){let e=p(2);o(8),s("ngForOf",e.workflow.nodes),o(),s("ngIf",e.selectedNode)}}function Pe(r,a){if(r&1&&(n(0,"article")(1,"div")(2,"span",32),i(3),t(),n(4,"strong"),i(5),t()(),n(6,"span",34),i(7),t()()),r&2){let e=a.$implicit,d=p(4);o(2),y("data-type",e.type),o(),c(d.typeLabel(e.type)),o(2),c(e.id),o(),v("inherited",d.nodeProvider(e).inherited),o(),c(d.providerBadgeLabel(e))}}function Oe(r,a){if(r&1&&(n(0,"div",44)(1,"span",45),i(2),t(),f(3,Pe,8,6,"article",46),t()),r&2){let e=a.$implicit,d=a.index;o(2),u("Stage ",d+1),o(),s("ngForOf",e)}}function ke(r,a){if(r&1&&(n(0,"div",39)(1,"div",40)(2,"div")(3,"h2"),i(4,"DAG topology"),t(),n(5,"p"),i(6,"Dependencies flow from left to right."),t()(),n(7,"span"),i(8),t()(),n(9,"div",41)(10,"div",42),f(11,Oe,4,2,"div",43),t()()()),r&2){let e=p(2);o(8),u("",e.dagLayers.length," stages"),o(3),s("ngForOf",e.dagLayers)}}function Se(r,a){if(r&1){let e=b();n(0,"div",47)(1,"div",48)(2,"span"),i(3,"Read-only YAML definition"),t(),n(4,"button",24),_("click",function(){g(e);let l=p(2);return x(l.copyYaml())}),i(5),t()(),n(6,"pre"),i(7),t()()}if(r&2){let e=p(2);o(5),c(e.copied?"Copied":"Copy"),o(2),c(e.workflow.yaml)}}function Ee(r,a){r&1&&(n(0,"span",53),i(1,"history"),t())}function Ie(r,a){if(r&1&&(n(0,"a",54),i(1,"Open"),t()),r&2){let e=p().$implicit;s("routerLink",I(1,ue,e.runId))}}function De(r,a){if(r&1&&(n(0,"tr")(1,"td")(2,"code"),i(3),t()(),n(4,"td")(5,"span",50),i(6),t(),f(7,Ee,2,0,"span",51),t(),n(8,"td"),i(9),D(10,"date"),t(),n(11,"td"),i(12),D(13,"date"),t(),n(14,"td"),f(15,Ie,2,3,"a",52),t()()),r&2){let e=a.$implicit;o(3),c(e.runId),o(2),y("data-status",e.status),o(),c(e.status),o(),s("ngIf",e.source==="history"),o(2),c(R(10,7,e.startedAt,"medium")),o(3),c(e.completedAt?R(13,10,e.completedAt,"medium"):"In progress"),o(3),s("ngIf",e.source!=="history")}}function Re(r,a){r&1&&(n(0,"tr")(1,"td",55),i(2,"This workflow has not been run yet."),t()())}function We(r,a){if(r&1&&(n(0,"div",49)(1,"table")(2,"thead")(3,"tr")(4,"th"),i(5,"Run ID"),t(),n(6,"th"),i(7,"Status"),t(),n(8,"th"),i(9,"Started"),t(),n(10,"th"),i(11,"Completed"),t(),B(12,"th"),t()(),n(13,"tbody"),f(14,De,16,13,"tr",46)(15,Re,3,0,"tr",3),t()()()),r&2){let e=p(2);o(14),s("ngForOf",e.runs),o(),s("ngIf",!e.runs.length)}}function Te(r,a){if(r&1){let e=b();j(0),n(1,"nav",6)(2,"a",7),i(3,"Workflows"),t(),n(4,"span"),i(5,"/"),t(),n(6,"span"),i(7),t()(),n(8,"header",8)(9,"div",9),i(10,"Y"),t(),n(11,"div",10)(12,"span",11),i(13),t(),n(14,"h1"),i(15),t(),n(16,"p"),i(17),t()(),n(18,"div",12)(19,"a",13),i(20,"Edit"),t(),n(21,"button",14),_("click",function(){g(e);let l=p();return x(l.showRunDialog=!0)}),i(22,"Run workflow"),t()()(),n(23,"div",15)(24,"div")(25,"span"),i(26,"Nodes"),t(),n(27,"strong"),i(28),t()(),n(29,"div")(30,"span"),i(31,"Dependencies"),t(),n(32,"strong"),i(33),t()(),n(34,"div")(35,"span"),i(36,"Provider"),t(),n(37,"strong"),i(38),t()(),n(39,"div")(40,"span"),i(41,"Model"),t(),n(42,"strong"),i(43),t()(),n(44,"div")(45,"span"),i(46,"Runs"),t(),n(47,"strong"),i(48),t()()(),n(49,"div",16)(50,"span"),i(51,"Definition"),t(),n(52,"code"),i(53),t()(),n(54,"nav",17),f(55,we,3,4,"button",18),t(),f(56,Me,10,2,"div",19)(57,ke,12,2,"div",20)(58,Se,8,2,"div",21)(59,We,16,2,"div",22),n(60,"app-run-dialog",23),_("run",function(l){g(e);let m=p();return x(m.onStartRun(l))})("closed",function(){g(e);let l=p();return x(l.showRunDialog=!1)}),t(),$()}if(r&2){let e=p();o(7),c(e.workflow.id),o(6),c(e.workflow.id),o(2),c(e.workflow.name),o(2),c(e.workflow.description||"No description provided."),o(2),s("queryParams",I(19,fe,e.workflow.id)),o(9),c(e.workflow.nodeCount),o(5),c(e.dependencyCount),o(5),c(e.workflow.defaultProvider||"default"),o(5),c(e.workflow.defaultModel||"default"),o(5),c(e.runs.length),o(5),u(".vsaf/workflows/",e.workflow.file),o(2),s("ngForOf",e.tabs),o(),s("ngIf",e.tab==="overview"),o(),s("ngIf",e.tab==="dag"),o(),s("ngIf",e.tab==="yaml"),o(),s("ngIf",e.tab==="runs"),o(),s("visible",e.showRunDialog)("workflowName",e.workflow.id)("providers",e.providers)}}var le=class r{route=C(K);api=C(re);router=C(Q);workflow;runs=[];providers=[];selectedNode;tab="overview";showRunDialog=!1;loading=!0;error="";copied=!1;tabs=[{id:"overview",label:"Overview"},{id:"dag",label:"DAG"},{id:"yaml",label:"YAML"},{id:"runs",label:"Runs"}];ngOnInit(){let a=this.route.snapshot.queryParamMap.get("id");if(!a){this.loading=!1,this.error="Missing workflow id.";return}V({workflow:this.api.getWorkflow(a),runs:this.api.getRuns(),providers:this.api.getProviders().pipe(z(()=>N({providers:[]})))}).subscribe({next:e=>{this.workflow=e.workflow,this.selectedNode=e.workflow.nodes[0],this.runs=e.runs.filter(d=>d.workflow===a).reverse(),this.providers=e.providers.providers??[],this.loading=!1},error:e=>{this.loading=!1,this.error=e?.error?.error??"Failed to load workflow."}})}nodeProvider(a){return ae(a,{provider:this.workflow?.defaultProvider,model:this.workflow?.defaultModel})}providerBadgeLabel(a){let e=this.nodeProvider(a);return e.inherited?`\u2192 ${e.name}`:e.name}get dependencyCount(){return this.workflow?.nodes.reduce((a,e)=>a+e.dependsOn.length,0)??0}get dagLayers(){if(!this.workflow)return[];let a=new Map,e=(l,m=new Set)=>{if(a.has(l.id))return a.get(l.id);if(m.has(l.id)||!l.dependsOn.length)return 0;m.add(l.id);let W=1+Math.max(...l.dependsOn.map(de=>{let T=this.workflow.nodes.find(ce=>ce.id===de);return T?e(T,m):0}));return m.delete(l.id),a.set(l.id,W),W};for(let l of this.workflow.nodes)a.set(l.id,e(l));let d=[];for(let l of this.workflow.nodes)(d[a.get(l.id)??0]??=[]).push(l);return d}typeLabel(a){return a==="command"?"CMD":a==="prompt"?"AI":"SH"}onStartRun(a){this.showRunDialog=!1,this.api.startRun(this.workflow.id,a.args,{provider:a.provider,model:a.model}).subscribe(e=>this.router.navigate(["/runs",e.runId]))}copyYaml(){this.workflow&&navigator.clipboard.writeText(this.workflow.yaml).then(()=>{this.copied=!0,setTimeout(()=>this.copied=!1,1500)})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-workflow-detail"]],decls:4,vars:3,consts:[[1,"detail-page"],["class","state error",4,"ngIf"],["class","state",4,"ngIf"],[4,"ngIf"],[1,"state","error"],[1,"state"],[1,"breadcrumb"],["routerLink","/workflows"],[1,"hero"],[1,"workflow-icon"],[1,"hero-copy"],[1,"namespace"],[1,"hero-actions"],["routerLink","/workflows/builder",1,"button","secondary",3,"queryParams"],["type","button",1,"button","primary",3,"click"],[1,"stats"],[1,"file-strip"],["aria-label","Workflow detail sections",1,"tabs"],["type","button",3,"active","click",4,"ngFor","ngForOf"],["class","tab-content",4,"ngIf"],["class","dag-panel",4,"ngIf"],["class","yaml-panel",4,"ngIf"],["class","runs-panel",4,"ngIf"],[3,"run","closed","visible","workflowName","providers"],["type","button",3,"click"],[1,"tab-content"],[1,"node-list"],[1,"section-heading"],["type","button","class","node-row",3,"selected","click",4,"ngFor","ngForOf"],["class","inspector",4,"ngIf"],["type","button",1,"node-row",3,"click"],[1,"step-index"],[1,"type-icon"],[1,"node-main"],[1,"provider-badge"],[1,"dependency"],[1,"inspector"],[1,"inspector-title"],[1,"badge"],[1,"dag-panel"],[1,"dag-toolbar"],[1,"dag-scroll"],[1,"dag-canvas"],["class","dag-layer",4,"ngFor","ngForOf"],[1,"dag-layer"],[1,"layer-label"],[4,"ngFor","ngForOf"],[1,"yaml-panel"],[1,"yaml-toolbar"],[1,"runs-panel"],[1,"status"],["class","history-tag",4,"ngIf"],[3,"routerLink",4,"ngIf"],[1,"history-tag"],[3,"routerLink"],["colspan","5",1,"empty"]],template:function(e,d){e&1&&(n(0,"section",0),f(1,be,2,1,"div",1)(2,ve,2,0,"div",2)(3,Te,61,21,"ng-container",3),t()),e&2&&(o(),s("ngIf",d.error),o(),s("ngIf",d.loading),o(),s("ngIf",d.workflow))},dependencies:[J,q,G,U,O,H],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}.detail-page[_ngcontent-%COMP%]{max-width:1320px;margin:auto;padding:24px 28px 60px}.breadcrumb[_ngcontent-%COMP%]{display:flex;gap:7px;color:#737a87;font-size:12px;margin-bottom:18px}.breadcrumb[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#9ca3af;text-decoration:none}.hero[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:15px}.workflow-icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:0 0 46px;height:52px;border:1px solid #454957;border-radius:6px;color:#a5b4fc;font-weight:900}.hero-copy[_ngcontent-%COMP%]{min-width:0}.namespace[_ngcontent-%COMP%]{font:11px ui-monospace,monospace;color:#818cf8}.hero[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:26px;margin:4px 0}.hero[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#9ba1ad;margin:5px 0;line-height:1.5;max-width:800px}.hero-actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-left:auto}.button[_ngcontent-%COMP%]{padding:9px 13px;border-radius:5px;text-decoration:none;font:inherit;font-size:12px;font-weight:700;cursor:pointer}.button.secondary[_ngcontent-%COMP%]{border:1px solid #3b3e48;background:#1c1e24;color:#e5e7eb}.button.primary[_ngcontent-%COMP%]{border:1px solid #6366f1;background:#6366f1;color:#fff}.stats[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,1fr);border:1px solid #2d3038;border-radius:7px;margin-top:24px;background:#16171c}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:13px 16px;border-right:1px solid #2d3038}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border:0}.stats[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .file-strip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:#777e8b;font-size:10px;text-transform:uppercase;font-weight:700}.stats[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;font-size:14px}.file-strip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px;padding:10px 14px;border:1px solid #2d3038;border-top:0;background:#131419}.file-strip[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{color:#aab0bb;font-size:11px}.tabs[_ngcontent-%COMP%]{display:flex;border-bottom:1px solid #2d3038;margin-top:24px}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#858c98;padding:10px 14px;font-weight:700;cursor:pointer}.tabs[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{color:#fff;box-shadow:inset 0 -2px #6366f1}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background:#292c34;padding:1px 5px;border-radius:8px;font-size:10px}.tab-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;margin-top:18px}.section-heading[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:15px;margin:0}.section-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:12px;color:#7f8692;margin:4px 0 12px}.node-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:28px 38px minmax(180px,1fr) minmax(120px,.5fr);align-items:center;gap:11px;width:100%;border:1px solid #292c34;border-bottom:0;background:#16171c;color:#e5e7eb;padding:11px;text-align:left;cursor:pointer}.node-row[_ngcontent-%COMP%]:first-of-type{border-radius:6px 6px 0 0}.node-row[_ngcontent-%COMP%]:last-child{border-bottom:1px solid #292c34;border-radius:0 0 6px 6px}.node-row[_ngcontent-%COMP%]:hover, .node-row.selected[_ngcontent-%COMP%]{background:#1e2027;border-color:#494d5a}.step-index[_ngcontent-%COMP%]{color:#676e7a;font-size:11px;text-align:center}.type-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:28px;border-radius:4px;background:#242630;color:#c4b5fd;font-size:9px;font-weight:900;text-transform:uppercase}.type-icon[data-type=bash][_ngcontent-%COMP%]{color:#fbbf24}.type-icon[data-type=command][_ngcontent-%COMP%]{color:#67e8f9}.node-main[_ngcontent-%COMP%]{min-width:0}.node-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#777e8b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}.dependency[_ngcontent-%COMP%]{color:#858c98;font-size:11px;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%]{border:1px solid #2d3038;background:#16171c;border-radius:6px;padding:15px}.inspector-title[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px;font-weight:800}.inspector[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:8px 0;font-size:16px}.badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid #4b4f5c;padding:2px 6px;border-radius:4px;font-size:10px;color:#a5b4fc}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{margin:14px 0}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid #282a31;font-size:11px}.inspector[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:#777e8b}.inspector[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;text-align:right;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:10px;color:#777e8b;text-transform:uppercase}.inspector[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{white-space:pre-wrap;overflow-wrap:anywhere;background:#0d0e11;padding:10px;border-radius:5px;font-size:11px;max-height:240px;overflow:auto}.dag-panel[_ngcontent-%COMP%], .yaml-panel[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%]{margin-top:18px;border:1px solid #2d3038;border-radius:7px;overflow:hidden}.dag-toolbar[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #2d3038;background:#16171c}.dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.dag-toolbar[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{font-size:11px;color:#858c98}.dag-scroll[_ngcontent-%COMP%]{overflow-x:auto;background-color:var(--background)}.dag-canvas[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:20px;width:max-content;min-width:100%;box-sizing:border-box;padding:14px 16px;background-image:radial-gradient(#30333b 1px,transparent 1px);background-size:16px 16px}.dag-layer[_ngcontent-%COMP%]{display:flex;flex:0 0 auto;min-width:200px;flex-direction:column;gap:8px}.layer-label[_ngcontent-%COMP%]{font-size:10px;color:var(--text-tertiary);text-transform:uppercase}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%]{border:1px solid var(--border-bright);background:var(--surface);border-radius:6px;padding:8px 10px}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:12px;overflow-wrap:anywhere}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] .provider-badge[_ngcontent-%COMP%]{margin:7px 0 0}.yaml-toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #3a3d47;background:#22242b;color:#ddd;border-radius:4px;padding:5px 9px}.yaml-panel[_ngcontent-%COMP%] > pre[_ngcontent-%COMP%]{margin:0;padding:18px;min-height:420px;max-height:65vh;overflow:auto;background:#0d0e11;color:#cdd6f4;font:12px/1.6 ui-monospace,monospace;white-space:pre-wrap}.runs-panel[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;background:#16171c;font-size:12px}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px;text-align:left;border-bottom:1px solid #292c34}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px}.runs-panel[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#a5b4fc}.status[_ngcontent-%COMP%]{font-size:10px;text-transform:uppercase}.status[data-status=completed][_ngcontent-%COMP%]{color:#34d399}.status[data-status=failed][_ngcontent-%COMP%], .status[data-status=cancelled][_ngcontent-%COMP%]{color:#f87171}.status[data-status=running][_ngcontent-%COMP%]{color:#60a5fa}.provider-badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid var(--border-bright);border-radius:4px;background:var(--surface-elevated);color:#c4b5fd;font:10px ui-monospace,monospace;padding:1px 6px;margin-left:8px;vertical-align:1px}.provider-badge.inherited[_ngcontent-%COMP%]{color:var(--text-tertiary);border-style:dashed;background:transparent}.history-tag[_ngcontent-%COMP%]{border:1px dashed var(--border-bright);color:var(--text-tertiary);padding:1px 5px;border-radius:4px;font-size:9px;text-transform:uppercase;margin-left:6px}.empty[_ngcontent-%COMP%], .state[_ngcontent-%COMP%]{padding:24px;text-align:center;color:#858c98}.state.error[_ngcontent-%COMP%]{color:#fca5a5}@media(max-width:900px){.detail-page[_ngcontent-%COMP%]{padding:18px 14px}.hero[_ngcontent-%COMP%]{flex-wrap:wrap}.hero-actions[_ngcontent-%COMP%]{width:100%;margin-left:61px}.stats[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-bottom:1px solid #2d3038}.tab-content[_ngcontent-%COMP%]{grid-template-columns:1fr}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 38px 1fr}.dependency[_ngcontent-%COMP%]{grid-column:3}.inspector[_ngcontent-%COMP%]{position:static}}@media(max-width:600px){.stats[_ngcontent-%COMP%]{grid-template-columns:1fr}.hero-actions[_ngcontent-%COMP%]{margin-left:0}.tabs[_ngcontent-%COMP%]{overflow:auto}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 1fr}.type-icon[_ngcontent-%COMP%]{display:none}.node-main[_ngcontent-%COMP%], .dependency[_ngcontent-%COMP%]{grid-column:2}.dag-canvas[_ngcontent-%COMP%]{padding:18px}}"]})};export{le as WorkflowDetailComponent};
|