@memberjunction/ng-core-entity-forms 6.1.0-edge.0 → 6.1.0-edge.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.d.ts +19 -2
- package/dist/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.js +50 -9
- package/dist/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-form-tabs.d.ts +59 -0
- package/dist/lib/custom/AIAgents/agent-form-tabs.d.ts.map +1 -0
- package/dist/lib/custom/AIAgents/agent-form-tabs.js +53 -0
- package/dist/lib/custom/AIAgents/agent-form-tabs.js.map +1 -0
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +54 -0
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +1300 -1143
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.js +9 -9
- package/dist/lib/custom/EntityActions/entityaction.form.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts +25 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js +228 -170
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.d.ts +60 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.js +372 -188
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.d.ts +9 -0
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.js +86 -51
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts +73 -4
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js +133 -7
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.d.ts +49 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +383 -264
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.d.ts +10 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.js +25 -3
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.d.ts +21 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.js +11 -0
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.d.ts +28 -0
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.d.ts.map +1 -0
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.js +120 -0
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.js.map +1 -0
- package/dist/lib/custom/ai-agent-run/run-tree-timeline-projection.d.ts +90 -0
- package/dist/lib/custom/ai-agent-run/run-tree-timeline-projection.d.ts.map +1 -0
- package/dist/lib/custom/ai-agent-run/run-tree-timeline-projection.js +326 -0
- package/dist/lib/custom/ai-agent-run/run-tree-timeline-projection.js.map +1 -0
- package/dist/lib/custom/custom-forms.module.d.ts +14 -13
- package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
- package/dist/lib/custom/custom-forms.module.js +8 -1
- package/dist/lib/custom/custom-forms.module.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.js +59 -41
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentCredential/mjaiagentcredential.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJAIAgentCredential/mjaiagentcredential.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentCredential/mjaiagentcredential.form.component.js +78 -0
- package/dist/lib/generated/Entities/MJAIAgentCredential/mjaiagentcredential.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentHarness/mjaiagentharness.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/{MJReportSnapshot/mjreportsnapshot.form.component.d.ts.map → MJAIAgentHarness/mjaiagentharness.form.component.d.ts.map} +1 -1
- package/dist/lib/generated/Entities/MJAIAgentHarness/mjaiagentharness.form.component.js +90 -0
- package/dist/lib/generated/Entities/MJAIAgentHarness/mjaiagentharness.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentRequest/mjaiagentrequest.form.component.js +8 -6
- package/dist/lib/generated/Entities/MJAIAgentRequest/mjaiagentrequest.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js +105 -83
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js +184 -164
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIModelType/mjaimodeltype.form.component.js +25 -23
- package/dist/lib/generated/Entities/MJAIModelType/mjaimodeltype.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIModelVendor/mjaimodelvendor.form.component.js +15 -13
- package/dist/lib/generated/Entities/MJAIModelVendor/mjaimodelvendor.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.js +43 -25
- package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIVendor/mjaivendor.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIVendor/mjaivendor.form.component.js +31 -13
- package/dist/lib/generated/Entities/MJAIVendor/mjaivendor.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAction/mjaction.form.component.js +31 -31
- package/dist/lib/generated/Entities/MJAction/mjaction.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJActionExecutionLog/mjactionexecutionlog.form.component.js +11 -11
- package/dist/lib/generated/Entities/MJActionExecutionLog/mjactionexecutionlog.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJActionParam/mjactionparam.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJActionParam/mjactionparam.form.component.js +5 -23
- package/dist/lib/generated/Entities/MJActionParam/mjactionparam.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js +2 -2
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJConversation/mjconversation.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJConversation/mjconversation.form.component.js +31 -49
- package/dist/lib/generated/Entities/MJConversation/mjconversation.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJConversationDetail/mjconversationdetail.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJConversationDetail/mjconversationdetail.form.component.js +38 -56
- package/dist/lib/generated/Entities/MJConversationDetail/mjconversationdetail.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.js +31 -13
- package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJDataContext/mjdatacontext.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJDataContext/mjdatacontext.form.component.js +7 -25
- package/dist/lib/generated/Entities/MJDataContext/mjdatacontext.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js +3 -3
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntityAction/mjentityaction.form.component.js +38 -36
- package/dist/lib/generated/Entities/MJEntityAction/mjentityaction.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntityActionParam/mjentityactionparam.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJEntityActionParam/mjentityactionparam.form.component.js +7 -13
- package/dist/lib/generated/Entities/MJEntityActionParam/mjentityactionparam.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntityRelationship/mjentityrelationship.form.component.js +12 -10
- package/dist/lib/generated/Entities/MJEntityRelationship/mjentityrelationship.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEnvironment/mjenvironment.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJEnvironment/mjenvironment.form.component.js +15 -33
- package/dist/lib/generated/Entities/MJEnvironment/mjenvironment.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJOutputDeliveryType/mjoutputdeliverytype.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJOutputDeliveryType/mjoutputdeliverytype.form.component.js +6 -25
- package/dist/lib/generated/Entities/MJOutputDeliveryType/mjoutputdeliverytype.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJOutputFormatType/mjoutputformattype.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJOutputFormatType/mjoutputformattype.form.component.js +6 -25
- package/dist/lib/generated/Entities/MJOutputFormatType/mjoutputformattype.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJScheduledJob/mjscheduledjob.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJScheduledJob/mjscheduledjob.form.component.js +45 -25
- package/dist/lib/generated/Entities/MJScheduledJob/mjscheduledjob.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTask/mjtask.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJTask/mjtask.form.component.js +68 -24
- package/dist/lib/generated/Entities/MJTask/mjtask.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTaskDependency/mjtaskdependency.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJTaskDependency/mjtaskdependency.form.component.js +20 -6
- package/dist/lib/generated/Entities/MJTaskDependency/mjtaskdependency.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js +372 -462
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +375 -389
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +158 -215
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/package.json +43 -42
- package/dist/lib/generated/Entities/MJOutputTriggerType/mjoutputtriggertype.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJOutputTriggerType/mjoutputtriggertype.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJOutputTriggerType/mjoutputtriggertype.form.component.js +0 -83
- package/dist/lib/generated/Entities/MJOutputTriggerType/mjoutputtriggertype.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJReport/mjreport.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJReport/mjreport.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJReport/mjreport.form.component.js +0 -161
- package/dist/lib/generated/Entities/MJReport/mjreport.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJReportCategory/mjreportcategory.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJReportCategory/mjreportcategory.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJReportCategory/mjreportcategory.form.component.js +0 -113
- package/dist/lib/generated/Entities/MJReportCategory/mjreportcategory.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJReportSnapshot/mjreportsnapshot.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJReportSnapshot/mjreportsnapshot.form.component.js +0 -72
- package/dist/lib/generated/Entities/MJReportSnapshot/mjreportsnapshot.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJReportUserState/mjreportuserstate.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJReportUserState/mjreportuserstate.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJReportUserState/mjreportuserstate.form.component.js +0 -72
- package/dist/lib/generated/Entities/MJReportUserState/mjreportuserstate.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJReportVersion/mjreportversion.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJReportVersion/mjreportversion.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJReportVersion/mjreportversion.form.component.js +0 -78
- package/dist/lib/generated/Entities/MJReportVersion/mjreportversion.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJScheduledAction/mjscheduledaction.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJScheduledAction/mjscheduledaction.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJScheduledAction/mjscheduledaction.form.component.js +0 -135
- package/dist/lib/generated/Entities/MJScheduledAction/mjscheduledaction.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJScheduledActionParam/mjscheduledactionparam.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJScheduledActionParam/mjscheduledactionparam.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJScheduledActionParam/mjscheduledactionparam.form.component.js +0 -76
- package/dist/lib/generated/Entities/MJScheduledActionParam/mjscheduledactionparam.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJWorkflow/mjworkflow.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJWorkflow/mjworkflow.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJWorkflow/mjworkflow.form.component.js +0 -121
- package/dist/lib/generated/Entities/MJWorkflow/mjworkflow.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJWorkflowEngine/mjworkflowengine.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJWorkflowEngine/mjworkflowengine.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJWorkflowEngine/mjworkflowengine.form.component.js +0 -87
- package/dist/lib/generated/Entities/MJWorkflowEngine/mjworkflowengine.form.component.js.map +0 -1
- package/dist/lib/generated/Entities/MJWorkflowRun/mjworkflowrun.form.component.d.ts +0 -10
- package/dist/lib/generated/Entities/MJWorkflowRun/mjworkflowrun.form.component.d.ts.map +0 -1
- package/dist/lib/generated/Entities/MJWorkflowRun/mjworkflowrun.form.component.js +0 -80
- package/dist/lib/generated/Entities/MJWorkflowRun/mjworkflowrun.form.component.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-run-flow.component.js","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.component.ts","../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAc,SAAS,EAAE,MAAM,EAAE,iBAAiB,EACxC,uBAAuB,EAAE,MAAM,EAC1D,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,EACgB,cAAc,EAAE,UAAU,EAAE,SAAS,EAC1D,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAChE,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;;;;;;;;;;;;;;;;;;;;;;ICXhC,gCAAuB;IAAA,oBAAI;IAAA,iBAAO;;;;IALvD,kCAEmE;IADnC,0MAAS,uBAAa,KAAC;IAErD,wBAAsC;IACtC,4BAAM;IAAA,YAAa;IAAA,iBAAO;IAC1B,iGAAkB;IACpB,iBAAS;;;;IAN6C,AAA5B,8CAA2B,uBAA0B;IAEvE,AADA,wCAAuB,yEACmC;IACjD,cAAkB;IAAlB,mC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ACjB,SAAS;mBAAC,QAAQ;;kBAClB,SAAS;mBAAC,SAAS;;kBACnB,SAAS;mBAAC,SAAS;;kBACnB,SAAS;mBAAC,QAAQ;;kBAClB,SAAS;mBAAC,UAAU;;kBACpB,SAAS;mBAAC,SAAS;;kBACnB,SAAS;mBAAC,QAAQ;;kBAClB,SAAS;mBAAC,SAAS;;kFArDT,uBAAuB","sourcesContent":["import {\n Component, Input, ElementRef, ViewChild, NgZone, ChangeDetectorRef,\n OnDestroy, AfterViewInit, ChangeDetectionStrategy, inject\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { combineLatest } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { CompositeKey } from '@memberjunction/core';\nimport { SharedService } from '@memberjunction/ng-shared';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { UserInfoEngine } from '@memberjunction/core-entities';\nimport { AIAgentRunDataHelper } from '../ai-agent-run-data.service';\nimport { TimelineItem } from '../ai-agent-run-timeline.component';\nimport {\n FlowModel, FlowNode, buildFlowModel, activeLeaf, ancestors,\n formatDuration, shortLabel, FLOW_COLORS, FLOW_EMOJI, FLOW_LABEL\n} from './agent-run-flow.model';\nimport { FlameCascadeComponent } from './flame-cascade.component';\nimport { SubwayLinesComponent } from './subway-lines.component';\nimport { ConstellationComponent } from './constellation.component';\nimport { FlowchartComponent } from './flowchart.component';\n\ninterface FlowMode { key: string; label: string; icon: string; enabled: boolean; }\n\n/**\n * Flow — the playable, zoomed-out execution view for an Agent Run.\n *\n * Owns the single master clock (scrub / play / speed) and the narration rail,\n * and hosts three interchangeable renderers (Flame, Subway, Constellation).\n * The per-frame loop runs *outside* Angular's zone and pushes updates straight\n * to the DOM / active renderer, so 60fps playback never triggers change detection.\n */\n@Component({\n standalone: false,\n selector: 'mj-ai-agent-run-flow',\n templateUrl: './agent-run-flow.component.html',\n styleUrls: ['./agent-run-flow.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AIAgentRunFlowComponent implements AfterViewInit, OnDestroy {\n @Input() aiAgentRunId!: string;\n @Input() dataHelper!: AIAgentRunDataHelper;\n @Input() agentName: string | null = null;\n @Input() runStatus = '';\n @Input() agentIconClass: string | null = null;\n @Input() agentLogoUrl: string | null = null;\n\n public modes: FlowMode[] = [\n { key: 'subway', label: 'Subway Lines', icon: 'fa-train-subway', enabled: true },\n { key: 'constellation', label: 'Constellation', icon: 'fa-star', enabled: true },\n { key: 'flow', label: 'Flow', icon: 'fa-diagram-project', enabled: true },\n { key: 'flame', label: 'Flame Cascade', icon: 'fa-fire', enabled: true }\n ];\n public mode = 'subway';\n public model: FlowModel | null = null;\n public playing = false;\n public speed = 1;\n public loading = true;\n public hasData = false;\n /** Selected node detail (any mode). */\n public selectedStepItem: TimelineItem | null = null;\n private selectedNodeId = -1;\n private logRows = new Map<number, HTMLElement>();\n private lastActiveRowId = -1;\n\n /** The animated modes share the master clock + narration rail; Flow is static. */\n public get isAnimated(): boolean { return this.mode !== 'flow'; }\n /** Rail (now-executing + log tree) shows only for animated modes with nothing selected. */\n public get showRail(): boolean { return this.isAnimated && !this.selectedStepItem; }\n\n /** Right-panel width (rail / inspector), resizable + persisted per user. Default is 50px wider than the old fixed panel. */\n public panelWidth = 410;\n private readonly PANEL_KEY = 'mj.agentRunFlow.panelWidth.v1';\n private resizing = false;\n private resizeStartX = 0;\n private resizeStartW = 0;\n\n @ViewChild(FlameCascadeComponent) private flame?: FlameCascadeComponent;\n @ViewChild(SubwayLinesComponent) private subway?: SubwayLinesComponent;\n @ViewChild(ConstellationComponent) private constellation?: ConstellationComponent;\n @ViewChild(FlowchartComponent) private flowchart?: FlowchartComponent;\n\n @ViewChild('scrub') private scrubRef?: ElementRef<HTMLInputElement>;\n @ViewChild('clock') private clockRef?: ElementRef<HTMLElement>;\n @ViewChild('crumb') private crumbRef?: ElementRef<HTMLElement>;\n @ViewChild('nowIco') private nowIcoRef?: ElementRef<HTMLElement>;\n @ViewChild('nowName') private nowNameRef?: ElementRef<HTMLElement>;\n @ViewChild('nowType') private nowTypeRef?: ElementRef<HTMLElement>;\n @ViewChild('nowDur') private nowDurRef?: ElementRef<HTMLElement>;\n @ViewChild('nowModel') private nowModelRef?: ElementRef<HTMLElement>;\n @ViewChild('nowStat') private nowStatRef?: ElementRef<HTMLElement>;\n @ViewChild('nowBar') private nowBarRef?: ElementRef<HTMLElement>;\n @ViewChild('loglist') private loglistRef?: ElementRef<HTMLElement>;\n\n private destroy$ = new Subject<void>();\n private rafId: number | null = null;\n private p = 0;\n private lastTs = 0;\n private readonly PLAY_MS = 11000;\n private logModelRef: FlowModel | null = null;\n private lastLeafId = -1;\n private viewReady = false;\n\n private zone = inject(NgZone);\n private cdr = inject(ChangeDetectorRef);\n\n ngAfterViewInit(): void {\n this.viewReady = true;\n const savedW = UserInfoEngine.Instance.GetSetting(this.PANEL_KEY);\n if (savedW) { const n = +savedW; if (n >= 280) this.panelWidth = Math.min(n, this.maxPanelWidth()); }\n combineLatest([this.dataHelper.steps$, this.dataHelper.loading$])\n .pipe(takeUntil(this.destroy$))\n .subscribe(([steps, loading]) => {\n this.loading = loading && steps.length === 0;\n if (!loading || steps.length > 0) this.rebuildModel();\n this.cdr.markForCheck();\n });\n this.zone.runOutsideAngular(() => {\n this.rafId = requestAnimationFrame(ts => this.tick(ts));\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next(); this.destroy$.complete();\n if (this.rafId != null) cancelAnimationFrame(this.rafId);\n }\n\n private async rebuildModel(): Promise<void> {\n const wasEmpty = !this.model;\n await AIEngineBase.Instance.EnsureLoaded(); // agent icons/logos read synchronously during build\n const rootIcon = { iconClass: this.agentIconClass || 'fa-robot', logoUrl: this.agentLogoUrl };\n const model = await buildFlowModel(this.agentName ?? '', this.runStatus, rootIcon, this.dataHelper);\n this.model = model;\n this.hasData = model.leaves.length > 0;\n if (wasEmpty) this.p = 0;\n this.lastLeafId = -1;\n this.cdr.markForCheck();\n }\n\n /* -------------------------------- transport ------------------------------- */\n\n public togglePlay(): void {\n if (!this.hasData) return;\n if (this.p >= 1) this.p = 0;\n this.playing = !this.playing;\n this.lastTs = 0;\n }\n\n public restart(): void {\n if (!this.hasData) return;\n this.p = 0; this.playing = true; this.lastTs = 0;\n this.lastLeafId = -1;\n }\n\n public onScrub(value: string): void {\n this.p = (+value) / 1000;\n this.playing = false;\n }\n\n public onSpeed(value: string): void { this.speed = (+value) / 100; }\n\n public selectMode(m: FlowMode): void {\n if (!m.enabled) return;\n this.mode = m.key;\n this.applyRendererSelection(this.selectedNodeId === -1 ? null : this.selectedNodeId);\n this.currentRenderer?.ReapplyView?.(); // ensure the now-visible renderer shows its OWN (per-type) zoom\n }\n\n private get currentRenderer(): { Render(p: number, ts: number): void; ZoomIn?(): void; ZoomOut?(): void; FitReset?(): void; ReapplyView?(): void } | undefined {\n switch (this.mode) {\n case 'flame': return this.flame;\n case 'subway': return this.subway;\n case 'constellation': return this.constellation;\n case 'flow': return this.flowchart;\n default: return undefined;\n }\n }\n\n /* --------------------------- zoom (shared toolbar) ------------------------ */\n\n public zoomIn(): void { this.currentRenderer?.ZoomIn?.(); }\n public zoomOut(): void { this.currentRenderer?.ZoomOut?.(); }\n public fitReset(): void { this.currentRenderer?.FitReset?.(); }\n\n /* ---------------------------- panel resize ------------------------------- */\n\n /** Cap the right panel at 75% of the viewport width. */\n private maxPanelWidth(): number { return Math.max(360, window.innerWidth * 0.75); }\n\n public startResize(e: MouseEvent): void {\n e.preventDefault();\n this.resizing = true;\n this.resizeStartX = e.clientX;\n this.resizeStartW = this.panelWidth;\n const move = (ev: MouseEvent) => {\n if (!this.resizing) return;\n const w = this.resizeStartW + (this.resizeStartX - ev.clientX); // drag left → wider\n this.panelWidth = Math.max(280, Math.min(this.maxPanelWidth(), w));\n this.cdr.markForCheck();\n };\n const up = () => {\n this.resizing = false;\n window.removeEventListener('mousemove', move);\n window.removeEventListener('mouseup', up);\n UserInfoEngine.Instance.SetSettingDebounced(this.PANEL_KEY, String(Math.round(this.panelWidth)));\n };\n window.addEventListener('mousemove', move);\n window.addEventListener('mouseup', up);\n }\n\n /* -------------------------------- selection ------------------------------ */\n\n /** A node was clicked in any renderer (or a log row) — highlight it everywhere and show its detail. */\n public selectStep(n: FlowNode): void {\n this.zone.run(() => {\n this.selectedNodeId = n.id;\n this.selectedStepItem = this.toTimelineItem(n);\n this.cdr.markForCheck();\n });\n this.applyRendererSelection(n.id);\n }\n\n public closeDetail(): void {\n this.zone.run(() => { this.selectedStepItem = null; this.selectedNodeId = -1; this.cdr.markForCheck(); });\n this.applyRendererSelection(null);\n this.flowchart?.Deselect();\n }\n\n private applyRendererSelection(id: number | null): void {\n this.flame?.SetSelected(id);\n this.subway?.SetSelected(id);\n this.constellation?.SetSelected(id);\n }\n\n public onDetailNavigateActionLog(logId: string): void {\n SharedService.Instance.OpenEntityRecord('MJ: Action Execution Logs', CompositeKey.FromID(logId));\n }\n\n public async onDetailCopy(text: string): Promise<void> {\n try { await navigator.clipboard.writeText(text); } catch { /* clipboard unavailable */ }\n }\n\n private toTimelineItem(n: FlowNode): TimelineItem | null {\n if (!n.raw) return null;\n return {\n id: n.raw.ID, type: 'step', title: n.name, subtitle: `Type: ${n.raw.StepType}`,\n status: n.status, startTime: n.raw.StartedAt, endTime: n.raw.CompletedAt || undefined,\n duration: formatDuration(n.realDur), icon: 'fa-circle', color: '', data: n.raw, level: n.depth\n };\n }\n\n /* ------------------------------- master loop ------------------------------ */\n\n private tick(ts: number): void {\n const animated = this.isAnimated;\n if (animated && this.playing && this.hasData) {\n if (!this.lastTs) this.lastTs = ts;\n const dt = ts - this.lastTs; this.lastTs = ts;\n this.p += dt / (this.PLAY_MS / this.speed);\n if (this.p >= 1) { this.p = 1; this.playing = false; this.zone.run(() => this.cdr.markForCheck()); }\n } else {\n this.lastTs = 0;\n }\n if (this.viewReady && this.model && this.hasData) {\n if (animated) {\n this.currentRenderer?.Render(this.p, ts);\n this.updateRail(ts);\n } else {\n // Flow (static): just ensure the flowchart is built; no clock.\n this.flowchart?.Render(0, ts);\n }\n }\n this.rafId = requestAnimationFrame(t => this.tick(t));\n }\n\n /* ------------------------------ narration rail ---------------------------- */\n\n private updateRail(_ts: number): void {\n const m = this.model!;\n\n // (Re)populate the imperative rail content whenever the rail DOM is fresh\n // (the @if remounted it with template defaults) or the model changed. Without\n // this, a remount at run-completion leaves an empty log + a blank now-card.\n if (this.loglistRef &&\n (this.logModelRef !== m || (this.loglistRef.nativeElement.childElementCount === 0 && m.nodes.length > 1))) {\n this.buildLogTree();\n this.logModelRef = m;\n this.lastLeafId = -1; // force the now-card to repopulate the fresh DOM\n }\n\n const leaf = activeLeaf(m, this.p);\n const prog = this.p >= leaf.t1 ? 1 : Math.max(0, (this.p - leaf.t0) / (leaf.t1 - leaf.t0));\n\n if (this.scrubRef) this.scrubRef.nativeElement.value = String(Math.round(this.p * 1000));\n if (this.clockRef) {\n const realT = this.p >= 1 ? m.total : leaf.r0 + prog * leaf.realDur;\n this.clockRef.nativeElement.textContent = `${formatDuration(realT)} / ${formatDuration(m.total)}`;\n }\n if (this.nowBarRef) this.nowBarRef.nativeElement.style.width = `${prog * 100}%`;\n\n if (leaf.id !== this.lastLeafId) {\n this.lastLeafId = leaf.id;\n this.refreshNowCard(leaf);\n }\n if (this.nowStatRef) {\n this.nowStatRef.nativeElement.textContent = this.p >= 1 ? 'done' : (this.p > leaf.t0 ? 'running' : 'starting');\n }\n if (this.loglistRef) this.updateLogTree();\n }\n\n private refreshNowCard(leaf: FlowNode): void {\n const col = FLOW_COLORS[leaf.type];\n if (this.nowIcoRef) this.nowIcoRef.nativeElement.textContent = FLOW_EMOJI[leaf.type];\n if (this.nowNameRef) this.nowNameRef.nativeElement.textContent = leaf.name;\n if (this.nowTypeRef) {\n this.nowTypeRef.nativeElement.textContent = FLOW_LABEL[leaf.type];\n this.nowTypeRef.nativeElement.style.color = col;\n }\n if (this.nowDurRef) this.nowDurRef.nativeElement.textContent = formatDuration(leaf.realDur);\n if (this.nowModelRef) this.nowModelRef.nativeElement.textContent = leaf.model ?? '—';\n if (this.crumbRef) {\n const chain = ancestors(leaf);\n this.crumbRef.nativeElement.innerHTML = chain.map((n, i) =>\n `${i ? '<span class=\"sep\">›</span>' : ''}<span style=\"color:${FLOW_COLORS[n.type]}\">${FLOW_EMOJI[n.type]} ${this.escape(n.name)}</span>`\n ).join('');\n }\n }\n\n /* ------------------------------ log tree (rail) --------------------------- */\n\n /** Build a clickable indented tree of every step, mirroring the run hierarchy. */\n private buildLogTree(): void {\n const list = this.loglistRef!.nativeElement;\n list.innerHTML = '';\n this.logRows.clear();\n this.lastActiveRowId = -1;\n const m = this.model!;\n for (const n of m.nodes) {\n if (n.depth === 0) continue; // skip the synthetic root (it's the header)\n const col = FLOW_COLORS[n.type];\n const row = document.createElement('div');\n row.className = 'ftree-row';\n row.style.paddingLeft = `${6 + (n.depth - 1) * 15}px`;\n const ico = n.logoUrl\n ? `<img class=\"ftree-logo\" src=\"${this.escape(n.logoUrl)}\" alt=\"\"/>`\n : `<i class=\"ftree-ico fa-solid ${this.escape(n.iconClass)}\" style=\"color:${col}\"></i>`;\n row.innerHTML = ico +\n `<span class=\"ftree-name\">${this.escape(shortLabel(n))}</span>` +\n `<span class=\"ftree-dur\">${formatDuration(n.realDur)}</span>`;\n row.addEventListener('click', () => this.selectStep(n));\n list.appendChild(row);\n this.logRows.set(n.id, row);\n }\n }\n\n /** Sync each log row's state (pending / running / done / selected) with the clock. */\n private updateLogTree(): void {\n const m = this.model!;\n for (const n of m.nodes) {\n if (n.depth === 0) continue;\n const row = this.logRows.get(n.id);\n if (!row) continue;\n const started = this.p >= n.t0;\n const active = started && this.p < n.t1;\n row.classList.toggle('ftree-pending', !started);\n row.classList.toggle('ftree-active', active);\n row.classList.toggle('ftree-done', this.p >= n.t1);\n row.classList.toggle('ftree-selected', n.id === this.selectedNodeId);\n if (active && n.id !== this.lastActiveRowId && !n.children.length) {\n this.lastActiveRowId = n.id;\n row.scrollIntoView({ block: 'nearest' });\n }\n }\n }\n\n private escape(s: string): string {\n return s.replace(/[&<>\"]/g, c => ({ '&': '&', '<': '<', '>': '>', '\"': '"' }[c] ?? c));\n }\n}\n","<div class=\"flow-cockpit\">\n <!-- mode segmented control -->\n <div class=\"flow-modes\">\n @for (m of modes; track m.key) {\n <button class=\"flow-mode\" [class.on]=\"mode === m.key\" [class.soon]=\"!m.enabled\"\n [disabled]=\"!m.enabled\" (click)=\"selectMode(m)\"\n [title]=\"m.enabled ? m.label : m.label + ' — coming soon'\">\n <i class=\"fas\" [ngClass]=\"m.icon\"></i>\n <span>{{ m.label }}</span>\n @if (!m.enabled) { <span class=\"soon-tag\">Soon</span> }\n </button>\n }\n </div>\n\n <div class=\"flow-main\">\n <!-- stage -->\n <div class=\"flow-stage\">\n @if (loading) {\n <div class=\"flow-overlay\"><mj-loading text=\"Building flow…\"></mj-loading></div>\n } @else if (!hasData) {\n <div class=\"flow-overlay flow-empty\">\n <i class=\"fas fa-wind\"></i>\n <p>No steps recorded for this run yet.</p>\n </div>\n }\n\n <mj-agent-flow-flame [class.flow-hidden]=\"mode !== 'flame'\" [Model]=\"model\" (nodeSelected)=\"selectStep($event)\"></mj-agent-flow-flame>\n <mj-agent-flow-subway [class.flow-hidden]=\"mode !== 'subway'\" [Model]=\"model\" (nodeSelected)=\"selectStep($event)\"></mj-agent-flow-subway>\n <mj-agent-flow-constellation [class.flow-hidden]=\"mode !== 'constellation'\" [Model]=\"model\" (nodeSelected)=\"selectStep($event)\"></mj-agent-flow-constellation>\n <mj-agent-flow-flowchart [class.flow-hidden]=\"mode !== 'flow'\" [Model]=\"model\"\n (nodeSelected)=\"selectStep($event)\"\n (selectionCleared)=\"closeDetail()\"></mj-agent-flow-flowchart>\n\n @if (hasData) {\n <div class=\"flow-zoom\">\n <button class=\"fz-btn\" (click)=\"zoomIn()\" title=\"Zoom in\"><i class=\"fas fa-magnifying-glass-plus\"></i></button>\n <button class=\"fz-btn\" (click)=\"zoomOut()\" title=\"Zoom out\"><i class=\"fas fa-magnifying-glass-minus\"></i></button>\n <button class=\"fz-btn\" (click)=\"fitReset()\" title=\"Fit to view\"><i class=\"fas fa-expand\"></i></button>\n </div>\n }\n </div>\n\n <!-- narration rail (animated modes, nothing selected) -->\n @if (showRail) {\n <aside class=\"flow-rail\" [style.width.px]=\"panelWidth\">\n <div class=\"flow-resizer\" (mousedown)=\"startResize($event)\" title=\"Drag to resize\"></div>\n <div class=\"now\">\n <div class=\"rail-lbl\">Now executing</div>\n <div class=\"breadcrumb\" #crumb></div>\n <div class=\"nowcard\">\n <div class=\"ico\" #nowIco>🤖</div>\n <h3 #nowName>—</h3>\n <div class=\"type\" #nowType>Agent run</div>\n <div class=\"meta\">\n <div>Duration<b #nowDur>—</b></div>\n <div>Status<b #nowStat>—</b></div>\n <div>Model<b #nowModel>—</b></div>\n </div>\n <div class=\"barbg\"><div class=\"barfg\" #nowBar></div></div>\n </div>\n </div>\n <div class=\"log\">\n <div class=\"rail-lbl sticky\">Execution log</div>\n <div #loglist class=\"loglist\"></div>\n </div>\n </aside>\n }\n\n <!-- step inspector (any mode) -->\n @if (selectedStepItem) {\n <aside class=\"flow-detail\" [style.width.px]=\"panelWidth\">\n <div class=\"flow-resizer\" (mousedown)=\"startResize($event)\" title=\"Drag to resize\"></div>\n <mj-ai-agent-run-step-detail\n [selectedTimelineItem]=\"selectedStepItem\"\n (closePanel)=\"closeDetail()\"\n (navigateToActionLog)=\"onDetailNavigateActionLog($event)\"\n (copyToClipboard)=\"onDetailCopy($event)\">\n </mj-ai-agent-run-step-detail>\n </aside>\n }\n </div>\n\n <!-- transport (animated modes only) -->\n @if (isAnimated) {\n <div class=\"flow-transport\">\n <button class=\"pbtn\" (click)=\"togglePlay()\" [disabled]=\"!hasData\" [title]=\"playing ? 'Pause' : 'Play'\">\n <i class=\"fas\" [ngClass]=\"playing ? 'fa-pause' : 'fa-play'\"></i>\n </button>\n <button class=\"ibtn\" (click)=\"restart()\" [disabled]=\"!hasData\" title=\"Restart\">\n <i class=\"fas fa-rotate-left\"></i>\n </button>\n <input #scrub class=\"scrub\" type=\"range\" min=\"0\" max=\"1000\" value=\"0\"\n [disabled]=\"!hasData\" (input)=\"onScrub(scrub.value)\"/>\n <div class=\"clock\" #clock>0s / 0s</div>\n <div class=\"speedbox\">\n <i class=\"fas fa-gauge-high\"></i>\n <input class=\"speed\" type=\"range\" min=\"25\" max=\"300\" value=\"100\" (input)=\"onSpeed($any($event.target).value)\"/>\n <span class=\"spdval\">{{ speed.toFixed(1) }}×</span>\n </div>\n </div>\n }\n\n <!-- legend / hint -->\n <div class=\"flow-legend\">\n @if (isAnimated) {\n <span><i class=\"lg\" style=\"background: var(--mj-text-muted)\"></i>Hint:</span>\n <span class=\"legend-note\">Playback is compressed so every step is visible — real duration shows through heat, size & speed, not literal width.</span>\n } @else {\n <span><i class=\"lg\" style=\"background: var(--mj-text-muted)\"></i>Tip:</span>\n <span class=\"legend-note\">Drag to pan, scroll to zoom, click any node to inspect it. Layout is the full execution tree, top to bottom.</span>\n }\n </div>\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"agent-run-flow.component.js","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.component.ts","../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAc,SAAS,EAAE,MAAM,EAAE,iBAAiB,EACxC,uBAAuB,EAAE,MAAM,EAC1D,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,O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;;kBACnB,SAAS;mBAAC,SAAS;;kBACnB,SAAS;mBAAC,QAAQ;;kBAClB,SAAS;mBAAC,UAAU;;kBACpB,SAAS;mBAAC,SAAS;;kBACnB,SAAS;mBAAC,QAAQ;;kBAClB,SAAS;mBAAC,SAAS;;kFAlET,uBAAuB","sourcesContent":["import {\n Component, Input, ElementRef, ViewChild, NgZone, ChangeDetectorRef,\n OnDestroy, AfterViewInit, ChangeDetectionStrategy, inject\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { combineLatest } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { CompositeKey } from '@memberjunction/core';\nimport { SharedService } from '@memberjunction/ng-shared';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { UserInfoEngine } from '@memberjunction/core-entities';\nimport { AIAgentRunDataHelper } from '../ai-agent-run-data.service';\nimport { TimelineItem } from '../ai-agent-run-timeline.component';\nimport {\n FlowModel, FlowNode, buildFlowModel, activeLeaf, ancestors,\n formatDuration, shortLabel, FLOW_COLORS, FLOW_EMOJI, FLOW_LABEL\n} from './agent-run-flow.model';\nimport { FlameCascadeComponent } from './flame-cascade.component';\nimport { SubwayLinesComponent } from './subway-lines.component';\nimport { buildFlowModelFromTree } from './run-tree-flow-projection';\nimport type { AgentRunTreeNode } from '@memberjunction/ai-core-plus';\nimport { ConstellationComponent } from './constellation.component';\nimport { FlowchartComponent } from './flowchart.component';\n\ninterface FlowMode { key: string; label: string; icon: string; enabled: boolean; }\n\n/**\n * Flow — the playable, zoomed-out execution view for an Agent Run.\n *\n * Owns the single master clock (scrub / play / speed) and the narration rail,\n * and hosts three interchangeable renderers (Flame, Subway, Constellation).\n * The per-frame loop runs *outside* Angular's zone and pushes updates straight\n * to the DOM / active renderer, so 60fps playback never triggers change detection.\n */\n@Component({\n standalone: false,\n selector: 'mj-ai-agent-run-flow',\n templateUrl: './agent-run-flow.component.html',\n styleUrls: ['./agent-run-flow.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AIAgentRunFlowComponent implements AfterViewInit, OnDestroy {\n @Input() aiAgentRunId!: string;\n @Input() dataHelper!: AIAgentRunDataHelper;\n @Input() agentName: string | null = null;\n @Input() runStatus = '';\n @Input() agentIconClass: string | null = null;\n @Input() agentLogoUrl: string | null = null;\n\n /**\n * The run's execution tree, loaded once by the form and shared with every tab.\n *\n * Setter-based so a refresh upstream rebuilds all three renderers immediately — they share one\n * model, so one rebuild updates whichever is on screen and every one behind it.\n */\n @Input()\n set RunTree(value: AgentRunTreeNode | null) {\n this.runTree = value;\n void this.rebuildModel();\n }\n private runTree: AgentRunTreeNode | null = null;\n\n public modes: FlowMode[] = [\n { key: 'subway', label: 'Subway Lines', icon: 'fa-train-subway', enabled: true },\n { key: 'constellation', label: 'Constellation', icon: 'fa-star', enabled: true },\n { key: 'flow', label: 'Flow', icon: 'fa-diagram-project', enabled: true },\n { key: 'flame', label: 'Flame Cascade', icon: 'fa-fire', enabled: true }\n ];\n public mode = 'subway';\n public model: FlowModel | null = null;\n public playing = false;\n public speed = 1;\n public loading = true;\n public hasData = false;\n /** Selected node detail (any mode). */\n public selectedStepItem: TimelineItem | null = null;\n private selectedNodeId = -1;\n private logRows = new Map<number, HTMLElement>();\n private lastActiveRowId = -1;\n\n /** The animated modes share the master clock + narration rail; Flow is static. */\n public get isAnimated(): boolean { return this.mode !== 'flow'; }\n /** Rail (now-executing + log tree) shows only for animated modes with nothing selected. */\n public get showRail(): boolean { return this.isAnimated && !this.selectedStepItem; }\n\n /** Right-panel width (rail / inspector), resizable + persisted per user. Default is 50px wider than the old fixed panel. */\n public panelWidth = 410;\n private readonly PANEL_KEY = 'mj.agentRunFlow.panelWidth.v1';\n private resizing = false;\n private resizeStartX = 0;\n private resizeStartW = 0;\n\n @ViewChild(FlameCascadeComponent) private flame?: FlameCascadeComponent;\n @ViewChild(SubwayLinesComponent) private subway?: SubwayLinesComponent;\n @ViewChild(ConstellationComponent) private constellation?: ConstellationComponent;\n @ViewChild(FlowchartComponent) private flowchart?: FlowchartComponent;\n\n @ViewChild('scrub') private scrubRef?: ElementRef<HTMLInputElement>;\n @ViewChild('clock') private clockRef?: ElementRef<HTMLElement>;\n @ViewChild('crumb') private crumbRef?: ElementRef<HTMLElement>;\n @ViewChild('nowIco') private nowIcoRef?: ElementRef<HTMLElement>;\n @ViewChild('nowName') private nowNameRef?: ElementRef<HTMLElement>;\n @ViewChild('nowType') private nowTypeRef?: ElementRef<HTMLElement>;\n @ViewChild('nowDur') private nowDurRef?: ElementRef<HTMLElement>;\n @ViewChild('nowModel') private nowModelRef?: ElementRef<HTMLElement>;\n @ViewChild('nowStat') private nowStatRef?: ElementRef<HTMLElement>;\n @ViewChild('nowBar') private nowBarRef?: ElementRef<HTMLElement>;\n @ViewChild('loglist') private loglistRef?: ElementRef<HTMLElement>;\n\n private destroy$ = new Subject<void>();\n private rafId: number | null = null;\n private p = 0;\n private lastTs = 0;\n private readonly PLAY_MS = 11000;\n private logModelRef: FlowModel | null = null;\n private lastLeafId = -1;\n private viewReady = false;\n\n private zone = inject(NgZone);\n private cdr = inject(ChangeDetectorRef);\n\n ngAfterViewInit(): void {\n this.viewReady = true;\n const savedW = UserInfoEngine.Instance.GetSetting(this.PANEL_KEY);\n if (savedW) { const n = +savedW; if (n >= 280) this.panelWidth = Math.min(n, this.maxPanelWidth()); }\n combineLatest([this.dataHelper.steps$, this.dataHelper.loading$])\n .pipe(takeUntil(this.destroy$))\n .subscribe(([steps, loading]) => {\n this.loading = loading && steps.length === 0;\n if (!loading || steps.length > 0) this.rebuildModel();\n this.cdr.markForCheck();\n });\n this.zone.runOutsideAngular(() => {\n this.rafId = requestAnimationFrame(ts => this.tick(ts));\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next(); this.destroy$.complete();\n if (this.rafId != null) cancelAnimationFrame(this.rafId);\n }\n\n private async rebuildModel(): Promise<void> {\n const wasEmpty = !this.model;\n await AIEngineBase.Instance.EnsureLoaded(); // agent icons/logos read synchronously during build\n const rootIcon = { iconClass: this.agentIconClass || 'fa-robot', logoUrl: this.agentLogoUrl };\n // The TREE is the source. It carries the run's steps AND any task-graph work those steps\n // submitted — which the step-row builder cannot see at all, because a workflow's steps live in\n // MJ: Tasks rather than in the run's step list. Falling back to the step builder when the tree\n // has not arrived keeps the view populated on first paint rather than flashing empty.\n const model = this.runTree\n ? buildFlowModelFromTree(this.runTree, this.agentName ?? '', this.runStatus, rootIcon)\n : await buildFlowModel(this.agentName ?? '', this.runStatus, rootIcon, this.dataHelper);\n if (!model) return;\n this.model = model;\n this.hasData = model.leaves.length > 0;\n if (wasEmpty) this.p = 0;\n this.lastLeafId = -1;\n this.cdr.markForCheck();\n }\n\n /* -------------------------------- transport ------------------------------- */\n\n public togglePlay(): void {\n if (!this.hasData) return;\n if (this.p >= 1) this.p = 0;\n this.playing = !this.playing;\n this.lastTs = 0;\n }\n\n public restart(): void {\n if (!this.hasData) return;\n this.p = 0; this.playing = true; this.lastTs = 0;\n this.lastLeafId = -1;\n }\n\n public onScrub(value: string): void {\n this.p = (+value) / 1000;\n this.playing = false;\n }\n\n public onSpeed(value: string): void { this.speed = (+value) / 100; }\n\n public selectMode(m: FlowMode): void {\n if (!m.enabled) return;\n this.mode = m.key;\n this.applyRendererSelection(this.selectedNodeId === -1 ? null : this.selectedNodeId);\n this.currentRenderer?.ReapplyView?.(); // ensure the now-visible renderer shows its OWN (per-type) zoom\n }\n\n private get currentRenderer(): { Render(p: number, ts: number): void; ZoomIn?(): void; ZoomOut?(): void; FitReset?(): void; ReapplyView?(): void } | undefined {\n switch (this.mode) {\n case 'flame': return this.flame;\n case 'subway': return this.subway;\n case 'constellation': return this.constellation;\n case 'flow': return this.flowchart;\n default: return undefined;\n }\n }\n\n /* --------------------------- zoom (shared toolbar) ------------------------ */\n\n public zoomIn(): void { this.currentRenderer?.ZoomIn?.(); }\n public zoomOut(): void { this.currentRenderer?.ZoomOut?.(); }\n public fitReset(): void { this.currentRenderer?.FitReset?.(); }\n\n /* ---------------------------- panel resize ------------------------------- */\n\n /** Cap the right panel at 75% of the viewport width. */\n private maxPanelWidth(): number { return Math.max(360, window.innerWidth * 0.75); }\n\n public startResize(e: MouseEvent): void {\n e.preventDefault();\n this.resizing = true;\n this.resizeStartX = e.clientX;\n this.resizeStartW = this.panelWidth;\n const move = (ev: MouseEvent) => {\n if (!this.resizing) return;\n const w = this.resizeStartW + (this.resizeStartX - ev.clientX); // drag left → wider\n this.panelWidth = Math.max(280, Math.min(this.maxPanelWidth(), w));\n this.cdr.markForCheck();\n };\n const up = () => {\n this.resizing = false;\n window.removeEventListener('mousemove', move);\n window.removeEventListener('mouseup', up);\n UserInfoEngine.Instance.SetSettingDebounced(this.PANEL_KEY, String(Math.round(this.panelWidth)));\n };\n window.addEventListener('mousemove', move);\n window.addEventListener('mouseup', up);\n }\n\n /* -------------------------------- selection ------------------------------ */\n\n /** A node was clicked in any renderer (or a log row) — highlight it everywhere and show its detail. */\n public selectStep(n: FlowNode): void {\n this.zone.run(() => {\n this.selectedNodeId = n.id;\n this.selectedStepItem = this.toTimelineItem(n);\n this.cdr.markForCheck();\n });\n this.applyRendererSelection(n.id);\n }\n\n public closeDetail(): void {\n this.zone.run(() => { this.selectedStepItem = null; this.selectedNodeId = -1; this.cdr.markForCheck(); });\n this.applyRendererSelection(null);\n this.flowchart?.Deselect();\n }\n\n private applyRendererSelection(id: number | null): void {\n this.flame?.SetSelected(id);\n this.subway?.SetSelected(id);\n this.constellation?.SetSelected(id);\n }\n\n public onDetailNavigateActionLog(logId: string): void {\n SharedService.Instance.OpenEntityRecord('MJ: Action Execution Logs', CompositeKey.FromID(logId));\n }\n\n public async onDetailCopy(text: string): Promise<void> {\n try { await navigator.clipboard.writeText(text); } catch { /* clipboard unavailable */ }\n }\n\n private toTimelineItem(n: FlowNode): TimelineItem | null {\n if (!n.raw) return null;\n return {\n id: n.raw.ID, type: 'step', title: n.name, subtitle: `Type: ${n.raw.StepType}`,\n status: n.status, startTime: n.raw.StartedAt, endTime: n.raw.CompletedAt || undefined,\n duration: formatDuration(n.realDur), icon: 'fa-circle', color: '', data: n.raw, level: n.depth\n };\n }\n\n /* ------------------------------- master loop ------------------------------ */\n\n private tick(ts: number): void {\n const animated = this.isAnimated;\n if (animated && this.playing && this.hasData) {\n if (!this.lastTs) this.lastTs = ts;\n const dt = ts - this.lastTs; this.lastTs = ts;\n this.p += dt / (this.PLAY_MS / this.speed);\n if (this.p >= 1) { this.p = 1; this.playing = false; this.zone.run(() => this.cdr.markForCheck()); }\n } else {\n this.lastTs = 0;\n }\n if (this.viewReady && this.model && this.hasData) {\n if (animated) {\n this.currentRenderer?.Render(this.p, ts);\n this.updateRail(ts);\n } else {\n // Flow (static): just ensure the flowchart is built; no clock.\n this.flowchart?.Render(0, ts);\n }\n }\n this.rafId = requestAnimationFrame(t => this.tick(t));\n }\n\n /* ------------------------------ narration rail ---------------------------- */\n\n private updateRail(_ts: number): void {\n const m = this.model!;\n\n // (Re)populate the imperative rail content whenever the rail DOM is fresh\n // (the @if remounted it with template defaults) or the model changed. Without\n // this, a remount at run-completion leaves an empty log + a blank now-card.\n if (this.loglistRef &&\n (this.logModelRef !== m || (this.loglistRef.nativeElement.childElementCount === 0 && m.nodes.length > 1))) {\n this.buildLogTree();\n this.logModelRef = m;\n this.lastLeafId = -1; // force the now-card to repopulate the fresh DOM\n }\n\n const leaf = activeLeaf(m, this.p);\n const prog = this.p >= leaf.t1 ? 1 : Math.max(0, (this.p - leaf.t0) / (leaf.t1 - leaf.t0));\n\n if (this.scrubRef) this.scrubRef.nativeElement.value = String(Math.round(this.p * 1000));\n if (this.clockRef) {\n const realT = this.p >= 1 ? m.total : leaf.r0 + prog * leaf.realDur;\n this.clockRef.nativeElement.textContent = `${formatDuration(realT)} / ${formatDuration(m.total)}`;\n }\n if (this.nowBarRef) this.nowBarRef.nativeElement.style.width = `${prog * 100}%`;\n\n if (leaf.id !== this.lastLeafId) {\n this.lastLeafId = leaf.id;\n this.refreshNowCard(leaf);\n }\n if (this.nowStatRef) {\n this.nowStatRef.nativeElement.textContent = this.p >= 1 ? 'done' : (this.p > leaf.t0 ? 'running' : 'starting');\n }\n if (this.loglistRef) this.updateLogTree();\n }\n\n private refreshNowCard(leaf: FlowNode): void {\n const col = FLOW_COLORS[leaf.type];\n if (this.nowIcoRef) this.nowIcoRef.nativeElement.textContent = FLOW_EMOJI[leaf.type];\n if (this.nowNameRef) this.nowNameRef.nativeElement.textContent = leaf.name;\n if (this.nowTypeRef) {\n this.nowTypeRef.nativeElement.textContent = FLOW_LABEL[leaf.type];\n this.nowTypeRef.nativeElement.style.color = col;\n }\n if (this.nowDurRef) this.nowDurRef.nativeElement.textContent = formatDuration(leaf.realDur);\n if (this.nowModelRef) this.nowModelRef.nativeElement.textContent = leaf.model ?? '—';\n if (this.crumbRef) {\n const chain = ancestors(leaf);\n this.crumbRef.nativeElement.innerHTML = chain.map((n, i) =>\n `${i ? '<span class=\"sep\">›</span>' : ''}<span style=\"color:${FLOW_COLORS[n.type]}\">${FLOW_EMOJI[n.type]} ${this.escape(n.name)}</span>`\n ).join('');\n }\n }\n\n /* ------------------------------ log tree (rail) --------------------------- */\n\n /** Build a clickable indented tree of every step, mirroring the run hierarchy. */\n private buildLogTree(): void {\n const list = this.loglistRef!.nativeElement;\n list.innerHTML = '';\n this.logRows.clear();\n this.lastActiveRowId = -1;\n const m = this.model!;\n for (const n of m.nodes) {\n if (n.depth === 0) continue; // skip the synthetic root (it's the header)\n const col = FLOW_COLORS[n.type];\n const row = document.createElement('div');\n row.className = 'ftree-row';\n row.style.paddingLeft = `${6 + (n.depth - 1) * 15}px`;\n const ico = n.logoUrl\n ? `<img class=\"ftree-logo\" src=\"${this.escape(n.logoUrl)}\" alt=\"\"/>`\n : `<i class=\"ftree-ico fa-solid ${this.escape(n.iconClass)}\" style=\"color:${col}\"></i>`;\n row.innerHTML = ico +\n `<span class=\"ftree-name\">${this.escape(shortLabel(n))}</span>` +\n `<span class=\"ftree-dur\">${formatDuration(n.realDur)}</span>`;\n row.addEventListener('click', () => this.selectStep(n));\n list.appendChild(row);\n this.logRows.set(n.id, row);\n }\n }\n\n /** Sync each log row's state (pending / running / done / selected) with the clock. */\n private updateLogTree(): void {\n const m = this.model!;\n for (const n of m.nodes) {\n if (n.depth === 0) continue;\n const row = this.logRows.get(n.id);\n if (!row) continue;\n const started = this.p >= n.t0;\n const active = started && this.p < n.t1;\n row.classList.toggle('ftree-pending', !started);\n row.classList.toggle('ftree-active', active);\n row.classList.toggle('ftree-done', this.p >= n.t1);\n row.classList.toggle('ftree-selected', n.id === this.selectedNodeId);\n if (active && n.id !== this.lastActiveRowId && !n.children.length) {\n this.lastActiveRowId = n.id;\n row.scrollIntoView({ block: 'nearest' });\n }\n }\n }\n\n private escape(s: string): string {\n return s.replace(/[&<>\"]/g, c => ({ '&': '&', '<': '<', '>': '>', '\"': '"' }[c] ?? c));\n }\n}\n","<div class=\"flow-cockpit\">\n <!-- mode segmented control -->\n <div class=\"flow-modes\">\n @for (m of modes; track m.key) {\n <button class=\"flow-mode\" [class.on]=\"mode === m.key\" [class.soon]=\"!m.enabled\"\n [disabled]=\"!m.enabled\" (click)=\"selectMode(m)\"\n [title]=\"m.enabled ? m.label : m.label + ' — coming soon'\">\n <i class=\"fas\" [ngClass]=\"m.icon\"></i>\n <span>{{ m.label }}</span>\n @if (!m.enabled) { <span class=\"soon-tag\">Soon</span> }\n </button>\n }\n </div>\n\n <div class=\"flow-main\">\n <!-- stage -->\n <div class=\"flow-stage\">\n @if (loading) {\n <div class=\"flow-overlay\"><mj-loading text=\"Building flow…\"></mj-loading></div>\n } @else if (!hasData) {\n <div class=\"flow-overlay flow-empty\">\n <i class=\"fas fa-wind\"></i>\n <p>No steps recorded for this run yet.</p>\n </div>\n }\n\n <mj-agent-flow-flame [class.flow-hidden]=\"mode !== 'flame'\" [Model]=\"model\" (nodeSelected)=\"selectStep($event)\"></mj-agent-flow-flame>\n <mj-agent-flow-subway [class.flow-hidden]=\"mode !== 'subway'\" [Model]=\"model\" (nodeSelected)=\"selectStep($event)\"></mj-agent-flow-subway>\n <mj-agent-flow-constellation [class.flow-hidden]=\"mode !== 'constellation'\" [Model]=\"model\" (nodeSelected)=\"selectStep($event)\"></mj-agent-flow-constellation>\n <mj-agent-flow-flowchart [class.flow-hidden]=\"mode !== 'flow'\" [Model]=\"model\"\n (nodeSelected)=\"selectStep($event)\"\n (selectionCleared)=\"closeDetail()\"></mj-agent-flow-flowchart>\n\n @if (hasData) {\n <div class=\"flow-zoom\">\n <button class=\"fz-btn\" (click)=\"zoomIn()\" title=\"Zoom in\"><i class=\"fas fa-magnifying-glass-plus\"></i></button>\n <button class=\"fz-btn\" (click)=\"zoomOut()\" title=\"Zoom out\"><i class=\"fas fa-magnifying-glass-minus\"></i></button>\n <button class=\"fz-btn\" (click)=\"fitReset()\" title=\"Fit to view\"><i class=\"fas fa-expand\"></i></button>\n </div>\n }\n </div>\n\n <!-- narration rail (animated modes, nothing selected) -->\n @if (showRail) {\n <aside class=\"flow-rail\" [style.width.px]=\"panelWidth\">\n <div class=\"flow-resizer\" (mousedown)=\"startResize($event)\" title=\"Drag to resize\"></div>\n <div class=\"now\">\n <div class=\"rail-lbl\">Now executing</div>\n <div class=\"breadcrumb\" #crumb></div>\n <div class=\"nowcard\">\n <div class=\"ico\" #nowIco>🤖</div>\n <h3 #nowName>—</h3>\n <div class=\"type\" #nowType>Agent run</div>\n <div class=\"meta\">\n <div>Duration<b #nowDur>—</b></div>\n <div>Status<b #nowStat>—</b></div>\n <div>Model<b #nowModel>—</b></div>\n </div>\n <div class=\"barbg\"><div class=\"barfg\" #nowBar></div></div>\n </div>\n </div>\n <div class=\"log\">\n <div class=\"rail-lbl sticky\">Execution log</div>\n <div #loglist class=\"loglist\"></div>\n </div>\n </aside>\n }\n\n <!-- step inspector (any mode) -->\n @if (selectedStepItem) {\n <aside class=\"flow-detail\" [style.width.px]=\"panelWidth\">\n <div class=\"flow-resizer\" (mousedown)=\"startResize($event)\" title=\"Drag to resize\"></div>\n <mj-ai-agent-run-step-detail\n [selectedTimelineItem]=\"selectedStepItem\"\n (closePanel)=\"closeDetail()\"\n (navigateToActionLog)=\"onDetailNavigateActionLog($event)\"\n (copyToClipboard)=\"onDetailCopy($event)\">\n </mj-ai-agent-run-step-detail>\n </aside>\n }\n </div>\n\n <!-- transport (animated modes only) -->\n @if (isAnimated) {\n <div class=\"flow-transport\">\n <button class=\"pbtn\" (click)=\"togglePlay()\" [disabled]=\"!hasData\" [title]=\"playing ? 'Pause' : 'Play'\">\n <i class=\"fas\" [ngClass]=\"playing ? 'fa-pause' : 'fa-play'\"></i>\n </button>\n <button class=\"ibtn\" (click)=\"restart()\" [disabled]=\"!hasData\" title=\"Restart\">\n <i class=\"fas fa-rotate-left\"></i>\n </button>\n <input #scrub class=\"scrub\" type=\"range\" min=\"0\" max=\"1000\" value=\"0\"\n [disabled]=\"!hasData\" (input)=\"onScrub(scrub.value)\"/>\n <div class=\"clock\" #clock>0s / 0s</div>\n <div class=\"speedbox\">\n <i class=\"fas fa-gauge-high\"></i>\n <input class=\"speed\" type=\"range\" min=\"25\" max=\"300\" value=\"100\" (input)=\"onSpeed($any($event.target).value)\"/>\n <span class=\"spdval\">{{ speed.toFixed(1) }}×</span>\n </div>\n </div>\n }\n\n <!-- legend / hint -->\n <div class=\"flow-legend\">\n @if (isAnimated) {\n <span><i class=\"lg\" style=\"background: var(--mj-text-muted)\"></i>Hint:</span>\n <span class=\"legend-note\">Playback is compressed so every step is visible — real duration shows through heat, size & speed, not literal width.</span>\n } @else {\n <span><i class=\"lg\" style=\"background: var(--mj-text-muted)\"></i>Tip:</span>\n <span class=\"legend-note\">Drag to pan, scroll to zoom, click any node to inspect it. Layout is the full execution tree, top to bottom.</span>\n }\n </div>\n</div>\n"]}
|
|
@@ -43,8 +43,19 @@ export interface FlowNode {
|
|
|
43
43
|
heat: 0 | 1 | 2 | 3;
|
|
44
44
|
parent: FlowNode | null;
|
|
45
45
|
children: FlowNode[];
|
|
46
|
-
/** Underlying step entity (null for the synthetic root
|
|
46
|
+
/** Underlying step entity (null for the synthetic root, and for task-graph nodes). */
|
|
47
47
|
raw: MJAIAgentRunStepEntity | null;
|
|
48
|
+
/**
|
|
49
|
+
* Which record this node came from, whatever entity that is.
|
|
50
|
+
*
|
|
51
|
+
* `raw` is typed to a run STEP, so a workflow's steps — which are `MJ: Tasks` rows — could never
|
|
52
|
+
* be represented by it. This generic reference is what lets one model hold both, and what lets a
|
|
53
|
+
* click open the right record either way.
|
|
54
|
+
*/
|
|
55
|
+
source?: {
|
|
56
|
+
entity: string;
|
|
57
|
+
id: string;
|
|
58
|
+
} | null;
|
|
48
59
|
/** Font Awesome class (e.g. 'fa-brain'); sub-agents resolve their agent's icon. */
|
|
49
60
|
iconClass: string;
|
|
50
61
|
/** Agent logo image URL when available (sub-agents / root), else null. */
|
|
@@ -70,6 +81,15 @@ export declare const FLOW_LABEL: Record<FlowNodeType, string>;
|
|
|
70
81
|
* view shows the entire run at once.
|
|
71
82
|
*/
|
|
72
83
|
export declare function buildFlowModel(rootName: string, rootStatus: string, rootIcon: RootIcon, helper: AIAgentRunDataHelper): Promise<FlowModel>;
|
|
84
|
+
/**
|
|
85
|
+
* Durations, playback window, wall-clock and heat — the normalization every FlowModel shares.
|
|
86
|
+
*
|
|
87
|
+
* Extracted so a model built from the run TREE goes through the identical pipeline as one built
|
|
88
|
+
* from raw step rows. Re-deriving any of it in a second builder is how the two sources would drift
|
|
89
|
+
* into looking like different products — different bar widths, different heat thresholds — for the
|
|
90
|
+
* same run.
|
|
91
|
+
*/
|
|
92
|
+
export declare function finalizeFlowModel(root: FlowNode): FlowModel;
|
|
73
93
|
export declare function activeLeaf(model: FlowModel, p: number): FlowNode;
|
|
74
94
|
export declare function ancestors(n: FlowNode): FlowNode[];
|
|
75
95
|
export declare function agentOf(n: FlowNode): FlowNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-run-flow.model.d.ts","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAuB,MAAM,+BAA+B,CAAC;AAG5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,6EAA6E;AAC7E,MAAM,WAAW,QAAQ;IAAG,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAAE;AAExE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,YAAY,GACpB,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC;AAE9F,MAAM,WAAW,QAAQ;IACvB,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"agent-run-flow.model.d.ts","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAuB,MAAM,+BAA+B,CAAC;AAG5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,EAAE,QAAQ,GAAG,MAAM,CAQ9C;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKtD"}
|
|
@@ -162,6 +162,17 @@ export async function buildFlowModel(rootName, rootStatus, rootIcon, helper) {
|
|
|
162
162
|
if (steps.length) {
|
|
163
163
|
await attachStepTree(root, steps, promptRuns, helper);
|
|
164
164
|
}
|
|
165
|
+
return finalizeFlowModel(root);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Durations, playback window, wall-clock and heat — the normalization every FlowModel shares.
|
|
169
|
+
*
|
|
170
|
+
* Extracted so a model built from the run TREE goes through the identical pipeline as one built
|
|
171
|
+
* from raw step rows. Re-deriving any of it in a second builder is how the two sources would drift
|
|
172
|
+
* into looking like different products — different bar widths, different heat thresholds — for the
|
|
173
|
+
* same run.
|
|
174
|
+
*/
|
|
175
|
+
export function finalizeFlowModel(root) {
|
|
165
176
|
calcDur(root);
|
|
166
177
|
assignT(root, 0, 1);
|
|
167
178
|
assignReal(root, 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-run-flow.model.js","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA+D9D,2FAA2F;AAC3F,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS;IAC3E,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS;CAC9E,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAiC;IACtD,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,E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AI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;AAChF,CAAC","sourcesContent":["import { MJAIAgentRunStepEntity, MJAIPromptRunEntity } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { AIAgentRunDataHelper } from '../ai-agent-run-data.service';\n\n/** Root-agent icon, resolved by the caller from the run's agent metadata. */\nexport interface RootIcon { iconClass: string; logoUrl: string | null; }\n\n/**\n * Shared, framework-agnostic flow model for the Agent Run \"Flow\" visualizations.\n *\n * One adapter (`buildFlowModel`) turns the raw step / sub-run / prompt-run data\n * from {@link AIAgentRunDataHelper} into a normalized {@link FlowNode} tree that\n * every renderer (Flame Cascade, Subway Lines, Constellation, …) consumes.\n *\n * Two clocks are baked into each node:\n * - **playback time** (`t0`/`t1`, range 0..1): compressed so every step gets\n * visible airtime regardless of real duration. This is what the scrubber drives.\n * - **real time** (`r0`/`r1`, seconds): the true cumulative wall-clock, used for\n * the digital clock readout and the narration rail.\n *\n * True duration is therefore never encoded as literal playback width — renderers\n * surface it through a *visual* channel (heat glow, node size, sweep speed).\n */\nexport type FlowNodeType =\n | 'agent' | 'subagent' | 'prompt' | 'action' | 'decision' | 'loop' | 'validation' | 'other';\n\nexport interface FlowNode {\n /** Stable index within the flattened model (renderer scratch keys off this). */\n id: number;\n name: string;\n type: FlowNodeType;\n status: string;\n model: string | null;\n /** Real duration in seconds (container nodes = sum of children). */\n realDur: number;\n /** Normalized playback window [0..1]. */\n t0: number;\n t1: number;\n tmid: number;\n /** Real cumulative wall-clock window in seconds. */\n r0: number;\n r1: number;\n depth: number;\n /** Relative heat tier 0..3 (3 = among the longest steps in this run). */\n heat: 0 | 1 | 2 | 3;\n parent: FlowNode | null;\n children: FlowNode[];\n /** Underlying step entity (null for the synthetic root). Enables click-through. */\n raw: MJAIAgentRunStepEntity | null;\n /** Font Awesome class (e.g. 'fa-brain'); sub-agents resolve their agent's icon. */\n iconClass: string;\n /** Agent logo image URL when available (sub-agents / root), else null. */\n logoUrl: string | null;\n}\n\nexport interface FlowModel {\n root: FlowNode;\n nodes: FlowNode[];\n leaves: FlowNode[];\n total: number;\n maxDepth: number;\n maxLeafDur: number;\n}\n\n/** Categorical data-visualization palette (per CLAUDE.md, chart colors may be literal). */\nexport const FLOW_COLORS: Record<FlowNodeType, string> = {\n agent: '#11a8e6', subagent: '#f59e0b', prompt: '#3b82f6', action: '#22c55e',\n decision: '#ef4444', loop: '#a855f7', validation: '#14b8a6', other: '#94a3b8'\n};\n\nexport const FLOW_EMOJI: Record<FlowNodeType, string> = {\n agent: '🤖', subagent: '🤖', prompt: '💬', action: '⚙️',\n decision: '🔀', loop: '🔁', validation: '✓', other: '•'\n};\n\n/** Font Awesome icon per type — mirrors the Timeline's step icons. */\nexport const FLOW_ICON: Record<FlowNodeType, string> = {\n agent: 'fa-robot', subagent: 'fa-robot', prompt: 'fa-brain', action: 'fa-wrench',\n decision: 'fa-code-branch', loop: 'fa-repeat', validation: 'fa-square-check', other: 'fa-circle'\n};\n\nexport const FLOW_LABEL: Record<FlowNodeType, string> = {\n agent: 'Agent run', subagent: 'Sub-agent', prompt: 'Prompt', action: 'Action',\n decision: 'Decision', loop: 'Loop', validation: 'Validation', other: 'Step'\n};\n\nfunction flowType(stepType: string | null | undefined): FlowNodeType {\n switch (stepType) {\n case 'Prompt': return 'prompt';\n case 'Actions':\n case 'Tool': return 'action';\n case 'Sub-Agent': return 'subagent';\n case 'Decision': return 'decision';\n case 'ForEach':\n case 'While': return 'loop';\n case 'Validation': return 'validation';\n default: return 'other';\n }\n}\n\n/** Compression curve: longer steps still get more airtime, but sub-linearly. */\nfunction comp(d: number): number { return Math.pow(Math.max(d, 0.001), 0.55); }\n\nfunction durationSeconds(start: Date | null | undefined, end: Date | null | undefined): number {\n if (!start) return 0.1;\n const s = new Date(start).getTime();\n const e = end ? new Date(end).getTime() : Date.now();\n return Math.max(0.05, (e - s) / 1000);\n}\n\n/** Resolve a step's icon: sub-agents use their agent's logo/icon, else the type icon. */\nfunction stepIcon(step: MJAIAgentRunStepEntity, type: FlowNodeType): { iconClass: string; logoUrl: string | null } {\n if (step.StepType === 'Sub-Agent' && step.TargetID) {\n const agent = AIEngineBase.Instance.Agents.find(a => UUIDsEqual(a.ID, step.TargetID!));\n if (agent?.LogoURL) return { iconClass: 'fa-robot', logoUrl: agent.LogoURL };\n if (agent?.IconClass) return { iconClass: agent.IconClass, logoUrl: null };\n }\n return { iconClass: FLOW_ICON[type], logoUrl: null };\n}\n\nfunction makeStepNode(step: MJAIAgentRunStepEntity, promptRuns: MJAIPromptRunEntity[]): FlowNode {\n const type = flowType(step.StepType);\n let model: string | null = null;\n if (type === 'prompt' && step.TargetLogID) {\n const pr = promptRuns.find(p => UUIDsEqual(p.ID, step.TargetLogID!));\n model = pr?.Model ?? null;\n }\n const icon = stepIcon(step, type);\n return {\n id: -1, name: step.StepName || `Step ${step.StepNumber}`, type, status: step.Status,\n model, realDur: durationSeconds(step.StartedAt, step.CompletedAt),\n t0: 0, t1: 0, tmid: 0, r0: 0, r1: 0, depth: 0, heat: 0,\n parent: null, children: [], raw: step, iconClass: icon.iconClass, logoUrl: icon.logoUrl\n };\n}\n\n/**\n * Recursively attach a level of steps to `parent`, nesting both loop bodies\n * (`ParentID`) and sub-agent runs (`Sub-Agent` step → its own run's steps).\n */\nasync function attachStepTree(\n parent: FlowNode,\n steps: MJAIAgentRunStepEntity[],\n promptRuns: MJAIPromptRunEntity[],\n helper: AIAgentRunDataHelper\n): Promise<void> {\n const byId = new Map<string, FlowNode>();\n steps.forEach(s => byId.set(s.ID, makeStepNode(s, promptRuns)));\n\n // Nest loop bodies via ParentID; everything else hangs off `parent`.\n for (const s of steps) {\n const node = byId.get(s.ID)!;\n if (s.ParentID && byId.has(s.ParentID)) {\n const par = byId.get(s.ParentID)!;\n node.parent = par; par.children.push(node);\n } else {\n node.parent = parent; parent.children.push(node);\n }\n }\n\n // Recurse into sub-agent steps (their child steps need a separate load).\n for (const s of steps) {\n if (s.StepType === 'Sub-Agent' && s.TargetLogID) {\n const node = byId.get(s.ID)!;\n try {\n const sub = await helper.loadSubAgentData(s.TargetLogID);\n if (sub.steps?.length) {\n await attachStepTree(node, sub.steps, sub.promptRuns, helper);\n }\n } catch {\n // Sub-agent load failed — leave it as a leaf with its own timing.\n }\n }\n }\n}\n\nfunction calcDur(n: FlowNode): number {\n if (n.children.length) n.realDur = n.children.reduce((s, c) => s + calcDur(c), 0);\n return n.realDur;\n}\n\nfunction assignT(n: FlowNode, t0: number, t1: number): void {\n n.t0 = t0; n.t1 = t1; n.tmid = (t0 + t1) / 2;\n if (n.children.length) {\n const tot = n.children.reduce((s, c) => s + comp(c.realDur), 0) || 1;\n let cur = t0;\n for (const c of n.children) {\n const w = (t1 - t0) * comp(c.realDur) / tot;\n assignT(c, cur, cur + w); cur += w;\n }\n }\n}\n\nfunction assignReal(n: FlowNode, r0: number): number {\n n.r0 = r0;\n if (n.children.length) {\n let cur = r0;\n for (const c of n.children) { assignReal(c, cur); cur = c.r1; }\n n.r1 = cur;\n } else {\n n.r1 = r0 + n.realDur;\n }\n return n.r1;\n}\n\nfunction flatten(n: FlowNode, depth: number, out: FlowNode[]): void {\n n.depth = depth; n.id = out.length; out.push(n);\n n.children.forEach(c => flatten(c, depth + 1, out));\n}\n\nfunction heatTier(d: number, maxLeaf: number): 0 | 1 | 2 | 3 {\n const r = d / (maxLeaf || 1);\n return r >= 0.66 ? 3 : r >= 0.33 ? 2 : r >= 0.12 ? 1 : 0;\n}\n\n/**\n * Build the full normalized flow model for an agent run. Eagerly walks the whole\n * sub-agent tree (via the helper's cached `loadSubAgentData`) so the zoomed-out\n * view shows the entire run at once.\n */\nexport async function buildFlowModel(\n rootName: string,\n rootStatus: string,\n rootIcon: RootIcon,\n helper: AIAgentRunDataHelper\n): Promise<FlowModel> {\n const { steps, promptRuns } = helper.getCurrentData();\n\n const root: FlowNode = {\n id: -1, name: rootName || 'Agent run', type: 'agent', status: rootStatus,\n model: null, realDur: 0, t0: 0, t1: 1, tmid: 0.5, r0: 0, r1: 0, depth: 0, heat: 0,\n parent: null, children: [], raw: null,\n iconClass: rootIcon.iconClass || 'fa-robot', logoUrl: rootIcon.logoUrl\n };\n\n if (steps.length) {\n await attachStepTree(root, steps, promptRuns, helper);\n }\n\n calcDur(root);\n assignT(root, 0, 1);\n assignReal(root, 0);\n\n const nodes: FlowNode[] = [];\n flatten(root, 0, nodes);\n nodes.forEach(n => { n.tmid = (n.t0 + n.t1) / 2; });\n\n const leaves = nodes.filter(n => n.children.length === 0).sort((a, b) => a.t0 - b.t0);\n const maxLeafDur = Math.max(0.001, ...leaves.map(n => n.realDur));\n nodes.forEach(n => { n.heat = heatTier(n.realDur, maxLeafDur); });\n\n return {\n root, nodes, leaves, total: root.realDur,\n maxDepth: Math.max(0, ...nodes.map(n => n.depth)), maxLeafDur\n };\n}\n\n/* ----------------------------- shared lookups ----------------------------- */\n\nexport function activeLeaf(model: FlowModel, p: number): FlowNode {\n const L = model.leaves;\n if (!L.length) return model.root;\n if (p <= 0) return L[0];\n if (p >= 1) return L[L.length - 1];\n return L.find(l => p >= l.t0 && p < l.t1) ?? L[L.length - 1];\n}\n\nexport function ancestors(n: FlowNode): FlowNode[] {\n const out: FlowNode[] = []; let c: FlowNode | null = n;\n while (c) { out.unshift(c); c = c.parent; }\n return out;\n}\n\nexport function agentOf(n: FlowNode): FlowNode {\n let c = n.parent;\n while (c) { if (c.type === 'agent' || c.type === 'subagent') return c; c = c.parent; }\n return n;\n}\n\n/** \"Execute Sub-Agent: Query Strategist\" → \"Query Strategist\". */\nexport function agentShortName(a: FlowNode): string {\n const i = a.name.indexOf(': ');\n return i >= 0 ? a.name.slice(i + 2) : a.name;\n}\n\n/**\n * Label with the owning agent's prefix stripped — child step names tend to be\n * \"Query Strategist: Execute Agent Prompt\"; on a view that already shows which\n * agent/line a node belongs to, the prefix is pure noise that causes overlap.\n */\nexport function displayName(n: FlowNode): string {\n const a = agentOf(n);\n if (a && a !== n) {\n const short = agentShortName(a);\n if (short && n.name.startsWith(short + ':')) return n.name.slice(short.length + 1).trim();\n }\n return n.name;\n}\n\n/**\n * Aggressively abbreviated label for tight surfaces (subway stations, flame bars,\n * stars). Strips the agent prefix, then collapses the verbose MJ step phrasing:\n * \"Execute Sub-Agent: Query Strategist\" → \"Query Strategist Sub-Agent\"\n * \"Execute Agent Prompt\" → \"Prompt\"\n * \"Execute Action: Search Query Catalog\"→ \"Search Query Catalog\"\n * \"Agent Validation\" → \"Validation\"\n */\nexport function shortLabel(n: FlowNode): string {\n if (n.type === 'subagent') return `${agentShortName(n)} Sub-Agent`;\n let s = displayName(n);\n s = s.replace(/^Execute Action:\\s*/i, '').replace(/^Execute Sub-Agent:\\s*/i, '');\n if (/^Execute Agent Prompt$/i.test(s)) s = 'Prompt';\n else if (/^Agent Validation$/i.test(s)) s = 'Validation';\n else if (/^Data Source Preloading$/i.test(s)) s = 'Data Preload';\n return s;\n}\n\nexport function formatDuration(seconds: number): string {\n if (seconds < 1) return `${Math.round(seconds * 1000)}ms`;\n if (seconds < 60) return `${seconds < 10 ? seconds.toFixed(1) : Math.round(seconds)}s`;\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m ${Math.round(seconds % 60)}s`;\n return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agent-run-flow.model.js","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/agent-run-flow.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAuE9D,2FAA2F;AAC3F,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,KAAK,EAAE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AAI,CAAC,IAAI,CAAC;IAC1D,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IACvF,IAAI,OAAO,GAAG,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC;IACvF,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;AAChF,CAAC","sourcesContent":["import { MJAIAgentRunStepEntity, MJAIPromptRunEntity } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { AIAgentRunDataHelper } from '../ai-agent-run-data.service';\n\n/** Root-agent icon, resolved by the caller from the run's agent metadata. */\nexport interface RootIcon { iconClass: string; logoUrl: string | null; }\n\n/**\n * Shared, framework-agnostic flow model for the Agent Run \"Flow\" visualizations.\n *\n * One adapter (`buildFlowModel`) turns the raw step / sub-run / prompt-run data\n * from {@link AIAgentRunDataHelper} into a normalized {@link FlowNode} tree that\n * every renderer (Flame Cascade, Subway Lines, Constellation, …) consumes.\n *\n * Two clocks are baked into each node:\n * - **playback time** (`t0`/`t1`, range 0..1): compressed so every step gets\n * visible airtime regardless of real duration. This is what the scrubber drives.\n * - **real time** (`r0`/`r1`, seconds): the true cumulative wall-clock, used for\n * the digital clock readout and the narration rail.\n *\n * True duration is therefore never encoded as literal playback width — renderers\n * surface it through a *visual* channel (heat glow, node size, sweep speed).\n */\nexport type FlowNodeType =\n | 'agent' | 'subagent' | 'prompt' | 'action' | 'decision' | 'loop' | 'validation' | 'other';\n\nexport interface FlowNode {\n /** Stable index within the flattened model (renderer scratch keys off this). */\n id: number;\n name: string;\n type: FlowNodeType;\n status: string;\n model: string | null;\n /** Real duration in seconds (container nodes = sum of children). */\n realDur: number;\n /** Normalized playback window [0..1]. */\n t0: number;\n t1: number;\n tmid: number;\n /** Real cumulative wall-clock window in seconds. */\n r0: number;\n r1: number;\n depth: number;\n /** Relative heat tier 0..3 (3 = among the longest steps in this run). */\n heat: 0 | 1 | 2 | 3;\n parent: FlowNode | null;\n children: FlowNode[];\n /** Underlying step entity (null for the synthetic root, and for task-graph nodes). */\n raw: MJAIAgentRunStepEntity | null;\n /**\n * Which record this node came from, whatever entity that is.\n *\n * `raw` is typed to a run STEP, so a workflow's steps — which are `MJ: Tasks` rows — could never\n * be represented by it. This generic reference is what lets one model hold both, and what lets a\n * click open the right record either way.\n */\n source?: { entity: string; id: string } | null;\n /** Font Awesome class (e.g. 'fa-brain'); sub-agents resolve their agent's icon. */\n iconClass: string;\n /** Agent logo image URL when available (sub-agents / root), else null. */\n logoUrl: string | null;\n}\n\nexport interface FlowModel {\n root: FlowNode;\n nodes: FlowNode[];\n leaves: FlowNode[];\n total: number;\n maxDepth: number;\n maxLeafDur: number;\n}\n\n/** Categorical data-visualization palette (per CLAUDE.md, chart colors may be literal). */\nexport const FLOW_COLORS: Record<FlowNodeType, string> = {\n agent: '#11a8e6', subagent: '#f59e0b', prompt: '#3b82f6', action: '#22c55e',\n decision: '#ef4444', loop: '#a855f7', validation: '#14b8a6', other: '#94a3b8'\n};\n\nexport const FLOW_EMOJI: Record<FlowNodeType, string> = {\n agent: '🤖', subagent: '🤖', prompt: '💬', action: '⚙️',\n decision: '🔀', loop: '🔁', validation: '✓', other: '•'\n};\n\n/** Font Awesome icon per type — mirrors the Timeline's step icons. */\nexport const FLOW_ICON: Record<FlowNodeType, string> = {\n agent: 'fa-robot', subagent: 'fa-robot', prompt: 'fa-brain', action: 'fa-wrench',\n decision: 'fa-code-branch', loop: 'fa-repeat', validation: 'fa-square-check', other: 'fa-circle'\n};\n\nexport const FLOW_LABEL: Record<FlowNodeType, string> = {\n agent: 'Agent run', subagent: 'Sub-agent', prompt: 'Prompt', action: 'Action',\n decision: 'Decision', loop: 'Loop', validation: 'Validation', other: 'Step'\n};\n\nfunction flowType(stepType: string | null | undefined): FlowNodeType {\n switch (stepType) {\n case 'Prompt': return 'prompt';\n case 'Actions':\n case 'Tool': return 'action';\n case 'Sub-Agent': return 'subagent';\n case 'Decision': return 'decision';\n case 'ForEach':\n case 'While': return 'loop';\n case 'Validation': return 'validation';\n default: return 'other';\n }\n}\n\n/** Compression curve: longer steps still get more airtime, but sub-linearly. */\nfunction comp(d: number): number { return Math.pow(Math.max(d, 0.001), 0.55); }\n\nfunction durationSeconds(start: Date | null | undefined, end: Date | null | undefined): number {\n if (!start) return 0.1;\n const s = new Date(start).getTime();\n const e = end ? new Date(end).getTime() : Date.now();\n return Math.max(0.05, (e - s) / 1000);\n}\n\n/** Resolve a step's icon: sub-agents use their agent's logo/icon, else the type icon. */\nfunction stepIcon(step: MJAIAgentRunStepEntity, type: FlowNodeType): { iconClass: string; logoUrl: string | null } {\n if (step.StepType === 'Sub-Agent' && step.TargetID) {\n const agent = AIEngineBase.Instance.Agents.find(a => UUIDsEqual(a.ID, step.TargetID!));\n if (agent?.LogoURL) return { iconClass: 'fa-robot', logoUrl: agent.LogoURL };\n if (agent?.IconClass) return { iconClass: agent.IconClass, logoUrl: null };\n }\n return { iconClass: FLOW_ICON[type], logoUrl: null };\n}\n\nfunction makeStepNode(step: MJAIAgentRunStepEntity, promptRuns: MJAIPromptRunEntity[]): FlowNode {\n const type = flowType(step.StepType);\n let model: string | null = null;\n if (type === 'prompt' && step.TargetLogID) {\n const pr = promptRuns.find(p => UUIDsEqual(p.ID, step.TargetLogID!));\n model = pr?.Model ?? null;\n }\n const icon = stepIcon(step, type);\n return {\n id: -1, name: step.StepName || `Step ${step.StepNumber}`, type, status: step.Status,\n model, realDur: durationSeconds(step.StartedAt, step.CompletedAt),\n t0: 0, t1: 0, tmid: 0, r0: 0, r1: 0, depth: 0, heat: 0,\n parent: null, children: [], raw: step, iconClass: icon.iconClass, logoUrl: icon.logoUrl\n };\n}\n\n/**\n * Recursively attach a level of steps to `parent`, nesting both loop bodies\n * (`ParentID`) and sub-agent runs (`Sub-Agent` step → its own run's steps).\n */\nasync function attachStepTree(\n parent: FlowNode,\n steps: MJAIAgentRunStepEntity[],\n promptRuns: MJAIPromptRunEntity[],\n helper: AIAgentRunDataHelper\n): Promise<void> {\n const byId = new Map<string, FlowNode>();\n steps.forEach(s => byId.set(s.ID, makeStepNode(s, promptRuns)));\n\n // Nest loop bodies via ParentID; everything else hangs off `parent`.\n for (const s of steps) {\n const node = byId.get(s.ID)!;\n if (s.ParentID && byId.has(s.ParentID)) {\n const par = byId.get(s.ParentID)!;\n node.parent = par; par.children.push(node);\n } else {\n node.parent = parent; parent.children.push(node);\n }\n }\n\n // Recurse into sub-agent steps (their child steps need a separate load).\n for (const s of steps) {\n if (s.StepType === 'Sub-Agent' && s.TargetLogID) {\n const node = byId.get(s.ID)!;\n try {\n const sub = await helper.loadSubAgentData(s.TargetLogID);\n if (sub.steps?.length) {\n await attachStepTree(node, sub.steps, sub.promptRuns, helper);\n }\n } catch {\n // Sub-agent load failed — leave it as a leaf with its own timing.\n }\n }\n }\n}\n\nfunction calcDur(n: FlowNode): number {\n if (n.children.length) n.realDur = n.children.reduce((s, c) => s + calcDur(c), 0);\n return n.realDur;\n}\n\nfunction assignT(n: FlowNode, t0: number, t1: number): void {\n n.t0 = t0; n.t1 = t1; n.tmid = (t0 + t1) / 2;\n if (n.children.length) {\n const tot = n.children.reduce((s, c) => s + comp(c.realDur), 0) || 1;\n let cur = t0;\n for (const c of n.children) {\n const w = (t1 - t0) * comp(c.realDur) / tot;\n assignT(c, cur, cur + w); cur += w;\n }\n }\n}\n\nfunction assignReal(n: FlowNode, r0: number): number {\n n.r0 = r0;\n if (n.children.length) {\n let cur = r0;\n for (const c of n.children) { assignReal(c, cur); cur = c.r1; }\n n.r1 = cur;\n } else {\n n.r1 = r0 + n.realDur;\n }\n return n.r1;\n}\n\nfunction flatten(n: FlowNode, depth: number, out: FlowNode[]): void {\n n.depth = depth; n.id = out.length; out.push(n);\n n.children.forEach(c => flatten(c, depth + 1, out));\n}\n\nfunction heatTier(d: number, maxLeaf: number): 0 | 1 | 2 | 3 {\n const r = d / (maxLeaf || 1);\n return r >= 0.66 ? 3 : r >= 0.33 ? 2 : r >= 0.12 ? 1 : 0;\n}\n\n/**\n * Build the full normalized flow model for an agent run. Eagerly walks the whole\n * sub-agent tree (via the helper's cached `loadSubAgentData`) so the zoomed-out\n * view shows the entire run at once.\n */\nexport async function buildFlowModel(\n rootName: string,\n rootStatus: string,\n rootIcon: RootIcon,\n helper: AIAgentRunDataHelper\n): Promise<FlowModel> {\n const { steps, promptRuns } = helper.getCurrentData();\n\n const root: FlowNode = {\n id: -1, name: rootName || 'Agent run', type: 'agent', status: rootStatus,\n model: null, realDur: 0, t0: 0, t1: 1, tmid: 0.5, r0: 0, r1: 0, depth: 0, heat: 0,\n parent: null, children: [], raw: null,\n iconClass: rootIcon.iconClass || 'fa-robot', logoUrl: rootIcon.logoUrl\n };\n\n if (steps.length) {\n await attachStepTree(root, steps, promptRuns, helper);\n }\n\n return finalizeFlowModel(root);\n}\n\n/**\n * Durations, playback window, wall-clock and heat — the normalization every FlowModel shares.\n *\n * Extracted so a model built from the run TREE goes through the identical pipeline as one built\n * from raw step rows. Re-deriving any of it in a second builder is how the two sources would drift\n * into looking like different products — different bar widths, different heat thresholds — for the\n * same run.\n */\nexport function finalizeFlowModel(root: FlowNode): FlowModel {\n calcDur(root);\n assignT(root, 0, 1);\n assignReal(root, 0);\n\n const nodes: FlowNode[] = [];\n flatten(root, 0, nodes);\n nodes.forEach(n => { n.tmid = (n.t0 + n.t1) / 2; });\n\n const leaves = nodes.filter(n => n.children.length === 0).sort((a, b) => a.t0 - b.t0);\n const maxLeafDur = Math.max(0.001, ...leaves.map(n => n.realDur));\n nodes.forEach(n => { n.heat = heatTier(n.realDur, maxLeafDur); });\n\n return {\n root, nodes, leaves, total: root.realDur,\n maxDepth: Math.max(0, ...nodes.map(n => n.depth)), maxLeafDur\n };\n}\n\n/* ----------------------------- shared lookups ----------------------------- */\n\nexport function activeLeaf(model: FlowModel, p: number): FlowNode {\n const L = model.leaves;\n if (!L.length) return model.root;\n if (p <= 0) return L[0];\n if (p >= 1) return L[L.length - 1];\n return L.find(l => p >= l.t0 && p < l.t1) ?? L[L.length - 1];\n}\n\nexport function ancestors(n: FlowNode): FlowNode[] {\n const out: FlowNode[] = []; let c: FlowNode | null = n;\n while (c) { out.unshift(c); c = c.parent; }\n return out;\n}\n\nexport function agentOf(n: FlowNode): FlowNode {\n let c = n.parent;\n while (c) { if (c.type === 'agent' || c.type === 'subagent') return c; c = c.parent; }\n return n;\n}\n\n/** \"Execute Sub-Agent: Query Strategist\" → \"Query Strategist\". */\nexport function agentShortName(a: FlowNode): string {\n const i = a.name.indexOf(': ');\n return i >= 0 ? a.name.slice(i + 2) : a.name;\n}\n\n/**\n * Label with the owning agent's prefix stripped — child step names tend to be\n * \"Query Strategist: Execute Agent Prompt\"; on a view that already shows which\n * agent/line a node belongs to, the prefix is pure noise that causes overlap.\n */\nexport function displayName(n: FlowNode): string {\n const a = agentOf(n);\n if (a && a !== n) {\n const short = agentShortName(a);\n if (short && n.name.startsWith(short + ':')) return n.name.slice(short.length + 1).trim();\n }\n return n.name;\n}\n\n/**\n * Aggressively abbreviated label for tight surfaces (subway stations, flame bars,\n * stars). Strips the agent prefix, then collapses the verbose MJ step phrasing:\n * \"Execute Sub-Agent: Query Strategist\" → \"Query Strategist Sub-Agent\"\n * \"Execute Agent Prompt\" → \"Prompt\"\n * \"Execute Action: Search Query Catalog\"→ \"Search Query Catalog\"\n * \"Agent Validation\" → \"Validation\"\n */\nexport function shortLabel(n: FlowNode): string {\n if (n.type === 'subagent') return `${agentShortName(n)} Sub-Agent`;\n let s = displayName(n);\n s = s.replace(/^Execute Action:\\s*/i, '').replace(/^Execute Sub-Agent:\\s*/i, '');\n if (/^Execute Agent Prompt$/i.test(s)) s = 'Prompt';\n else if (/^Agent Validation$/i.test(s)) s = 'Validation';\n else if (/^Data Source Preloading$/i.test(s)) s = 'Data Preload';\n return s;\n}\n\nexport function formatDuration(seconds: number): string {\n if (seconds < 1) return `${Math.round(seconds * 1000)}ms`;\n if (seconds < 60) return `${seconds < 10 ? seconds.toFixed(1) : Math.round(seconds)}s`;\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m ${Math.round(seconds % 60)}s`;\n return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Projects a run tree into the `FlowModel` the three visualizations render.
|
|
3
|
+
*
|
|
4
|
+
* **Why this exists.** Flame Cascade, Subway Lines and Constellation all read one `FlowModel`, and
|
|
5
|
+
* that model was built from raw `AIAgentRunStep` rows — which means none of them could show
|
|
6
|
+
* task-graph work at all. A workflow's steps live in `MJ: Tasks`, not in the run's step list, so the
|
|
7
|
+
* most interesting thing a run did was invisible in every visual view of it.
|
|
8
|
+
*
|
|
9
|
+
* One projection fixes all three, because they share the model. That is the whole reason to do it
|
|
10
|
+
* here rather than teaching each renderer about tasks.
|
|
11
|
+
*
|
|
12
|
+
* **The normalization is deliberately NOT re-implemented.** Durations, the [0..1] playback window,
|
|
13
|
+
* cumulative wall-clock and heat tiers all come from the same helpers the step-based builder uses,
|
|
14
|
+
* so a graph node and a step node are laid out and coloured by identical rules. Re-deriving them
|
|
15
|
+
* here is how the two sources would drift into looking like different products.
|
|
16
|
+
*/
|
|
17
|
+
import type { AgentRunTreeNode } from '@memberjunction/ai-core-plus';
|
|
18
|
+
import { FlowModel, RootIcon } from './agent-run-flow.model';
|
|
19
|
+
/**
|
|
20
|
+
* Builds the flow model from a run tree.
|
|
21
|
+
*
|
|
22
|
+
* @param root the tree, as loaded once by the run form and shared with every tab
|
|
23
|
+
* @param rootName what to call the run itself
|
|
24
|
+
* @param rootStatus the run's status
|
|
25
|
+
* @param rootIcon the agent's icon/logo, which only the form knows
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildFlowModelFromTree(root: AgentRunTreeNode | null, rootName: string, rootStatus: string, rootIcon: RootIcon): FlowModel | null;
|
|
28
|
+
//# sourceMappingURL=run-tree-flow-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-tree-flow-projection.d.ts","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/run-tree-flow-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAwB,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAY,SAAS,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AA0D1F;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,QAAQ,GACnB,SAAS,GAAG,IAAI,CAsBlB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { finalizeFlowModel } from './agent-run-flow.model';
|
|
2
|
+
/**
|
|
3
|
+
* How a tree node's kind maps to the visual vocabulary.
|
|
4
|
+
*
|
|
5
|
+
* Keyed on `SourceKind` — the node's kind in its OWN vocabulary — with the node type as the
|
|
6
|
+
* fallback. A run step says 'Actions'; a task says 'Action'. Both are an action to look at, and
|
|
7
|
+
* flattening that difference at the source would have lost the design-time/executable distinction
|
|
8
|
+
* everywhere else.
|
|
9
|
+
*/
|
|
10
|
+
const KIND_TO_FLOW_TYPE = {
|
|
11
|
+
// Run-step vocabulary
|
|
12
|
+
Actions: 'action',
|
|
13
|
+
Prompt: 'prompt',
|
|
14
|
+
'Sub-Agent': 'subagent',
|
|
15
|
+
Validation: 'validation',
|
|
16
|
+
Decision: 'decision',
|
|
17
|
+
Chat: 'prompt',
|
|
18
|
+
Plan: 'decision',
|
|
19
|
+
Skill: 'action',
|
|
20
|
+
Tool: 'action',
|
|
21
|
+
Compaction: 'other',
|
|
22
|
+
TaskGraph: 'loop',
|
|
23
|
+
// Task vocabulary
|
|
24
|
+
Action: 'action',
|
|
25
|
+
Agent: 'subagent',
|
|
26
|
+
ForEach: 'loop',
|
|
27
|
+
While: 'loop',
|
|
28
|
+
Human: 'decision',
|
|
29
|
+
External: 'other',
|
|
30
|
+
};
|
|
31
|
+
/** The visual type for a node, preferring its declared kind over its structural role. */
|
|
32
|
+
function flowTypeOf(node) {
|
|
33
|
+
const byKind = node.SourceKind ? KIND_TO_FLOW_TYPE[node.SourceKind] : undefined;
|
|
34
|
+
if (byKind)
|
|
35
|
+
return byKind;
|
|
36
|
+
const byType = {
|
|
37
|
+
Run: 'subagent',
|
|
38
|
+
Step: 'other',
|
|
39
|
+
TaskGraph: 'loop',
|
|
40
|
+
Task: 'other',
|
|
41
|
+
};
|
|
42
|
+
return byType[node.NodeType] ?? 'other';
|
|
43
|
+
}
|
|
44
|
+
/** Font Awesome icon per visual type — the same vocabulary the step-based builder uses. */
|
|
45
|
+
const ICON_BY_TYPE = {
|
|
46
|
+
agent: 'fa-robot',
|
|
47
|
+
subagent: 'fa-robot',
|
|
48
|
+
prompt: 'fa-brain',
|
|
49
|
+
action: 'fa-gear',
|
|
50
|
+
decision: 'fa-code-branch',
|
|
51
|
+
loop: 'fa-repeat',
|
|
52
|
+
validation: 'fa-circle-check',
|
|
53
|
+
other: 'fa-circle',
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Builds the flow model from a run tree.
|
|
57
|
+
*
|
|
58
|
+
* @param root the tree, as loaded once by the run form and shared with every tab
|
|
59
|
+
* @param rootName what to call the run itself
|
|
60
|
+
* @param rootStatus the run's status
|
|
61
|
+
* @param rootIcon the agent's icon/logo, which only the form knows
|
|
62
|
+
*/
|
|
63
|
+
export function buildFlowModelFromTree(root, rootName, rootStatus, rootIcon) {
|
|
64
|
+
if (!root)
|
|
65
|
+
return null;
|
|
66
|
+
const rootNode = {
|
|
67
|
+
id: -1,
|
|
68
|
+
name: rootName || root.Name || 'Agent run',
|
|
69
|
+
type: 'agent',
|
|
70
|
+
status: rootStatus || root.Status,
|
|
71
|
+
model: null,
|
|
72
|
+
realDur: durationSeconds(root),
|
|
73
|
+
t0: 0, t1: 1, tmid: 0.5, r0: 0, r1: 0, depth: 0, heat: 0,
|
|
74
|
+
parent: null,
|
|
75
|
+
children: [],
|
|
76
|
+
raw: null,
|
|
77
|
+
source: { entity: root.SourceEntity, id: root.SourceID },
|
|
78
|
+
iconClass: rootIcon.iconClass || 'fa-robot',
|
|
79
|
+
logoUrl: rootIcon.logoUrl,
|
|
80
|
+
};
|
|
81
|
+
for (const child of root.Children)
|
|
82
|
+
attach(rootNode, child);
|
|
83
|
+
return finalizeFlowModel(rootNode);
|
|
84
|
+
}
|
|
85
|
+
/** Adds one tree node (and its descendants) under a flow node. */
|
|
86
|
+
function attach(parent, node) {
|
|
87
|
+
const type = flowTypeOf(node);
|
|
88
|
+
const flow = {
|
|
89
|
+
id: 0, // assigned during flatten
|
|
90
|
+
name: node.Name,
|
|
91
|
+
type,
|
|
92
|
+
status: node.Status,
|
|
93
|
+
model: null,
|
|
94
|
+
realDur: durationSeconds(node),
|
|
95
|
+
t0: 0, t1: 1, tmid: 0.5, r0: 0, r1: 0, depth: parent.depth + 1, heat: 0,
|
|
96
|
+
parent,
|
|
97
|
+
children: [],
|
|
98
|
+
raw: null,
|
|
99
|
+
// Every node keeps a pointer to the row it came from, so a click can open the right record
|
|
100
|
+
// whichever entity it lives in. `raw` stays null for task nodes because it is typed to a
|
|
101
|
+
// run STEP — the reason this generic reference exists.
|
|
102
|
+
source: { entity: node.SourceEntity, id: node.SourceID },
|
|
103
|
+
iconClass: ICON_BY_TYPE[type],
|
|
104
|
+
logoUrl: null,
|
|
105
|
+
};
|
|
106
|
+
parent.children.push(flow);
|
|
107
|
+
for (const child of node.Children)
|
|
108
|
+
attach(flow, child);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A node's own duration, in seconds.
|
|
112
|
+
*
|
|
113
|
+
* Zero for anything unfinished. The normalization sums children into containers afterwards, so a
|
|
114
|
+
* node that is still running contributes nothing rather than an arbitrary elapsed-so-far that would
|
|
115
|
+
* make an in-flight run look longer than a settled one.
|
|
116
|
+
*/
|
|
117
|
+
function durationSeconds(node) {
|
|
118
|
+
return node.DurationMs != null ? node.DurationMs / 1000 : 0;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=run-tree-flow-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-tree-flow-projection.js","sourceRoot":"","sources":["../../../../../src/lib/custom/ai-agent-run/flow/run-tree-flow-projection.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAiC,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAAqC;IACxD,sBAAsB;IACtB,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,UAAU;IACvB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,MAAM;IACjB,kBAAkB;IAClB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,OAAO;CACpB,CAAC;AAEF,yF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B,CAAC;IACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;QAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,IAAsB;IAC3C,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["/**\n * @fileoverview Projects a run tree into the `FlowModel` the three visualizations render.\n *\n * **Why this exists.** Flame Cascade, Subway Lines and Constellation all read one `FlowModel`, and\n * that model was built from raw `AIAgentRunStep` rows — which means none of them could show\n * task-graph work at all. A workflow's steps live in `MJ: Tasks`, not in the run's step list, so the\n * most interesting thing a run did was invisible in every visual view of it.\n *\n * One projection fixes all three, because they share the model. That is the whole reason to do it\n * here rather than teaching each renderer about tasks.\n *\n * **The normalization is deliberately NOT re-implemented.** Durations, the [0..1] playback window,\n * cumulative wall-clock and heat tiers all come from the same helpers the step-based builder uses,\n * so a graph node and a step node are laid out and coloured by identical rules. Re-deriving them\n * here is how the two sources would drift into looking like different products.\n */\nimport type { AgentRunTreeNode, AgentRunTreeNodeType } from '@memberjunction/ai-core-plus';\nimport { FlowNode, FlowModel, RootIcon, finalizeFlowModel } from './agent-run-flow.model';\n\n/**\n * How a tree node's kind maps to the visual vocabulary.\n *\n * Keyed on `SourceKind` — the node's kind in its OWN vocabulary — with the node type as the\n * fallback. A run step says 'Actions'; a task says 'Action'. Both are an action to look at, and\n * flattening that difference at the source would have lost the design-time/executable distinction\n * everywhere else.\n */\nconst KIND_TO_FLOW_TYPE: Record<string, FlowNode['type']> = {\n // Run-step vocabulary\n Actions: 'action',\n Prompt: 'prompt',\n 'Sub-Agent': 'subagent',\n Validation: 'validation',\n Decision: 'decision',\n Chat: 'prompt',\n Plan: 'decision',\n Skill: 'action',\n Tool: 'action',\n Compaction: 'other',\n TaskGraph: 'loop',\n // Task vocabulary\n Action: 'action',\n Agent: 'subagent',\n ForEach: 'loop',\n While: 'loop',\n Human: 'decision',\n External: 'other',\n};\n\n/** The visual type for a node, preferring its declared kind over its structural role. */\nfunction flowTypeOf(node: AgentRunTreeNode): FlowNode['type'] {\n const byKind = node.SourceKind ? KIND_TO_FLOW_TYPE[node.SourceKind] : undefined;\n if (byKind) return byKind;\n\n const byType: Record<AgentRunTreeNodeType, FlowNode['type']> = {\n Run: 'subagent',\n Step: 'other',\n TaskGraph: 'loop',\n Task: 'other',\n };\n return byType[node.NodeType] ?? 'other';\n}\n\n/** Font Awesome icon per visual type — the same vocabulary the step-based builder uses. */\nconst ICON_BY_TYPE: Record<FlowNode['type'], string> = {\n agent: 'fa-robot',\n subagent: 'fa-robot',\n prompt: 'fa-brain',\n action: 'fa-gear',\n decision: 'fa-code-branch',\n loop: 'fa-repeat',\n validation: 'fa-circle-check',\n other: 'fa-circle',\n};\n\n/**\n * Builds the flow model from a run tree.\n *\n * @param root the tree, as loaded once by the run form and shared with every tab\n * @param rootName what to call the run itself\n * @param rootStatus the run's status\n * @param rootIcon the agent's icon/logo, which only the form knows\n */\nexport function buildFlowModelFromTree(\n root: AgentRunTreeNode | null,\n rootName: string,\n rootStatus: string,\n rootIcon: RootIcon,\n): FlowModel | null {\n if (!root) return null;\n\n const rootNode: FlowNode = {\n id: -1,\n name: rootName || root.Name || 'Agent run',\n type: 'agent',\n status: rootStatus || root.Status,\n model: null,\n realDur: durationSeconds(root),\n t0: 0, t1: 1, tmid: 0.5, r0: 0, r1: 0, depth: 0, heat: 0,\n parent: null,\n children: [],\n raw: null,\n source: { entity: root.SourceEntity, id: root.SourceID },\n iconClass: rootIcon.iconClass || 'fa-robot',\n logoUrl: rootIcon.logoUrl,\n };\n\n for (const child of root.Children) attach(rootNode, child);\n\n return finalizeFlowModel(rootNode);\n}\n\n/** Adds one tree node (and its descendants) under a flow node. */\nfunction attach(parent: FlowNode, node: AgentRunTreeNode): void {\n const type = flowTypeOf(node);\n const flow: FlowNode = {\n id: 0, // assigned during flatten\n name: node.Name,\n type,\n status: node.Status,\n model: null,\n realDur: durationSeconds(node),\n t0: 0, t1: 1, tmid: 0.5, r0: 0, r1: 0, depth: parent.depth + 1, heat: 0,\n parent,\n children: [],\n raw: null,\n // Every node keeps a pointer to the row it came from, so a click can open the right record\n // whichever entity it lives in. `raw` stays null for task nodes because it is typed to a\n // run STEP — the reason this generic reference exists.\n source: { entity: node.SourceEntity, id: node.SourceID },\n iconClass: ICON_BY_TYPE[type],\n logoUrl: null,\n };\n parent.children.push(flow);\n for (const child of node.Children) attach(flow, child);\n}\n\n/**\n * A node's own duration, in seconds.\n *\n * Zero for anything unfinished. The normalization sums children into containers afterwards, so a\n * node that is still running contributes nothing rather than an arbitrary elapsed-so-far that would\n * make an in-flight run look longer than a settled one.\n */\nfunction durationSeconds(node: AgentRunTreeNode): number {\n return node.DurationMs != null ? node.DurationMs / 1000 : 0;\n}\n"]}
|