@ngocsangairvds/vsaf 5.1.18 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -1
- package/package.json +1 -1
- package/packages/cli/dist/commands/abandon.d.ts +6 -0
- package/packages/cli/dist/commands/abandon.d.ts.map +1 -0
- package/packages/cli/dist/commands/abandon.js +42 -0
- package/packages/cli/dist/commands/abandon.js.map +1 -0
- package/packages/cli/dist/commands/ai.d.ts +21 -0
- package/packages/cli/dist/commands/ai.d.ts.map +1 -0
- package/packages/cli/dist/commands/ai.js +76 -0
- package/packages/cli/dist/commands/ai.js.map +1 -0
- package/packages/cli/dist/commands/approve.d.ts +19 -0
- package/packages/cli/dist/commands/approve.d.ts.map +1 -0
- package/packages/cli/dist/commands/approve.js +115 -0
- package/packages/cli/dist/commands/approve.js.map +1 -0
- package/packages/cli/dist/commands/chat.d.ts +41 -0
- package/packages/cli/dist/commands/chat.d.ts.map +1 -0
- package/packages/cli/dist/commands/chat.js +129 -0
- package/packages/cli/dist/commands/chat.js.map +1 -0
- package/packages/cli/dist/commands/isolation.d.ts +20 -0
- package/packages/cli/dist/commands/isolation.d.ts.map +1 -0
- package/packages/cli/dist/commands/isolation.js +104 -0
- package/packages/cli/dist/commands/isolation.js.map +1 -0
- package/packages/cli/dist/commands/run.d.ts +37 -1
- package/packages/cli/dist/commands/run.d.ts.map +1 -1
- package/packages/cli/dist/commands/run.js +165 -15
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/telemetry.d.ts +10 -0
- package/packages/cli/dist/commands/telemetry.d.ts.map +1 -0
- package/packages/cli/dist/commands/telemetry.js +51 -0
- package/packages/cli/dist/commands/telemetry.js.map +1 -0
- package/packages/cli/dist/commands/validate.d.ts +12 -0
- package/packages/cli/dist/commands/validate.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate.js +83 -0
- package/packages/cli/dist/commands/validate.js.map +1 -0
- package/packages/cli/dist/commands/workflow.d.ts +29 -0
- package/packages/cli/dist/commands/workflow.d.ts.map +1 -0
- package/packages/cli/dist/commands/workflow.js +147 -0
- package/packages/cli/dist/commands/workflow.js.map +1 -0
- package/packages/cli/dist/index.js +253 -6
- package/packages/cli/dist/index.js.map +1 -1
- package/packages/cli/dist/mcp/server.d.ts +9 -0
- package/packages/cli/dist/mcp/server.d.ts.map +1 -1
- package/packages/cli/dist/mcp/server.js +40 -2
- package/packages/cli/dist/mcp/server.js.map +1 -1
- package/packages/cli/dist/server/app.d.ts.map +1 -1
- package/packages/cli/dist/server/app.js +2 -0
- package/packages/cli/dist/server/app.js.map +1 -1
- package/packages/cli/dist/server/routes/conversations.d.ts +6 -0
- package/packages/cli/dist/server/routes/conversations.d.ts.map +1 -0
- package/packages/cli/dist/server/routes/conversations.js +145 -0
- package/packages/cli/dist/server/routes/conversations.js.map +1 -0
- package/packages/cli/dist/server/routes/runs.d.ts.map +1 -1
- package/packages/cli/dist/server/routes/runs.js +15 -3
- package/packages/cli/dist/server/routes/runs.js.map +1 -1
- package/packages/cli/dist/server/services/execution-manager.d.ts +25 -0
- package/packages/cli/dist/server/services/execution-manager.d.ts.map +1 -1
- package/packages/cli/dist/server/services/execution-manager.js +257 -95
- package/packages/cli/dist/server/services/execution-manager.js.map +1 -1
- package/packages/core/dist/config/ai-config.d.ts +24 -0
- package/packages/core/dist/config/ai-config.d.ts.map +1 -0
- package/packages/core/dist/config/ai-config.js +170 -0
- package/packages/core/dist/config/ai-config.js.map +1 -0
- package/packages/core/dist/engine/dag-executor.d.ts +29 -1
- package/packages/core/dist/engine/dag-executor.d.ts.map +1 -1
- package/packages/core/dist/engine/dag-executor.js +210 -8
- package/packages/core/dist/engine/dag-executor.js.map +1 -1
- package/packages/core/dist/engine/dag-parser.d.ts.map +1 -1
- package/packages/core/dist/engine/dag-parser.js +32 -1
- package/packages/core/dist/engine/dag-parser.js.map +1 -1
- package/packages/core/dist/engine/loop-signal.d.ts +7 -0
- package/packages/core/dist/engine/loop-signal.d.ts.map +1 -0
- package/packages/core/dist/engine/loop-signal.js +21 -0
- package/packages/core/dist/engine/loop-signal.js.map +1 -0
- package/packages/core/dist/engine/node-runner.d.ts +4 -1
- package/packages/core/dist/engine/node-runner.d.ts.map +1 -1
- package/packages/core/dist/engine/node-runner.js +14 -6
- package/packages/core/dist/engine/node-runner.js.map +1 -1
- package/packages/core/dist/index.d.ts +5 -2
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/index.js +25 -1
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/providers/default-adapters.d.ts.map +1 -1
- package/packages/core/dist/providers/default-adapters.js +9 -1
- package/packages/core/dist/providers/default-adapters.js.map +1 -1
- package/packages/core/dist/runtime/executor.d.ts +1 -1
- package/packages/core/dist/runtime/executor.d.ts.map +1 -1
- package/packages/core/dist/runtime/executor.js +14 -8
- package/packages/core/dist/runtime/executor.js.map +1 -1
- package/packages/core/dist/schema/workflow-schema.d.ts +94 -14
- package/packages/core/dist/schema/workflow-schema.d.ts.map +1 -1
- package/packages/core/dist/schema/workflow-schema.js +38 -6
- package/packages/core/dist/schema/workflow-schema.js.map +1 -1
- package/packages/core/dist/store/recovery.d.ts.map +1 -1
- package/packages/core/dist/store/recovery.js +7 -0
- package/packages/core/dist/store/recovery.js.map +1 -1
- package/packages/core/dist/store/run-store.d.ts +5 -3
- package/packages/core/dist/store/run-store.d.ts.map +1 -1
- package/packages/core/dist/store/run-store.js +12 -4
- package/packages/core/dist/store/run-store.js.map +1 -1
- package/packages/core/dist/store/sqlite-schema.d.ts +1 -1
- package/packages/core/dist/store/sqlite-schema.d.ts.map +1 -1
- package/packages/core/dist/store/sqlite-schema.js +20 -0
- package/packages/core/dist/store/sqlite-schema.js.map +1 -1
- package/packages/core/dist/store/sqlite-workflow-store.d.ts +26 -0
- package/packages/core/dist/store/sqlite-workflow-store.d.ts.map +1 -1
- package/packages/core/dist/store/sqlite-workflow-store.js +106 -0
- package/packages/core/dist/store/sqlite-workflow-store.js.map +1 -1
- package/packages/core/dist/store/types.d.ts +17 -0
- package/packages/core/dist/store/types.d.ts.map +1 -1
- package/packages/core/dist/store/types.js.map +1 -1
- package/packages/core/dist/telemetry/telemetry.d.ts +31 -0
- package/packages/core/dist/telemetry/telemetry.d.ts.map +1 -0
- package/packages/core/dist/telemetry/telemetry.js +177 -0
- package/packages/core/dist/telemetry/telemetry.js.map +1 -0
- package/packages/core/dist/types/dag.d.ts +16 -0
- package/packages/core/dist/types/dag.d.ts.map +1 -1
- package/packages/core/dist/types/provider.d.ts +4 -0
- package/packages/core/dist/types/provider.d.ts.map +1 -1
- package/packages/core/dist/types/workflow.d.ts +18 -1
- package/packages/core/dist/types/workflow.d.ts.map +1 -1
- package/packages/web/dist/web/browser/chunk-2JHYGCCN.js +1 -0
- package/packages/web/dist/web/browser/chunk-BMQT4ZPK.js +1 -0
- package/packages/web/dist/web/browser/chunk-GWHJRWJM.js +1 -0
- package/packages/web/dist/web/browser/chunk-OZ6BRCXC.js +1 -0
- package/packages/web/dist/web/browser/chunk-Q7N6DAKT.js +1 -0
- package/packages/web/dist/web/browser/chunk-SEBU2SK7.js +1 -0
- package/packages/web/dist/web/browser/chunk-SOS4TH5D.js +4 -0
- package/packages/web/dist/web/browser/chunk-WSAVMPNK.js +5 -0
- package/packages/web/dist/web/browser/index.html +1 -1
- package/packages/web/dist/web/browser/main-UPZIVGM6.js +1 -0
- package/packages/web/dist/web/browser/chunk-5WD7R336.js +0 -1
- package/packages/web/dist/web/browser/chunk-FXYDTGOX.js +0 -1
- package/packages/web/dist/web/browser/chunk-K4DHLOOA.js +0 -1
- package/packages/web/dist/web/browser/chunk-V2CDNNWN.js +0 -1
- package/packages/web/dist/web/browser/chunk-WJT4QH2P.js +0 -4
- package/packages/web/dist/web/browser/chunk-WMJLW2L6.js +0 -5
- package/packages/web/dist/web/browser/chunk-XHOL7AER.js +0 -1
- package/packages/web/dist/web/browser/chunk-YBYFKZWR.js +0 -1
- package/packages/web/dist/web/browser/main-SYHKSBNJ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as w,A,D as fe,E as M,F as o,Fa as ve,H as Y,I as u,J as h,L as pe,M as ge,Na as _e,a as l,b as d,d as ae,da as K,e as le,g as ue,h as de,k,l as m,m as Z,ma as _,n as X,o as v,p as g,sa as f,ta as F,u as ce,v as D,va as J,wa as me,x as b,xa as Q,y as he,z as P}from"./chunk-WSAVMPNK.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()})}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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as J,b as Z,e as Q,j as X,k as ee}from"./chunk-OZ6BRCXC.js";import{$ as f,B as N,C as r,Da as R,G as y,Ha as z,Ka as W,Na as Y,O as p,P as c,R as A,S as D,T as x,U as s,V as o,W as O,_ as j,aa as u,c as q,da as S,fa as d,ga as m,ha as h,ia as w,ja as K,ka as U,la as H,m as L,p as g,q as v,r as b,v as V,w as B,ya as E}from"./chunk-WSAVMPNK.js";var I=class n{zone=g(B);projectService=g(Y);connect(t){return new q(e=>{let i=this.projectService.currentId,a=i?`?project=${encodeURIComponent(i)}`:"",l=new EventSource(`/api/runs/${t}/events${a}`),M=["node:start","node:complete","node:skip","node:fail","run:complete","run:state","run:pause","run:cancel"];for(let P of M)l.addEventListener(P,pe=>{this.zone.run(()=>{e.next({type:P,data:JSON.parse(pe.data)})})});return l.onerror=()=>{this.zone.run(()=>{e.complete()}),l.close()},()=>{l.close()}})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})};function xe(n,t){if(n&1&&(s(0,"span",1),d(1),o()),n&2){let e=u();r(),m(e.expanded?"\u25BE":"\u25B8")}}function ge(n,t){if(n&1&&(s(0,"span",4),d(1),o()),n&2){let e=u();r(),m(e.providerBadge)}}function fe(n,t){if(n&1&&(s(0,"span",5),d(1),o()),n&2){let e=u();x("ngClass",e.typeBadgeClass),r(),m(e.type)}}function he(n,t){if(n&1&&(s(0,"span",6),d(1),o()),n&2){let e=u();r(),h("",(e.durationMs/1e3).toFixed(1),"s")}}function _e(n,t){n&1&&(s(0,"span",7),d(1,"running..."),o())}function ve(n,t){n&1&&(s(0,"span",8),d(1,"skipped"),o())}function be(n,t){n&1&&(s(0,"span",9),d(1,"FAILED"),o())}var T=class n{nodeId="";status="pending";type;durationMs;provider;model;expandable=!1;expanded=!1;toggled=new V;onRowClick(){this.expandable&&this.toggled.emit()}get providerBadge(){return this.provider?this.model?`${this.provider}/${this.model}`:this.provider:""}get statusIcon(){switch(this.status){case"completed":return"\u2713";case"running":return"\u25CF";case"failed":return"\u2717";case"skipped":return"\u2298";default:return"\u25CB"}}get statusIconClass(){switch(this.status){case"completed":return"text-green-400";case"running":return"text-blue-400 animate-pulse";case"failed":return"text-red-400";case"skipped":return"text-slate-500";default:return"text-slate-600"}}get statusTextClass(){switch(this.status){case"pending":return"text-slate-500";case"skipped":return"text-slate-500";default:return"text-slate-100"}}get typeBadgeClass(){switch(this.type){case"prompt":return"bg-purple-500/10 text-purple-400";case"bash":return"bg-amber-500/10 text-amber-400";case"command":return"bg-cyan-500/10 text-cyan-400";default:return"bg-slate-700 text-slate-400"}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["app-node-status-row"]],inputs:{nodeId:"nodeId",status:"status",type:"type",durationMs:"durationMs",provider:"provider",model:"model",expandable:"expandable",expanded:"expanded"},outputs:{toggled:"toggled"},decls:12,vars:15,consts:[[1,"flex","items-center","py-2.5","border-b","border-slate-800",3,"click"],[1,"mr-2","text-xs","text-slate-500","w-3","inline-block"],[1,"mr-3","text-sm",3,"ngClass"],[1,"flex-1",3,"ngClass"],[1,"text-xs","px-1.5","py-0.5","rounded","mr-2","bg-indigo-500/10","text-indigo-300","font-mono"],[1,"text-xs","px-1.5","py-0.5","rounded","mr-2",3,"ngClass"],[1,"font-mono","text-xs","text-slate-400"],[1,"font-mono","text-xs","text-blue-400","animate-pulse"],[1,"text-xs","text-slate-500"],[1,"text-xs","text-red-400"]],template:function(e,i){e&1&&(s(0,"div",0),f("click",function(){return i.onRowClick()}),p(1,xe,2,1,"span",1),s(2,"span",2),d(3),o(),s(4,"span",3),d(5),o(),p(6,ge,2,1,"span",4),p(7,fe,2,2,"span",5),p(8,he,2,1,"span",6),p(9,_e,2,0,"span",7),p(10,ve,2,0,"span",8),p(11,be,2,0,"span",9),o()),e&2&&(S("cursor-pointer",i.expandable)("select-none",i.expandable),r(),c(i.expandable?1:-1),r(),x("ngClass",i.statusIconClass),r(),m(i.statusIcon),r(),x("ngClass",i.statusTextClass),r(),m(i.nodeId),r(),c(i.provider?6:-1),r(),c(i.type?7:-1),r(),c(i.status==="completed"&&i.durationMs!==void 0?8:-1),r(),c(i.status==="running"?9:-1),r(),c(i.status==="skipped"?10:-1),r(),c(i.status==="failed"?11:-1))},dependencies:[R,E],encapsulation:2})};var Ce=new Set(["completed","failed","cancelled"]);function G(n){return n!==void 0&&Ce.has(n)}function ne(n,t=new Date().toISOString()){G(n.status)&&!n.completedAt&&(n.completedAt=t)}function ie(n,t=Date.now()){let e=new Date(n.startedAt).getTime(),i=n.completedAt?new Date(n.completedAt).getTime():t;return Math.max(0,i-e)}function re(n){let t=Math.floor(n/1e3),e=Math.floor(t/60),i=t%60;return e>0?`${e}m ${i}s`:`${i}s`}var k=class{entries=new Map;toggle(t,e){let i=this.entry(t);return i.expanded=!i.expanded,!i.expanded||i.fetchedStatus===e&&(i.phase==="loaded"||i.phase==="loading")?!1:(i.phase="loading",i.fetchedStatus=e,i.error=void 0,!0)}statusChanged(t,e){let i=this.entries.get(t);return!i||i.fetchedStatus===void 0||i.fetchedStatus===e?!1:i.expanded?(i.phase="loading",i.fetchedStatus=e,i.error=void 0,!0):(i.phase="idle",i.data=void 0,i.error=void 0,i.fetchedStatus=void 0,!1)}resolve(t,e,i){let a=this.entries.get(t);!a||a.fetchedStatus!==e||(a.phase="loaded",a.data=i,a.error=void 0)}fail(t,e,i){let a=this.entries.get(t);!a||a.fetchedStatus!==e||(a.phase="error",a.error=i,a.data=void 0)}isExpanded(t){return this.entries.get(t)?.expanded??!1}phase(t){let e=this.entries.get(t);return!e||!e.expanded?"collapsed":e.phase==="idle"?"loading":e.phase}data(t){return this.entries.get(t)?.data}errorMessage(t){return this.entries.get(t)?.error}entry(t){let e=this.entries.get(t);return e||(e={expanded:!1,phase:"idle"},this.entries.set(t,e)),e}};var ye="Approval required",Se="Run paused \u2014 input required to continue.";function C(n){return`${n.nodeId}\0${n.iteration??""}\0${n.message}`}function ae(n){let t=oe(n);if(t)return t;let e=n.approval;if(e&&typeof e=="object")return oe(e)}function oe(n){let t=_(n.approvalNodeId)??_(n.nodeId);if(!t)return;let e=_(n.approvalMessage)??_(n.message),i=_(n.approvalType)??_(n.type),a=n.iteration;return{nodeId:t,message:e||ye,type:i==="interactive_loop"?"interactive_loop":"approval",iteration:typeof a=="number"?a:void 0}}function _(n){return typeof n=="string"&&n!==""?n:void 0}var F=class{current;state="hidden";error;answeredKey;pauseReceived(t){this.current=ae(t)??se(),this.state="ready",this.error=void 0}runStateChanged(t,e){if(t!=="paused"){this.current=void 0,this.state="hidden",this.error=void 0,this.answeredKey=void 0;return}if(this.state==="submitting")return;let i=e?ae(e):void 0,a=i?C(i):void 0;a!==void 0&&a===this.answeredKey||this.current&&a!==void 0&&a===C(this.current)||this.current&&i===void 0||(this.current=i??se(),this.state="ready",this.error=void 0)}submitStarted(){this.state!=="hidden"&&(this.state="submitting",this.error=void 0)}submitFailed(t){this.state!=="hidden"&&(this.state="error",this.error=t)}submitSucceeded(){this.current&&(this.answeredKey=C(this.current)),this.current=void 0,this.state="hidden",this.error=void 0}visible(){return this.state!=="hidden"}phase(){return this.state}request(){return this.current}errorMessage(){return this.error}submitAction(){return this.current?.type==="interactive_loop"?"resume":"approve"}};function se(){return{nodeId:"",message:Se,type:"approval"}}function de(n,t,e=new Date().toISOString()){let i=`gate:${C(t)}`;return n.some(a=>a.key===i)?n:[...n,{key:i,role:"gate",text:t.message,at:e,nodeId:t.nodeId,iteration:t.iteration}]}function $(n,t,e,i=new Date().toISOString()){return[...n,{key:`user:${n.length}:${i}`,role:"user",kind:t,text:we(t,e),at:i}]}function we(n,t){let e=t.trim();switch(n){case"answer":return e;case"approve":return e?`Approved: ${e}`:"Approved";case"reject":return e?`Rejected: ${e}`:"Rejected"}}function le(n){return Ee(n).split(/`([^`]*)`/).map((i,a)=>a%2===1?`<code>${i}</code>`:i.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>")).join("").replace(/\n/g,"<br>")}function Ee(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Re=(n,t)=>t.id,Ie=(n,t)=>t.key;function Te(n,t){if(n&1&&(s(0,"span",6),d(1),o()),n&2){let e=u();x("ngClass",e.statusClass(e.run.status)),r(),w(" ",e.statusIcon(e.run.status)," ",e.run.status," ")}}function ke(n,t){n&1&&(s(0,"div",13),d(1,"Loading output\u2026"),o())}function Fe(n,t){if(n&1&&(s(0,"div",14),d(1),o()),n&2){let e=u(2).$implicit,i=u();r(),m(i.panels.errorMessage(e.id))}}function Me(n,t){if(n&1&&(s(0,"span",16),d(1),o()),n&2){let e=u();r(),w(" ",e.provider,"",e.model?"/"+e.model:""," ")}}function Ne(n,t){if(n&1&&(s(0,"span",17),d(1),o()),n&2){let e=u();r(),h("",(e.durationMs/1e3).toFixed(1),"s")}}function Ae(n,t){if(n&1&&(s(0,"pre",18),d(1),o()),n&2){let e=u();r(),m(e.error)}}function De(n,t){if(n&1&&(s(0,"pre",19),d(1),o()),n&2){let e=u();r(),m(e.output)}}function Oe(n,t){n&1&&(s(0,"div",20),d(1,"No output"),o())}function je(n,t){if(n&1&&(s(0,"div",15),p(1,Me,2,2,"span",16),p(2,Ne,2,1,"span",17),o(),p(3,Ae,2,1,"pre",18),p(4,De,2,1,"pre",19)(5,Oe,2,0,"div",20)),n&2){let e=t;r(),c(e.provider?1:-1),r(),c(e.durationMs!==null?2:-1),r(),c(e.error?3:-1),r(),c(e.output?4:e.error?-1:5)}}function Ge(n,t){if(n&1&&p(0,je,6,4),n&2){let e,i=u(2).$implicit,a=u();c((e=a.panels.data(i.id))?0:-1,e)}}function $e(n,t){if(n&1&&(s(0,"div",12),p(1,ke,2,0,"div",13)(2,Fe,2,1,"div",14)(3,Ge,1,1),o()),n&2){let e,i=u().$implicit,a=u();r(),c((e=a.panels.phase(i.id))==="loading"?1:e==="error"?2:e==="loaded"?3:-1)}}function Pe(n,t){if(n&1){let e=j();s(0,"app-node-status-row",11),f("toggled",function(){let a=v(e).$implicit,l=u();return b(l.togglePanel(a))}),o(),p(1,$e,4,1,"div",12)}if(n&2){let e=t.$implicit,i=u();x("nodeId",e.id)("status",e.status)("durationMs",e.durationMs)("provider",e.provider)("model",e.model)("expandable",!0)("expanded",i.panels.isExpanded(e.id)),r(),c(i.panels.isExpanded(e.id)?1:-1)}}function qe(n,t){if(n&1&&(s(0,"div",24),d(1),o()),n&2){let e=u().$implicit;r(),w(" \u23F8 ",e.nodeId||"gate","",e.iteration!==void 0?" \xB7 iteration "+e.iteration:""," ")}}function Le(n,t){if(n&1&&(s(0,"div",22)(1,"div",23),p(2,qe,2,2,"div",24),O(3,"div",25),o()()),n&2){let e=t.$implicit,i=u(2);S("justify-end",e.role==="user"),r(),x("ngClass",e.role==="user"?"bg-indigo-500/15 text-indigo-100":"bg-slate-800 text-slate-200"),r(),c(e.role==="gate"?2:-1),r(),x("innerHTML",i.render(e.text),N)}}function Ve(n,t){if(n&1&&(s(0,"div",8),A(1,Le,4,5,"div",21,Ie),o()),n&2){let e=u();r(),D(e.feed)}}function Be(n,t){if(n&1&&(s(0,"span",27),d(1),o()),n&2){let e,i=u(2);r(),m((e=i.gate.request())==null?null:e.nodeId)}}function Ke(n,t){if(n&1&&(s(0,"span",28),d(1),o()),n&2){let e,i=u(2);r(),h("iteration ",(e=i.gate.request())==null?null:e.iteration)}}function Ue(n,t){if(n&1&&(s(0,"div",31),d(1),o()),n&2){let e=u(2);r(),m(e.gate.errorMessage())}}function He(n,t){if(n&1){let e=j();s(0,"div",9)(1,"div",26)(2,"span"),d(3,"\u23F8 Input required"),o(),p(4,Be,2,1,"span",27),p(5,Ke,2,1,"span",28),o(),O(6,"div",29),s(7,"textarea",30),H("ngModelChange",function(a){v(e);let l=u();return U(l.draft,a)||(l.draft=a),b(a)}),o(),p(8,Ue,2,1,"div",31),s(9,"div",32)(10,"button",33),f("click",function(){v(e);let a=u();return b(a.sendAnswer())}),d(11),o(),s(12,"button",34),f("click",function(){v(e);let a=u();return b(a.rejectGate())}),d(13," Reject "),o()()()}if(n&2){let e,i,a,l=u();r(4),c((e=l.gate.request())!=null&&e.nodeId?4:-1),r(),c(((i=l.gate.request())==null?null:i.iteration)!==void 0?5:-1),r(),x("innerHTML",l.render(((a=l.gate.request())==null?null:a.message)??""),N),r(),K("ngModel",l.draft),x("disabled",l.gate.phase()==="submitting")("placeholder",l.gate.submitAction()==="resume"?"Type your answer\u2026":"Optional response\u2026"),r(),c(l.gate.errorMessage()?8:-1),r(2),x("disabled",l.gate.phase()==="submitting"||l.gate.submitAction()==="resume"&&!l.draft.trim()),r(),h(" ",l.gate.phase()==="submitting"?"Sending\u2026":"Send & Continue"," "),r(),x("disabled",l.gate.phase()==="submitting")}}function ze(n,t){if(n&1&&(s(0,"div",10)(1,"span",35),d(2,"Elapsed: "),s(3,"span",36),d(4),o()(),s(5,"span",37),d(6,"Nodes: "),s(7,"span",38),d(8),o(),d(9,"/"),s(10,"span",39),d(11),o(),d(12," completed "),o()()),n&2){let e=u();r(4),m(e.elapsedDisplay),r(4),m(e.completedCount),r(3),m(e.nodes.length)}}var ue=class n{route=g(z);api=g(ee);sse=g(I);run;nodes=[];panels=new k;gate=new F;feed=[];draft="";runId="";sseSub;timerInterval;focusAnswerOnShow=!1;ngOnInit(){this.runId=this.route.snapshot.paramMap.get("runId"),this.focusAnswerOnShow=this.route.snapshot.fragment==="answer",this.api.getRun(this.runId).subscribe(t=>{this.run=t,this.rebuildNodeList(),this.stopTimerIfFinished(),this.syncGateFromRun()}),this.sseSub=this.sse.connect(this.runId).subscribe(t=>{this.handleSseEvent(t)}),this.timerInterval=setInterval(()=>{},1e3)}ngOnDestroy(){this.sseSub?.unsubscribe(),this.timerInterval&&clearInterval(this.timerInterval)}togglePanel(t){this.panels.toggle(t.id,t.status)&&this.fetchOutput(t.id,t.status)}fetchOutput(t,e){this.api.getNodeOutput(this.runId,t).subscribe({next:i=>this.panels.resolve(t,e,i),error:i=>this.panels.fail(t,e,i?.error?.error??"Failed to load node output.")})}handleSseEvent(t){let e=t.data,i=e.nodeId;switch(t.type){case"run:state":this.run=e,this.rebuildNodeList(),this.stopTimerIfFinished(),this.syncGateFromRun();break;case"run:pause":this.run&&(this.run.status="paused"),this.gate.pauseReceived(e),this.noteGateInFeed(),this.maybeFocusAnswer();break;case"run:cancel":this.run&&(this.run.status="cancelled"),this.gate.runStateChanged("cancelled"),this.stopTimerIfFinished();break;case"node:start":this.updateNodeStatus(i,"running",void 0,{provider:e.provider,model:e.model});break;case"node:complete":this.updateNodeStatus(i,"completed",e.durationMs);break;case"node:skip":this.updateNodeStatus(i,"skipped");break;case"node:fail":this.updateNodeStatus(i,"failed");break;case"run:complete":this.run&&(this.run.status=e.success?"completed":"failed",this.gate.runStateChanged(this.run.status)),this.stopTimerIfFinished();break}}rebuildNodeList(){if(!this.run)return;let t=new Map(this.nodes.map(e=>[e.id,e]));this.nodes=Object.entries(this.run.nodes).map(([e,i])=>({id:e,status:i.status,durationMs:i.durationMs,provider:t.get(e)?.provider,model:t.get(e)?.model}));for(let e of this.nodes)this.noteStatus(e)}updateNodeStatus(t,e,i,a){let l=this.nodes.find(M=>M.id===t);l?(l.status=e,i!==void 0&&(l.durationMs=i)):(l={id:t,status:e,durationMs:i},this.nodes.push(l)),a?.provider&&(l.provider=a.provider),a?.model&&(l.model=a.model),this.noteStatus(l)}noteStatus(t){this.panels.statusChanged(t.id,t.status)&&this.fetchOutput(t.id,t.status)}syncGateFromRun(){this.run&&(this.gate.runStateChanged(this.run.status,this.run),this.noteGateInFeed(),this.maybeFocusAnswer())}noteGateInFeed(){let t=this.gate.request();this.gate.visible()&&t&&(this.feed=de(this.feed,t))}sendAnswer(){if(!this.gate.visible()||this.gate.phase()==="submitting")return;let t=this.draft.trim(),e=this.gate.submitAction();if(e==="resume"&&!t)return;this.gate.submitStarted(),(e==="resume"?this.api.resumeRun(this.runId,t):this.api.approveRun(this.runId,t||void 0)).subscribe({next:()=>{this.feed=$(this.feed,e==="resume"?"answer":"approve",t),this.draft="",this.gate.submitSucceeded()},error:a=>this.gate.submitFailed(a?.error?.error??"Failed to send the answer.")})}rejectGate(){if(!this.gate.visible()||this.gate.phase()==="submitting")return;let t=prompt("Rejection reason","Rejected by operator");t!==null&&(this.gate.submitStarted(),this.api.rejectRun(this.runId,t||void 0).subscribe({next:()=>{this.feed=$(this.feed,"reject",t),this.gate.submitSucceeded()},error:e=>this.gate.submitFailed(e?.error?.error??"Failed to reject the run.")}))}render(t){return le(t)}maybeFocusAnswer(){!this.focusAnswerOnShow||!this.gate.visible()||(this.focusAnswerOnShow=!1,setTimeout(()=>{document.getElementById("gate-answer-panel")?.scrollIntoView({behavior:"smooth",block:"center"}),document.getElementById("gate-answer-input")?.focus()}))}get completedCount(){return this.nodes.filter(t=>t.status==="completed").length}get elapsedDisplay(){return this.run?re(ie(this.run)):"0s"}stopTimerIfFinished(){!this.run||!G(this.run.status)||(ne(this.run),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0))}statusClass(t){switch(t){case"completed":return"bg-green-500/10 text-green-400";case"failed":return"bg-red-500/10 text-red-400";case"running":return"bg-blue-500/10 text-blue-400";default:return"bg-slate-700 text-slate-400"}}statusIcon(t){switch(t){case"completed":return"\u2713";case"failed":return"\u2717";case"running":return"\u25CF";default:return"\u25CB"}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["app-run-execution"]],decls:19,vars:6,consts:[[1,"max-w-3xl","mx-auto"],[1,"flex","items-center","mb-6","gap-2","text-sm"],["routerLink","/",1,"text-slate-500","hover:text-slate-300"],[1,"text-slate-600"],[1,"text-slate-300"],[1,"font-mono","text-slate-100"],[1,"text-xs","px-2","py-0.5","rounded","ml-2",3,"ngClass"],[1,"mb-6"],[1,"mb-4","space-y-2"],["id","gate-answer-panel",1,"mb-6","rounded-lg","border","border-amber-500/40","bg-amber-500/10","p-4"],[1,"bg-slate-800","rounded-lg","px-4","py-3","flex","items-center","text-sm"],[3,"toggled","nodeId","status","durationMs","provider","model","expandable","expanded"],[1,"border-b","border-slate-800","bg-slate-900/40","px-4","py-3"],[1,"text-xs","text-slate-500","animate-pulse"],[1,"text-xs","text-red-400"],[1,"flex","items-center","gap-3","mb-2","text-xs"],[1,"px-1.5","py-0.5","rounded","bg-indigo-500/10","text-indigo-300","font-mono"],[1,"font-mono","text-slate-400"],[1,"font-mono","text-xs","text-red-300","bg-red-500/10","border","border-red-500/30","rounded","p-3","mb-2","max-h-80","overflow-auto","whitespace-pre-wrap","break-words"],[1,"font-mono","text-xs","text-slate-300","bg-slate-950","border","border-slate-800","rounded","p-3","max-h-80","overflow-auto","whitespace-pre-wrap","break-words"],[1,"text-xs","text-slate-500","italic"],[1,"flex",3,"justify-end"],[1,"flex"],[1,"max-w-[85%]","rounded-lg","px-3","py-2","text-sm",3,"ngClass"],[1,"text-[10px]","uppercase","tracking-wide","text-slate-500","mb-1"],[3,"innerHTML"],[1,"flex","items-center","gap-2","mb-2","text-amber-300","font-semibold","text-sm"],[1,"font-mono","text-xs","text-amber-400/80"],[1,"text-xs","text-amber-400/60"],[1,"text-sm","text-slate-200","mb-3",3,"innerHTML"],["id","gate-answer-input","rows","3",1,"w-full","rounded","border","border-slate-700","bg-slate-950","p-2","text-sm","text-slate-100","focus:border-amber-500","focus:outline-none",3,"ngModelChange","ngModel","disabled","placeholder"],[1,"text-xs","text-red-400","mt-1"],[1,"flex","gap-2","mt-2"],["type","button",1,"rounded","bg-amber-500","px-3","py-1.5","text-sm","font-semibold","text-slate-950","hover:bg-amber-400","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],["type","button",1,"rounded","border","border-red-500/50","px-3","py-1.5","text-sm","text-red-300","hover:bg-red-500/10","disabled:opacity-40",3,"click","disabled"],[1,"text-slate-400"],[1,"text-slate-100","font-mono"],[1,"ml-6","text-slate-400"],[1,"text-green-400"],[1,"text-slate-100"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"a",2),d(3,"Dashboard"),o(),s(4,"span",3),d(5,"\u203A"),o(),s(6,"span",4),d(7),o(),s(8,"span",3),d(9,"\u203A"),o(),s(10,"span",5),d(11),o(),p(12,Te,2,3,"span",6),o(),s(13,"div",7),A(14,Pe,2,8,null,null,Re),o(),p(16,Ve,3,0,"div",8),p(17,He,14,10,"div",9),p(18,ze,13,3,"div",10),o()),e&2&&(r(7),m(i.run==null?null:i.run.workflow),r(4),m(i.run==null?null:i.run.runId),r(),c(i.run?12:-1),r(2),D(i.nodes),r(2),c(i.feed.length?16:-1),r(),c(i.gate.visible()?17:-1),r(),c(i.run?18:-1))},dependencies:[R,E,X,J,Z,Q,W,T],encapsulation:2})};export{ue as RunExecutionComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R,b as F,c as V,d as A,e as H,f as K,j as z,k as W}from"./chunk-OZ6BRCXC.js";import{$ as w,C as a,Da as D,G as M,Ha as T,Ka as L,N as x,O as p,P as g,R as u,S as f,T as v,U as i,V as o,_ as S,aa as l,da as O,fa as r,ga as m,ia as k,ja as P,ka as I,la as E,oa as N,p as C,q as _,r as y,x as d}from"./chunk-WSAVMPNK.js";function B(t){let n=t.metadata?.category;return n==="gate"?"gate":n==="workflow_status"?"status":"text"}function $(t){return t.title?t.title:t.runs.length>0?t.runs[0].workflow_name:t.id}var G=t=>["/conversations",t],h=(t,n)=>n.id;function q(t,n){t&1&&(i(0,"p",2),r(1,"No conversations yet. Start a run or send a message."),o())}function J(t,n){if(t&1&&(i(0,"span",8),r(1),o()),t&2){let e=n.$implicit;x("data-status",e.status),a(),k("",e.workflow_name," \xB7 ",e.status)}}function Q(t,n){if(t&1&&(i(0,"a",5)(1,"span",6),r(2),o(),i(3,"span",7),u(4,J,2,3,"span",8,h),o()()),t&2){let e=n.$implicit,s=l();O("active",e.id===s.selectedId()),v("routerLink",N(4,G,e.id)),a(2),m(s.label(e)),a(2),f(e.runs)}}function U(t,n){t&1&&(i(0,"p",2),r(1,"Select a conversation to view its messages."),o())}function X(t,n){if(t&1&&(i(0,"div",10)(1,"span",15),r(2),o(),i(3,"p",16),r(4),o()()),t&2){let e=n.$implicit,s=l(2);x("data-role",e.role)("data-kind",s.kind(e)),a(2),m(e.role),a(2),m(e.content)}}function Y(t,n){if(t&1&&(i(0,"p",14),r(1),o()),t&2){let e=l(2);a(),m(e.lastReply())}}function Z(t,n){if(t&1){let e=S();i(0,"div",9),u(1,X,5,4,"div",10,h),o(),i(3,"form",11),w("ngSubmit",function(){_(e);let c=l();return y(c.send())}),i(4,"input",12),E("ngModelChange",function(c){_(e);let b=l();return I(b.draft,c)||(b.draft=c),y(c)}),o(),i(5,"button",13),r(6,"Send"),o()(),p(7,Y,2,1,"p",14)}if(t&2){let e=l();a(),f(e.messages()),a(3),P("ngModel",e.draft),v("disabled",e.sending()),a(),v("disabled",e.sending()||!e.draft.trim()),a(2),g(e.lastReply()?7:-1)}}var j=class t{api=C(W);route=C(T);pollHandle;paramSub;conversations=d([]);messages=d([]);selectedId=d(null);sending=d(!1);lastReply=d("");draft="";ngOnInit(){this.paramSub=this.route.paramMap.subscribe(n=>{this.selectedId.set(n.get("conversationId")),this.refresh()}),this.pollHandle=setInterval(()=>this.refreshMessages(),4e3)}ngOnDestroy(){this.pollHandle&&clearInterval(this.pollHandle),this.paramSub?.unsubscribe()}label=$;kind=B;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:s=>{this.lastReply.set(s.reply),this.draft="",this.sending.set(!1),this.refresh()},error:()=>this.sending.set(!1)}))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=M({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,s){e&1&&(i(0,"div",0)(1,"aside",1)(2,"h2"),r(3,"Conversations"),o(),p(4,q,2,0,"p",2),u(5,Q,6,6,"a",3,h),o(),i(7,"section",4),p(8,U,2,0,"p",2)(9,Z,8,4),o()()),e&2&&(a(4),g(s.conversations().length===0?4:-1),a(),f(s.conversations()),a(3),g(s.selectedId()?9:8))},dependencies:[D,z,K,R,F,V,H,A,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{j as ConversationsComponent};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
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-OZ6BRCXC.js";import{$ as f,Aa as q,C as s,Da as G,G as V,Ha as H,Ja as J,K as _,Ka as K,N as F,T as u,U as i,V as r,W as O,X as D,Y as $,_ as C,a as B,aa as p,b as T,ba as z,ca as L,da as P,ea as R,fa as d,ga as w,ha as v,ia as N,ja as h,ka as x,la as b,oa as Y,p as M,q as m,r as g,ra as A,s as S,t as I,za as j}from"./chunk-WSAVMPNK.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
|
+
`))t.push(` ${a}`)}return`${t.join(`
|
|
3
|
+
`)}
|
|
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};
|