@memberjunction/ng-task-graph-editor 6.1.0-edge.1 → 6.1.0-edge.3
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/LICENSE +180 -4
- package/README.md +197 -0
- package/dist/lib/debug-variables.d.ts +27 -0
- package/dist/lib/debug-variables.d.ts.map +1 -0
- package/dist/lib/debug-variables.js +96 -0
- package/dist/lib/debug-variables.js.map +1 -0
- package/dist/lib/pane-split.d.ts +11 -0
- package/dist/lib/pane-split.d.ts.map +1 -0
- package/dist/lib/pane-split.js +36 -0
- package/dist/lib/pane-split.js.map +1 -0
- package/dist/lib/task-graph-canvas-adapter.d.ts +142 -7
- package/dist/lib/task-graph-canvas-adapter.d.ts.map +1 -1
- package/dist/lib/task-graph-canvas-adapter.js +319 -44
- package/dist/lib/task-graph-canvas-adapter.js.map +1 -1
- package/dist/lib/task-graph-debug-toolbar.component.d.ts +27 -0
- package/dist/lib/task-graph-debug-toolbar.component.d.ts.map +1 -0
- package/dist/lib/task-graph-debug-toolbar.component.js +153 -0
- package/dist/lib/task-graph-debug-toolbar.component.js.map +1 -0
- package/dist/lib/task-graph-debugger.component.d.ts +96 -0
- package/dist/lib/task-graph-debugger.component.d.ts.map +1 -0
- package/dist/lib/task-graph-debugger.component.js +371 -0
- package/dist/lib/task-graph-debugger.component.js.map +1 -0
- package/dist/lib/task-graph-editor.component.d.ts +144 -5
- package/dist/lib/task-graph-editor.component.d.ts.map +1 -1
- package/dist/lib/task-graph-editor.component.js +321 -26
- package/dist/lib/task-graph-editor.component.js.map +1 -1
- package/dist/lib/task-graph-editor.module.d.ts +10 -5
- package/dist/lib/task-graph-editor.module.d.ts.map +1 -1
- package/dist/lib/task-graph-editor.module.js +53 -5
- package/dist/lib/task-graph-editor.module.js.map +1 -1
- package/dist/lib/task-graph-properties-panel.component.d.ts +34 -8
- package/dist/lib/task-graph-properties-panel.component.d.ts.map +1 -1
- package/dist/lib/task-graph-properties-panel.component.js +164 -45
- package/dist/lib/task-graph-properties-panel.component.js.map +1 -1
- package/dist/lib/task-graph-run-prefs.d.ts +34 -0
- package/dist/lib/task-graph-run-prefs.d.ts.map +1 -0
- package/dist/lib/task-graph-run-prefs.js +67 -0
- package/dist/lib/task-graph-run-prefs.js.map +1 -0
- package/dist/lib/task-graph-run-view.component.d.ts +290 -0
- package/dist/lib/task-graph-run-view.component.d.ts.map +1 -0
- package/dist/lib/task-graph-run-view.component.js +826 -0
- package/dist/lib/task-graph-run-view.component.js.map +1 -0
- package/dist/lib/task-graph-runtime-source.d.ts +7 -1
- package/dist/lib/task-graph-runtime-source.d.ts.map +1 -1
- package/dist/lib/task-graph-runtime-source.js +14 -2
- package/dist/lib/task-graph-runtime-source.js.map +1 -1
- package/dist/lib/task-graph-variables.component.d.ts +23 -0
- package/dist/lib/task-graph-variables.component.d.ts.map +1 -0
- package/dist/lib/task-graph-variables.component.js +192 -0
- package/dist/lib/task-graph-variables.component.js.map +1 -0
- package/dist/lib/workflow-debug-host.d.ts +23 -0
- package/dist/lib/workflow-debug-host.d.ts.map +1 -0
- package/dist/lib/workflow-debug-host.js +101 -0
- package/dist/lib/workflow-debug-host.js.map +1 -0
- package/dist/public-api.d.ts +8 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +8 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +11 -9
package/LICENSE
CHANGED
|
@@ -1,7 +1,183 @@
|
|
|
1
|
-
|
|
1
|
+
Business Source License 1.1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
License text copyright (c) 2024 MariaDB plc, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB plc.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Blue Cypress, Inc.
|
|
11
|
+
|
|
12
|
+
Licensed Work: MemberJunction.
|
|
13
|
+
The Licensed Work is (c) 2023-2026 Blue Cypress, Inc.
|
|
14
|
+
|
|
15
|
+
Additional Use Grant: Subject to the terms of this License, Licensor grants
|
|
16
|
+
you the following additional rights to make Production
|
|
17
|
+
Use of the Licensed Work.
|
|
18
|
+
|
|
19
|
+
1. Internal Use
|
|
20
|
+
|
|
21
|
+
You may make production use of the Licensed Work for
|
|
22
|
+
your own internal business or organizational operations.
|
|
23
|
+
|
|
24
|
+
2. Nonprofit Use
|
|
25
|
+
|
|
26
|
+
If you are a Nonprofit, you may make production use of
|
|
27
|
+
the Licensed Work for the operations and activities of
|
|
28
|
+
your Organizational Family.
|
|
29
|
+
|
|
30
|
+
3. MemberJunction Certified Program Use
|
|
31
|
+
|
|
32
|
+
If you are authorized by Licensor under the
|
|
33
|
+
MemberJunction Certified Program to provide professional
|
|
34
|
+
services using the Licensed Work, you may make
|
|
35
|
+
production use of the Licensed Work in providing such
|
|
36
|
+
professional services to a client, provided that:
|
|
37
|
+
|
|
38
|
+
(a) the Licensed Work is deployed in, and the applicable
|
|
39
|
+
production use occurs within, an environment owned,
|
|
40
|
+
leased, licensed, subscribed to, or otherwise controlled
|
|
41
|
+
by that client; and
|
|
42
|
+
|
|
43
|
+
(b) the production use is for that client's own internal
|
|
44
|
+
business or organizational operations or is otherwise
|
|
45
|
+
independently permitted to that client under this
|
|
46
|
+
Additional Use Grant.
|
|
47
|
+
|
|
48
|
+
4. Definitions Applicable to the Additional Use Grant
|
|
49
|
+
|
|
50
|
+
"Affiliate" means, with respect to a specified Person,
|
|
51
|
+
any other Person that directly or indirectly Controls,
|
|
52
|
+
is Controlled by, or is under common Control with such
|
|
53
|
+
specified Person.
|
|
54
|
+
|
|
55
|
+
"Control" (including the terms "Controls," "Controlled
|
|
56
|
+
by," and "under common Control with") means the direct
|
|
57
|
+
or indirect possession of the power to direct or cause
|
|
58
|
+
the direction of the management and policies of a
|
|
59
|
+
Person, whether through ownership of voting interests,
|
|
60
|
+
by contract, or otherwise.
|
|
61
|
+
|
|
62
|
+
"Organizational Family" means, with respect to a Person,
|
|
63
|
+
(a) such Person and its Affiliates, and (b) any
|
|
64
|
+
nonprofit organization, governmental entity, chapter,
|
|
65
|
+
division, local affiliate, regional affiliate, state
|
|
66
|
+
affiliate, national affiliate, or other entity that is
|
|
67
|
+
formally affiliated with such Person through governing
|
|
68
|
+
documents, a charter, bylaws, a membership agreement, or
|
|
69
|
+
another written organizational instrument, and is
|
|
70
|
+
recognized under such documents as part of the same
|
|
71
|
+
organizational structure.
|
|
72
|
+
|
|
73
|
+
"Nonprofit" means a Person recognized by the Internal
|
|
74
|
+
Revenue Service as exempt from federal income taxation
|
|
75
|
+
under Section 501(c)(3), 501(c)(4), 501(c)(5), or
|
|
76
|
+
501(c)(6) of the Internal Revenue Code, or a foreign
|
|
77
|
+
organization recognized under substantially equivalent
|
|
78
|
+
laws.
|
|
79
|
+
|
|
80
|
+
A Person claiming eligibility as a Nonprofit shall, upon
|
|
81
|
+
Licensor's reasonable request, provide documentation
|
|
82
|
+
reasonably sufficient to demonstrate that it qualifies
|
|
83
|
+
as a Nonprofit. If such Person materially misrepresents,
|
|
84
|
+
or is unable to demonstrate, its qualification as a
|
|
85
|
+
Nonprofit, the rights granted to such Person under
|
|
86
|
+
Section 2 of this Additional Use Grant shall terminate.
|
|
87
|
+
|
|
88
|
+
"MemberJunction Certified Program" means Licensor's
|
|
89
|
+
then-current program for certifying and authorizing a
|
|
90
|
+
Person to provide professional services using the
|
|
91
|
+
Licensed Work.
|
|
92
|
+
|
|
93
|
+
"Person" means any individual, corporation, limited
|
|
94
|
+
liability company, partnership, association, nonprofit
|
|
95
|
+
organization, governmental entity, or other legal or
|
|
96
|
+
organizational entity.
|
|
97
|
+
|
|
98
|
+
Change Date: Four (4) years from the date the Licensed Work is first
|
|
99
|
+
made available.
|
|
100
|
+
|
|
101
|
+
Change License: MIT License.
|
|
102
|
+
|
|
103
|
+
For information about alternative licensing arrangements for the Licensed
|
|
104
|
+
Work, please contact Blue Cypress, Inc.
|
|
105
|
+
|
|
106
|
+
-----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
Terms
|
|
109
|
+
|
|
110
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
111
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
112
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
113
|
+
production use.
|
|
114
|
+
|
|
115
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
116
|
+
available distribution of a specific version of the Licensed Work under this
|
|
117
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
118
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
119
|
+
above terminate.
|
|
120
|
+
|
|
121
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
122
|
+
currently in effect as described in this License, you must purchase a
|
|
123
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
124
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
125
|
+
|
|
126
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
127
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
128
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
129
|
+
for each version of the Licensed Work released by Licensor.
|
|
130
|
+
|
|
131
|
+
You must conspicuously display this License on each original or modified copy
|
|
132
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
133
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
134
|
+
License apply to your use of that work.
|
|
135
|
+
|
|
136
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
137
|
+
terminate your rights under this License for the current and all other
|
|
138
|
+
versions of the Licensed Work.
|
|
139
|
+
|
|
140
|
+
This License does not grant you any right in any trademark or logo of
|
|
141
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
142
|
+
Licensor as expressly required by this License).
|
|
143
|
+
|
|
144
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
145
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
146
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
147
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
148
|
+
TITLE.
|
|
149
|
+
|
|
150
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
151
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
152
|
+
as long as you comply with the Covenants of Licensor below.
|
|
153
|
+
|
|
154
|
+
-----------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
Covenants of Licensor
|
|
157
|
+
|
|
158
|
+
In consideration of the right to use this License's text and the "Business
|
|
159
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
160
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
161
|
+
|
|
162
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
163
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
164
|
+
where "compatible" means that software provided under the Change License
|
|
165
|
+
can be included in a program with software provided under GPL Version 2.0
|
|
166
|
+
or a later version. Licensor may specify additional Change Licenses without
|
|
167
|
+
limitation.
|
|
168
|
+
|
|
169
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
170
|
+
impose any additional restriction on the right granted in this License, as
|
|
171
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
172
|
+
|
|
173
|
+
3. To specify a Change Date.
|
|
174
|
+
|
|
175
|
+
4. Not to modify this License in any other way.
|
|
176
|
+
|
|
177
|
+
-----------------------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
Notice
|
|
180
|
+
|
|
181
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
182
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
183
|
+
under an Open Source License, as stated in this License.
|
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# @memberjunction/ng-task-graph-editor
|
|
2
|
+
|
|
3
|
+
View and edit a `TaskGraphSpec` on a canvas — the one graph contract shared by design-time flows
|
|
4
|
+
and runtime task graphs. Also the **drop-in debugger** for a live parent `MJ: Tasks` row.
|
|
5
|
+
|
|
6
|
+
Import `TaskGraphSpec` itself from `@memberjunction/ai-core-plus`. This package does not re-export
|
|
7
|
+
it.
|
|
8
|
+
|
|
9
|
+
> **Stepping a live run?** Start with the [Workflow Debugger Guide](../../../../guides/WORKFLOW_DEBUGGER_GUIDE.md).
|
|
10
|
+
> This README is the package API.
|
|
11
|
+
|
|
12
|
+
**Layer:** `widgets` (L1 canvas + L2 session wrap). No `@angular/router`. See
|
|
13
|
+
[UI Layering](../../../../guides/UI_LAYERING_GUIDE.md).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## What lives here
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart TD
|
|
21
|
+
subgraph L2["L2 — session owner"]
|
|
22
|
+
DBG["mj-task-graph-debugger"]
|
|
23
|
+
end
|
|
24
|
+
subgraph L1["L1 — paint only"]
|
|
25
|
+
ED["mj-task-graph-editor"]
|
|
26
|
+
RV["mj-task-graph-run-view"]
|
|
27
|
+
TB["mj-task-graph-debug-toolbar"]
|
|
28
|
+
VAR["mj-task-graph-variables"]
|
|
29
|
+
PP["mj-task-graph-properties-panel"]
|
|
30
|
+
end
|
|
31
|
+
FE["@memberjunction/ng-flow-editor"]
|
|
32
|
+
|
|
33
|
+
DBG --> TB
|
|
34
|
+
DBG --> RV
|
|
35
|
+
RV --> FE
|
|
36
|
+
ED --> FE
|
|
37
|
+
RV --> VAR
|
|
38
|
+
ED --> PP
|
|
39
|
+
|
|
40
|
+
style L2 fill:#7c5295,stroke:#563a6b,color:#fff
|
|
41
|
+
style L1 fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
42
|
+
style FE fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
| Selector | Job |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `mj-task-graph-editor` | Design-time: edit a `TaskGraphSpec`. Emits intent; the host saves. |
|
|
48
|
+
| `mj-task-graph-run-view` | Runtime paint: project rows + `$.debug` onto the same canvas. **No** `RouteOperation`. |
|
|
49
|
+
| `mj-task-graph-debugger` | Drop-in wrap: parent task id in, frames + verbs owned. Hosts stay zero-code. |
|
|
50
|
+
| `mj-task-graph-debug-toolbar` | VCR chrome (Continue / Over / Into / Stop). |
|
|
51
|
+
| `mj-task-graph-variables` | Invocation / input / output in the left data pane. |
|
|
52
|
+
| `mj-task-graph-properties-panel` | Design-time field inspector. |
|
|
53
|
+
|
|
54
|
+
The wrap is a wrap — not a rewrite. Canvas, toolbar, and Remote Operations are the ones Runs and
|
|
55
|
+
the harness already used. New code is the shell so those hosts do not each re-subscribe to frames.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pnpm add @memberjunction/ng-task-graph-editor
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { TaskGraphEditorModule } from '@memberjunction/ng-task-graph-editor';
|
|
67
|
+
|
|
68
|
+
@NgModule({
|
|
69
|
+
imports: [TaskGraphEditorModule],
|
|
70
|
+
})
|
|
71
|
+
export class YourModule {}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Drop-in debugger
|
|
77
|
+
|
|
78
|
+
Give it the parent task id. That is the whole contract.
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<mj-task-graph-debugger
|
|
82
|
+
[ParentTaskID]="parentTaskId"
|
|
83
|
+
[WorkflowName]="name"
|
|
84
|
+
[AllowBreakpointEditing]="true"
|
|
85
|
+
[ShowChrome]="true"
|
|
86
|
+
[ShowVariables]="true"
|
|
87
|
+
(Settled)="onSettled()"
|
|
88
|
+
(PausedChange)="onPaused($event)"
|
|
89
|
+
(Frame)="onFrame($event)"
|
|
90
|
+
(NodeSelected)="onNode($event)"
|
|
91
|
+
(ConnectionSelected)="onEdge($event)"
|
|
92
|
+
(ControlFailed)="onControlFailed($event)">
|
|
93
|
+
</mj-task-graph-debugger>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Inputs
|
|
97
|
+
|
|
98
|
+
| Input | Default | Notes |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `ParentTaskID` | — | Parent `MJ: Tasks` row. Attach/detach frames and refresh `$.debug` on change. |
|
|
101
|
+
| `WorkflowName` | `'Workflow'` | Label in the chrome. |
|
|
102
|
+
| `LiveUpdates` | `true` | Subscribe to `TaskGraphFrames` when the provider has it. |
|
|
103
|
+
| `PollIntervalSeconds` | `3` | Fallback poll for the run view if frames are quiet. |
|
|
104
|
+
| `Height` | `'100%'` | |
|
|
105
|
+
| `ShowLegend` | `false` | |
|
|
106
|
+
| `ShowCanvasToolbar` | `true` | Zoom / pan / fit chip (starts minimized). |
|
|
107
|
+
| `ToolbarVisibility` | `'minimized'` | |
|
|
108
|
+
| `ToolbarAlign` | `'left'` | |
|
|
109
|
+
| `AllowBreakpointEditing` | `true` | Right-click Add / Remove Breakpoint. Compare IDs with `HasBreakpoint` (`UUIDsEqual`). |
|
|
110
|
+
| `ShowVariables` | `true` | Left data pane. |
|
|
111
|
+
| `ShowChrome` | `true` | VCR bar. Off if the host already has its own. |
|
|
112
|
+
| `Enabled` | `true` | |
|
|
113
|
+
| `ReplayAt` | `null` | Historical replay cursor. |
|
|
114
|
+
|
|
115
|
+
### Public verbs
|
|
116
|
+
|
|
117
|
+
`Pause` · `Resume` · `Step('one' \| 'wave')` · `Cancel` · `ToggleBreakpoint` · `OverrideEdge` ·
|
|
118
|
+
`SkipTask` · `RetryTask` · `UpdateTaskInput` · `ForceCompleteTask` · `Refresh` · `HasBreakpoint` ·
|
|
119
|
+
`GetEdgeOverride`.
|
|
120
|
+
|
|
121
|
+
`ForceCompleteTask` and `UpdateTaskInput` send the RO field `payload` (not `output`). For force
|
|
122
|
+
complete that value becomes the step output downstream conditions evaluate against.
|
|
123
|
+
|
|
124
|
+
### Events
|
|
125
|
+
|
|
126
|
+
`NodeSelected` · `ConnectionSelected` · `LegendToggled` · `SettledChange` · `PausedChange` ·
|
|
127
|
+
`Frame` · `ControlFailed` · `Settled`.
|
|
128
|
+
|
|
129
|
+
### What the wrap owns
|
|
130
|
+
|
|
131
|
+
- `TaskGraphFrames` (duck-typed on the provider — GraphQL has it; others simply do not).
|
|
132
|
+
- `IRemoteOperationProvider.RouteOperation` for every `TaskGraph.*` verb.
|
|
133
|
+
- Re-read of `$.debug` after each control so a two-console write cannot drop breakpoints.
|
|
134
|
+
|
|
135
|
+
Hosts must **not** also attach frames or call `RouteOperation` for the same parent. Runs keeps
|
|
136
|
+
stall/engine chrome by listening to `(Frame)`.
|
|
137
|
+
|
|
138
|
+
### Layering
|
|
139
|
+
|
|
140
|
+
The **run view** is L1 — props in, paint out. The **wrap** is L2 because its *job* is the session:
|
|
141
|
+
it reads the parent row through `ProviderToUse` and writes via `RouteOperation` so every host does
|
|
142
|
+
not re-implement the verbs. It never navigates. See [UI Layering](../../../../guides/UI_LAYERING_GUIDE.md) §5.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Runtime paint
|
|
147
|
+
|
|
148
|
+
`SpecToNodes` / `SpecToConnections` in `task-graph-canvas-adapter.ts` project rows + overlay onto
|
|
149
|
+
`flow-editor`. Rules that are easy to get wrong:
|
|
150
|
+
|
|
151
|
+
- **Queued** (`NextToRun`): prerequisites Complete (or entry), not awaiting, not terminal, not in
|
|
152
|
+
progress. Banner: *Next — waiting for the engine*. Incoming edge animates.
|
|
153
|
+
- **Running**: `In Progress`. Solid pulse.
|
|
154
|
+
- **Awaiting user**: breakpoint / start-paused. Banner: *Waiting on you*. Not drawn as a spinner.
|
|
155
|
+
- **Traveled edge**: origin in `{Complete, Failed, Cancelled}` **and** dest in
|
|
156
|
+
`{In Progress, Complete, Failed, Cancelled}`. Pending dests stay dashed — a gate has not fired.
|
|
157
|
+
- **Conditional**: dashed until traveled, then **solid**, `if` label kept. Forced is always dotted
|
|
158
|
+
with a hand. Untaken (skipped) edges are omitted unless forced.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Persisted prefs
|
|
163
|
+
|
|
164
|
+
One typed bag per surface, via `UserInfoEngine` — never `localStorage`.
|
|
165
|
+
|
|
166
|
+
| Key | Type | Default |
|
|
167
|
+
|---|---|---|
|
|
168
|
+
| `mj.taskGraphRun.prefs.v1` | `TaskGraphRunPrefs` | `{ InvocationOpen: false, InvocationSplit: [22, 78] }` |
|
|
169
|
+
|
|
170
|
+
`TaskGraphRunPrefsStore` merges unknown JSON onto defaults. Size and openness are separate fields
|
|
171
|
+
so minimizing the left pane and opening it again restores the width the user dragged.
|
|
172
|
+
|
|
173
|
+
The harness Starting Payload disclosure is a different bag (`mj.aiTestHarness.prefs.v1`) because
|
|
174
|
+
it is harness chrome, not run-view chrome.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Design-time editor
|
|
179
|
+
|
|
180
|
+
```html
|
|
181
|
+
<mj-task-graph-editor
|
|
182
|
+
[Spec]="spec"
|
|
183
|
+
(SpecChange)="onSpec($event)"
|
|
184
|
+
(NodeSelected)="onNode($event)">
|
|
185
|
+
</mj-task-graph-editor>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Same canvas, no runtime overlay. Host owns persistence of the Flow agent's steps/paths.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Related
|
|
193
|
+
|
|
194
|
+
- [Workflow Debugger Guide](../../../../guides/WORKFLOW_DEBUGGER_GUIDE.md)
|
|
195
|
+
- [Workflows and Task Graphs](../../../../guides/WORKFLOW_AND_TASK_GRAPH_GUIDE.md)
|
|
196
|
+
- [`@memberjunction/task-graph`](../../../TaskGraph/README.md)
|
|
197
|
+
- [`@memberjunction/ng-flow-editor`](../flow-editor/README.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VS Code VARIABLES-style tree for a step's input / output / invocation.
|
|
3
|
+
*
|
|
4
|
+
* Pure: hosts pass JSON strings or already-parsed values; this never fetches.
|
|
5
|
+
*/
|
|
6
|
+
export type DebugVariableKind = 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';
|
|
7
|
+
export type DebugVariable = {
|
|
8
|
+
Name: string;
|
|
9
|
+
Preview: string;
|
|
10
|
+
Kind: DebugVariableKind;
|
|
11
|
+
Children: DebugVariable[];
|
|
12
|
+
};
|
|
13
|
+
export type DebugVariableScope = {
|
|
14
|
+
Name: string;
|
|
15
|
+
Variables: DebugVariable[];
|
|
16
|
+
};
|
|
17
|
+
/** Parse a payload column. A string that is JSON becomes the value; anything else stays a string. */
|
|
18
|
+
export declare function DecodePayload(raw: string | null | undefined): unknown;
|
|
19
|
+
export declare function BuildVariableScopes(args: {
|
|
20
|
+
input?: unknown;
|
|
21
|
+
output?: unknown;
|
|
22
|
+
invocation?: {
|
|
23
|
+
data?: unknown;
|
|
24
|
+
context?: unknown;
|
|
25
|
+
} | null;
|
|
26
|
+
}): DebugVariableScope[];
|
|
27
|
+
//# sourceMappingURL=debug-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-variables.d.ts","sourceRoot":"","sources":["../../src/lib/debug-variables.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9F,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,EAAE,CAAC;CAC9B,CAAC;AAMF,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAOrE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CAC7D,GAAG,kBAAkB,EAAE,CAiBvB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const MAX_DEPTH = 6;
|
|
2
|
+
const MAX_CHILDREN = 80;
|
|
3
|
+
const PREVIEW_CHARS = 80;
|
|
4
|
+
/** Parse a payload column. A string that is JSON becomes the value; anything else stays a string. */
|
|
5
|
+
export function DecodePayload(raw) {
|
|
6
|
+
if (raw == null || raw === '')
|
|
7
|
+
return undefined;
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(raw);
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return raw;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function BuildVariableScopes(args) {
|
|
16
|
+
const scopes = [];
|
|
17
|
+
const inputVars = asObjectVars(args.input);
|
|
18
|
+
if (inputVars.length > 0)
|
|
19
|
+
scopes.push({ Name: 'Input', Variables: inputVars });
|
|
20
|
+
const outputVars = asObjectVars(args.output);
|
|
21
|
+
if (outputVars.length > 0)
|
|
22
|
+
scopes.push({ Name: 'Output', Variables: outputVars });
|
|
23
|
+
const inv = args.invocation;
|
|
24
|
+
if (inv && (inv.data !== undefined || inv.context !== undefined)) {
|
|
25
|
+
scopes.push({
|
|
26
|
+
Name: 'Invocation',
|
|
27
|
+
Variables: [
|
|
28
|
+
toVariable('data', inv.data, 0),
|
|
29
|
+
toVariable('context', inv.context, 0),
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return scopes;
|
|
34
|
+
}
|
|
35
|
+
function asObjectVars(value) {
|
|
36
|
+
if (value == null)
|
|
37
|
+
return [];
|
|
38
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
39
|
+
return Object.entries(value).map(([k, v]) => toVariable(k, v, 0));
|
|
40
|
+
}
|
|
41
|
+
return [toVariable('(value)', value, 0)];
|
|
42
|
+
}
|
|
43
|
+
function toVariable(name, value, depth) {
|
|
44
|
+
const kind = kindOf(value);
|
|
45
|
+
return {
|
|
46
|
+
Name: name,
|
|
47
|
+
Preview: previewOf(value, kind),
|
|
48
|
+
Kind: kind,
|
|
49
|
+
Children: depth >= MAX_DEPTH ? [] : childrenOf(value, kind, depth + 1),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function kindOf(value) {
|
|
53
|
+
if (value === null || value === undefined)
|
|
54
|
+
return 'null';
|
|
55
|
+
if (Array.isArray(value))
|
|
56
|
+
return 'array';
|
|
57
|
+
if (typeof value === 'object')
|
|
58
|
+
return 'object';
|
|
59
|
+
if (typeof value === 'number')
|
|
60
|
+
return 'number';
|
|
61
|
+
if (typeof value === 'boolean')
|
|
62
|
+
return 'boolean';
|
|
63
|
+
return 'string';
|
|
64
|
+
}
|
|
65
|
+
function previewOf(value, kind) {
|
|
66
|
+
switch (kind) {
|
|
67
|
+
case 'null':
|
|
68
|
+
return value === undefined ? 'undefined' : 'null';
|
|
69
|
+
case 'boolean':
|
|
70
|
+
case 'number':
|
|
71
|
+
return String(value);
|
|
72
|
+
case 'string': {
|
|
73
|
+
const text = String(value);
|
|
74
|
+
return text.length > PREVIEW_CHARS ? `"${text.slice(0, PREVIEW_CHARS)}…"` : `"${text}"`;
|
|
75
|
+
}
|
|
76
|
+
case 'array':
|
|
77
|
+
return `Array(${value.length})`;
|
|
78
|
+
case 'object': {
|
|
79
|
+
const keys = Object.keys(value);
|
|
80
|
+
return `{${keys.length} ${keys.length === 1 ? 'key' : 'keys'}}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function childrenOf(value, kind, depth) {
|
|
85
|
+
if (kind === 'array') {
|
|
86
|
+
const items = value;
|
|
87
|
+
return items.slice(0, MAX_CHILDREN).map((item, i) => toVariable(String(i), item, depth));
|
|
88
|
+
}
|
|
89
|
+
if (kind === 'object') {
|
|
90
|
+
return Object.entries(value)
|
|
91
|
+
.slice(0, MAX_CHILDREN)
|
|
92
|
+
.map(([k, v]) => toVariable(k, v, depth));
|
|
93
|
+
}
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=debug-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-variables.js","sourceRoot":"","sources":["../../src/lib/debug-variables.ts"],"names":[],"mappings":"AAmBA,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,qGAAqG;AACrG,MAAM,UAAU,aAAa,CAAC,GAA8B;IACxD,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAChD,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,GAAG,CAAC;IACf,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAInC;IACG,MAAM,MAAM,GAAyB,EAAE,CAAC;IACxC,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,IAAI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IAAI,IAAI,GAAG,CAAC;QAC5F,CAAC;QACD,KAAK,OAAO;YACR,OAAO,SAAU,KAAmB,CAAC,MAAM,GAAG,CAAC;QACnD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAgC,CAAC,CAAC;YAC3D,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;QACpE,CAAC;IACL,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,KAAc,EAAE,IAAuB,EAAE,KAAa;IACtE,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,KAAkB,CAAC;QACjC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7F,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC;aAClD,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC;aACtB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC","sourcesContent":["/**\n * VS Code VARIABLES-style tree for a step's input / output / invocation.\n *\n * Pure: hosts pass JSON strings or already-parsed values; this never fetches.\n */\nexport type DebugVariableKind = 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';\n\nexport type DebugVariable = {\n Name: string;\n Preview: string;\n Kind: DebugVariableKind;\n Children: DebugVariable[];\n};\n\nexport type DebugVariableScope = {\n Name: string;\n Variables: DebugVariable[];\n};\n\nconst MAX_DEPTH = 6;\nconst MAX_CHILDREN = 80;\nconst PREVIEW_CHARS = 80;\n\n/** Parse a payload column. A string that is JSON becomes the value; anything else stays a string. */\nexport function DecodePayload(raw: string | null | undefined): unknown {\n if (raw == null || raw === '') return undefined;\n try {\n return JSON.parse(raw);\n } catch {\n return raw;\n }\n}\n\nexport function BuildVariableScopes(args: {\n input?: unknown;\n output?: unknown;\n invocation?: { data?: unknown; context?: unknown } | null;\n}): DebugVariableScope[] {\n const scopes: DebugVariableScope[] = [];\n const inputVars = asObjectVars(args.input);\n if (inputVars.length > 0) scopes.push({ Name: 'Input', Variables: inputVars });\n const outputVars = asObjectVars(args.output);\n if (outputVars.length > 0) scopes.push({ Name: 'Output', Variables: outputVars });\n const inv = args.invocation;\n if (inv && (inv.data !== undefined || inv.context !== undefined)) {\n scopes.push({\n Name: 'Invocation',\n Variables: [\n toVariable('data', inv.data, 0),\n toVariable('context', inv.context, 0),\n ],\n });\n }\n return scopes;\n}\n\nfunction asObjectVars(value: unknown): DebugVariable[] {\n if (value == null) return [];\n if (typeof value === 'object' && !Array.isArray(value)) {\n return Object.entries(value as Record<string, unknown>).map(([k, v]) => toVariable(k, v, 0));\n }\n return [toVariable('(value)', value, 0)];\n}\n\nfunction toVariable(name: string, value: unknown, depth: number): DebugVariable {\n const kind = kindOf(value);\n return {\n Name: name,\n Preview: previewOf(value, kind),\n Kind: kind,\n Children: depth >= MAX_DEPTH ? [] : childrenOf(value, kind, depth + 1),\n };\n}\n\nfunction kindOf(value: unknown): DebugVariableKind {\n if (value === null || value === undefined) return 'null';\n if (Array.isArray(value)) return 'array';\n if (typeof value === 'object') return 'object';\n if (typeof value === 'number') return 'number';\n if (typeof value === 'boolean') return 'boolean';\n return 'string';\n}\n\nfunction previewOf(value: unknown, kind: DebugVariableKind): string {\n switch (kind) {\n case 'null':\n return value === undefined ? 'undefined' : 'null';\n case 'boolean':\n case 'number':\n return String(value);\n case 'string': {\n const text = String(value);\n return text.length > PREVIEW_CHARS ? `\"${text.slice(0, PREVIEW_CHARS)}…\"` : `\"${text}\"`;\n }\n case 'array':\n return `Array(${(value as unknown[]).length})`;\n case 'object': {\n const keys = Object.keys(value as Record<string, unknown>);\n return `{${keys.length} ${keys.length === 1 ? 'key' : 'keys'}}`;\n }\n }\n}\n\nfunction childrenOf(value: unknown, kind: DebugVariableKind, depth: number): DebugVariable[] {\n if (kind === 'array') {\n const items = value as unknown[];\n return items.slice(0, MAX_CHILDREN).map((item, i) => toVariable(String(i), item, depth));\n }\n if (kind === 'object') {\n return Object.entries(value as Record<string, unknown>)\n .slice(0, MAX_CHILDREN)\n .map(([k, v]) => toVariable(k, v, depth));\n }\n return [];\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two-pane percentage pairs for angular-split, validated before they are stored or restored.
|
|
3
|
+
*
|
|
4
|
+
* A stored 0% or `'*'` pair would come back as a pane the user cannot grab. Falling back to the
|
|
5
|
+
* default is always recoverable, so an unreadable preference is treated as no preference.
|
|
6
|
+
*/
|
|
7
|
+
export type PaneSizePair = [number, number];
|
|
8
|
+
export declare function AsPaneSizePair(value: unknown): PaneSizePair | null;
|
|
9
|
+
export declare function ReadPaneSizePair(raw: string | undefined): PaneSizePair | null;
|
|
10
|
+
export declare function ToPaneSizePair(sizes: readonly (number | '*')[]): PaneSizePair | null;
|
|
11
|
+
//# sourceMappingURL=pane-split.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pane-split.d.ts","sourceRoot":"","sources":["../../src/lib/pane-split.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAI5C,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAOlE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,IAAI,CAO7E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,YAAY,GAAG,IAAI,CAIpF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two-pane percentage pairs for angular-split, validated before they are stored or restored.
|
|
3
|
+
*
|
|
4
|
+
* A stored 0% or `'*'` pair would come back as a pane the user cannot grab. Falling back to the
|
|
5
|
+
* default is always recoverable, so an unreadable preference is treated as no preference.
|
|
6
|
+
*/
|
|
7
|
+
const MIN_USABLE_PERCENT = 5;
|
|
8
|
+
export function AsPaneSizePair(value) {
|
|
9
|
+
if (!Array.isArray(value) || value.length !== 2)
|
|
10
|
+
return null;
|
|
11
|
+
const [a, b] = value;
|
|
12
|
+
if (typeof a !== 'number' || typeof b !== 'number')
|
|
13
|
+
return null;
|
|
14
|
+
if (!Number.isFinite(a) || !Number.isFinite(b))
|
|
15
|
+
return null;
|
|
16
|
+
if (a < MIN_USABLE_PERCENT || b < MIN_USABLE_PERCENT)
|
|
17
|
+
return null;
|
|
18
|
+
return [a, b];
|
|
19
|
+
}
|
|
20
|
+
export function ReadPaneSizePair(raw) {
|
|
21
|
+
if (!raw)
|
|
22
|
+
return null;
|
|
23
|
+
try {
|
|
24
|
+
return AsPaneSizePair(JSON.parse(raw));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function ToPaneSizePair(sizes) {
|
|
31
|
+
if (sizes.length !== 2)
|
|
32
|
+
return null;
|
|
33
|
+
const [a, b] = sizes;
|
|
34
|
+
return typeof a === 'number' && typeof b === 'number' ? [a, b] : null;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=pane-split.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Two-pane percentage pairs for angular-split, validated before they are stored or restored.\n *\n * A stored 0% or `'*'` pair would come back as a pane the user cannot grab. Falling back to the\n * default is always recoverable, so an unreadable preference is treated as no preference.\n */\n\nexport type PaneSizePair = [number, number];\n\nconst MIN_USABLE_PERCENT = 5;\n\nexport function AsPaneSizePair(value: unknown): PaneSizePair | null {\n if (!Array.isArray(value) || value.length !== 2) return null;\n const [a, b] = value;\n if (typeof a !== 'number' || typeof b !== 'number') return null;\n if (!Number.isFinite(a) || !Number.isFinite(b)) return null;\n if (a < MIN_USABLE_PERCENT || b < MIN_USABLE_PERCENT) return null;\n return [a, b];\n}\n\nexport function ReadPaneSizePair(raw: string | undefined): PaneSizePair | null {\n if (!raw) return null;\n try {\n return AsPaneSizePair(JSON.parse(raw));\n } catch {\n return null;\n }\n}\n\nexport function ToPaneSizePair(sizes: readonly (number | '*')[]): PaneSizePair | null {\n if (sizes.length !== 2) return null;\n const [a, b] = sizes;\n return typeof a === 'number' && typeof b === 'number' ? [a, b] : null;\n}\n"]}
|