@memberjunction/ng-agents 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.
@@ -0,0 +1,552 @@
1
+ /**
2
+ * @fileoverview "Everywhere this agent runs without anyone pressing Run."
3
+ *
4
+ * **The gap this closes.** MJ has never lacked ways to invoke an agent automatically — Scheduled
5
+ * Jobs, User Routines, Entity Action bindings, Record Processes, a Sub-Agent step inside another
6
+ * agent's flow. What it lacked was the *inverse* index. Every one of those substrates knows which
7
+ * agent it calls; none of them can be asked the question from the other end, so standing on an agent
8
+ * record there was no way to learn what fires it short of checking five admin surfaces by hand. In
9
+ * practice that means nobody checked — and an agent quietly running on a schedule somebody set up
10
+ * months ago is exactly the thing an owner needs to see first.
11
+ *
12
+ * **Read-only, by design.** This surface answers a question; it does not change any answer. Editing
13
+ * a schedule belongs in Scheduling, editing a binding belongs in Entity Actions, and putting a
14
+ * second editor here would be a second set of rules about what a valid trigger is. Every row instead
15
+ * emits {@link AgentInvocationsComponent.RecordOpenRequested} so the host can navigate to the
16
+ * substrate that owns it.
17
+ *
18
+ * **Layer: `widgets`.** No Router, no `NavigationService`, no global provider. Navigation leaves as
19
+ * intent; data is read through `this.ProviderToUse`.
20
+ *
21
+ * @module @memberjunction/ng-agents
22
+ */
23
+ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, } from '@angular/core';
24
+ import { RunView } from '@memberjunction/core';
25
+ import { BaseAngularComponent } from '@memberjunction/ng-base-types';
26
+ import { DescribeCron, DescribeInvocationTypes, DescribeWhen, GroupInvocations, IsUUID, ResolveInvocationState, SummarizeInvocations, } from './agent-invocations.model';
27
+ import * as i0 from "@angular/core";
28
+ import * as i1 from "@angular/common";
29
+ import * as i2 from "@memberjunction/ng-ui-components";
30
+ import * as i3 from "@memberjunction/ng-shared-generic";
31
+ const _forTrack0 = ($index, $item) => $item.Kind;
32
+ function AgentInvocationsComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
33
+ i0.ɵɵelement(0, "mj-loading", 1);
34
+ } }
35
+ function AgentInvocationsComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
36
+ i0.ɵɵelement(0, "mj-alert", 2);
37
+ } if (rf & 2) {
38
+ const ctx_r0 = i0.ɵɵnextContext();
39
+ i0.ɵɵproperty("Message", ctx_r0.LoadError);
40
+ } }
41
+ function AgentInvocationsComponent_Conditional_3_Conditional_10_Template(rf, ctx) { if (rf & 1) {
42
+ i0.ɵɵelement(0, "mj-empty-state", 11);
43
+ } }
44
+ function AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_1_Template(rf, ctx) { if (rf & 1) {
45
+ const _r3 = i0.ɵɵgetCurrentView();
46
+ i0.ɵɵelementStart(0, "button", 28);
47
+ i0.ɵɵlistener("click", function AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const pathway_r4 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r0.OnRowActivated(pathway_r4)); });
48
+ i0.ɵɵelementStart(1, "span", 29);
49
+ i0.ɵɵtext(2);
50
+ i0.ɵɵelementEnd();
51
+ i0.ɵɵelementStart(3, "span", 30);
52
+ i0.ɵɵtext(4);
53
+ i0.ɵɵelementEnd()();
54
+ } if (rf & 2) {
55
+ const pathway_r4 = i0.ɵɵnextContext().$implicit;
56
+ i0.ɵɵproperty("title", "Open " + pathway_r4.Title);
57
+ i0.ɵɵadvance(2);
58
+ i0.ɵɵtextInterpolate(pathway_r4.Title);
59
+ i0.ɵɵadvance(2);
60
+ i0.ɵɵtextInterpolate(pathway_r4.Trigger);
61
+ } }
62
+ function AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_2_Template(rf, ctx) { if (rf & 1) {
63
+ i0.ɵɵelementStart(0, "div", 23)(1, "span", 29);
64
+ i0.ɵɵtext(2);
65
+ i0.ɵɵelementEnd();
66
+ i0.ɵɵelementStart(3, "span", 30);
67
+ i0.ɵɵtext(4);
68
+ i0.ɵɵelementEnd()();
69
+ } if (rf & 2) {
70
+ const pathway_r4 = i0.ɵɵnextContext().$implicit;
71
+ i0.ɵɵadvance(2);
72
+ i0.ɵɵtextInterpolate(pathway_r4.Title);
73
+ i0.ɵɵadvance(2);
74
+ i0.ɵɵtextInterpolate(pathway_r4.Trigger);
75
+ } }
76
+ function AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_4_Template(rf, ctx) { if (rf & 1) {
77
+ i0.ɵɵelementStart(0, "span", 25);
78
+ i0.ɵɵelement(1, "i", 31);
79
+ i0.ɵɵtext(2);
80
+ i0.ɵɵelementEnd();
81
+ } if (rf & 2) {
82
+ i0.ɵɵadvance(2);
83
+ i0.ɵɵtextInterpolate1(" ", ctx, " ");
84
+ } }
85
+ function AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_5_Template(rf, ctx) { if (rf & 1) {
86
+ i0.ɵɵelementStart(0, "span", 26);
87
+ i0.ɵɵelement(1, "i", 32);
88
+ i0.ɵɵtext(2);
89
+ i0.ɵɵelementEnd();
90
+ } if (rf & 2) {
91
+ i0.ɵɵadvance(2);
92
+ i0.ɵɵtextInterpolate1(" ", ctx, " ");
93
+ } }
94
+ function AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Template(rf, ctx) { if (rf & 1) {
95
+ i0.ɵɵelementStart(0, "li", 21);
96
+ i0.ɵɵconditionalCreate(1, AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_1_Template, 5, 3, "button", 22)(2, AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_2_Template, 5, 2, "div", 23);
97
+ i0.ɵɵelementStart(3, "div", 24);
98
+ i0.ɵɵconditionalCreate(4, AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_4_Template, 3, 1, "span", 25);
99
+ i0.ɵɵconditionalCreate(5, AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Conditional_5_Template, 3, 1, "span", 26);
100
+ i0.ɵɵelementStart(6, "span", 27);
101
+ i0.ɵɵtext(7);
102
+ i0.ɵɵelementEnd()()();
103
+ } if (rf & 2) {
104
+ let tmp_24_0;
105
+ let tmp_25_0;
106
+ const pathway_r4 = ctx.$implicit;
107
+ const ctx_r0 = i0.ɵɵnextContext(4);
108
+ i0.ɵɵclassProp("mj-agent-inv__row--muted", pathway_r4.State !== "Live");
109
+ i0.ɵɵadvance();
110
+ i0.ɵɵconditional(pathway_r4.EntityName && pathway_r4.RecordID ? 1 : 2);
111
+ i0.ɵɵadvance(3);
112
+ i0.ɵɵconditional((tmp_24_0 = ctx_r0.When(pathway_r4.NextRunAt)) ? 4 : -1, tmp_24_0);
113
+ i0.ɵɵadvance();
114
+ i0.ɵɵconditional((tmp_25_0 = ctx_r0.When(pathway_r4.LastRunAt)) ? 5 : -1, tmp_25_0);
115
+ i0.ɵɵadvance();
116
+ i0.ɵɵclassProp("mj-agent-inv__state--live", pathway_r4.State === "Live")("mj-agent-inv__state--paused", pathway_r4.State === "Paused");
117
+ i0.ɵɵproperty("title", pathway_r4.StateDetail || "This can fire right now");
118
+ i0.ɵɵadvance();
119
+ i0.ɵɵtextInterpolate1(" ", pathway_r4.State, " ");
120
+ } }
121
+ function AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_Template(rf, ctx) { if (rf & 1) {
122
+ i0.ɵɵelementStart(0, "section", 13)(1, "header", 14)(2, "span", 15);
123
+ i0.ɵɵelement(3, "i", 16);
124
+ i0.ɵɵelementEnd();
125
+ i0.ɵɵelementStart(4, "div", 17)(5, "h3");
126
+ i0.ɵɵtext(6);
127
+ i0.ɵɵelementEnd();
128
+ i0.ɵɵelementStart(7, "p");
129
+ i0.ɵɵtext(8);
130
+ i0.ɵɵelementEnd()();
131
+ i0.ɵɵelementStart(9, "span", 18);
132
+ i0.ɵɵtext(10);
133
+ i0.ɵɵelementEnd()();
134
+ i0.ɵɵelementStart(11, "ul", 19);
135
+ i0.ɵɵrepeaterCreate(12, AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_For_13_Template, 8, 11, "li", 20, i0.ɵɵrepeaterTrackByIndex);
136
+ i0.ɵɵelementEnd()();
137
+ } if (rf & 2) {
138
+ const group_r5 = ctx.$implicit;
139
+ i0.ɵɵadvance(3);
140
+ i0.ɵɵclassMap(group_r5.Icon);
141
+ i0.ɵɵadvance(3);
142
+ i0.ɵɵtextInterpolate(group_r5.Label);
143
+ i0.ɵɵadvance(2);
144
+ i0.ɵɵtextInterpolate(group_r5.Blurb);
145
+ i0.ɵɵadvance();
146
+ i0.ɵɵclassProp("mj-agent-inv__group-count--live", group_r5.LiveCount > 0);
147
+ i0.ɵɵproperty("title", group_r5.LiveCount + " of " + group_r5.Pathways.length + " can fire right now");
148
+ i0.ɵɵadvance();
149
+ i0.ɵɵtextInterpolate2(" ", group_r5.LiveCount, "/", group_r5.Pathways.length, " ");
150
+ i0.ɵɵadvance(2);
151
+ i0.ɵɵrepeater(group_r5.Pathways);
152
+ } }
153
+ function AgentInvocationsComponent_Conditional_3_Conditional_11_Template(rf, ctx) { if (rf & 1) {
154
+ i0.ɵɵelementStart(0, "div", 12);
155
+ i0.ɵɵrepeaterCreate(1, AgentInvocationsComponent_Conditional_3_Conditional_11_For_2_Template, 14, 9, "section", 13, _forTrack0);
156
+ i0.ɵɵelementEnd();
157
+ } if (rf & 2) {
158
+ const ctx_r0 = i0.ɵɵnextContext(2);
159
+ i0.ɵɵadvance();
160
+ i0.ɵɵrepeater(ctx_r0.Groups);
161
+ } }
162
+ function AgentInvocationsComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
163
+ const _r2 = i0.ɵɵgetCurrentView();
164
+ i0.ɵɵelementStart(0, "div", 3)(1, "span", 4);
165
+ i0.ɵɵelement(2, "i", 5);
166
+ i0.ɵɵelementEnd();
167
+ i0.ɵɵelementStart(3, "div", 6)(4, "span", 7);
168
+ i0.ɵɵtext(5);
169
+ i0.ɵɵelementEnd();
170
+ i0.ɵɵelementStart(6, "span", 8);
171
+ i0.ɵɵtext(7, " Manual runs are not listed \u2014 this is only what happens without anyone present. ");
172
+ i0.ɵɵelementEnd()();
173
+ i0.ɵɵelementStart(8, "button", 9);
174
+ i0.ɵɵlistener("click", function AgentInvocationsComponent_Conditional_3_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Load()); });
175
+ i0.ɵɵelement(9, "i", 10);
176
+ i0.ɵɵelementEnd()();
177
+ i0.ɵɵconditionalCreate(10, AgentInvocationsComponent_Conditional_3_Conditional_10_Template, 1, 0, "mj-empty-state", 11)(11, AgentInvocationsComponent_Conditional_3_Conditional_11_Template, 3, 0, "div", 12);
178
+ } if (rf & 2) {
179
+ const ctx_r0 = i0.ɵɵnextContext();
180
+ i0.ɵɵclassProp("mj-agent-inv__summary--automated", ctx_r0.Summary.IsAutomated);
181
+ i0.ɵɵadvance(2);
182
+ i0.ɵɵproperty("ngClass", ctx_r0.Summary.IsAutomated ? "fa-tower-broadcast" : "fa-hand");
183
+ i0.ɵɵadvance(3);
184
+ i0.ɵɵtextInterpolate(ctx_r0.SummaryLine);
185
+ i0.ɵɵadvance(3);
186
+ i0.ɵɵproperty("disabled", ctx_r0.IsLoading);
187
+ i0.ɵɵadvance();
188
+ i0.ɵɵclassProp("fa-spin", ctx_r0.IsLoading);
189
+ i0.ɵɵadvance();
190
+ i0.ɵɵconditional(ctx_r0.Groups.length === 0 ? 10 : 11);
191
+ } }
192
+ /** Emitted when a row is activated. The host decides how to open it — this widget has no Router. */
193
+ export class AgentInvocationOpenRequestedEventArgs {
194
+ EntityName;
195
+ RecordID;
196
+ Pathway;
197
+ constructor(EntityName, RecordID, Pathway) {
198
+ this.EntityName = EntityName;
199
+ this.RecordID = RecordID;
200
+ this.Pathway = Pathway;
201
+ }
202
+ }
203
+ export class AgentInvocationsComponent extends BaseAngularComponent {
204
+ cdr;
205
+ /**
206
+ * The agent to index. Setter-based per repo convention — the reaction is explicit and runs only
207
+ * when the id actually changes, rather than on every change-detection pass.
208
+ */
209
+ set AgentID(value) {
210
+ if (value === this.agentID)
211
+ return;
212
+ this.agentID = value;
213
+ this.HasLoaded = false;
214
+ if (value && this.Active)
215
+ void this.Load();
216
+ }
217
+ get AgentID() {
218
+ return this.agentID;
219
+ }
220
+ /**
221
+ * Whether the surface is currently on screen.
222
+ *
223
+ * The host keeps this component alive across tab switches (so a return trip is instant), which
224
+ * means without this it would issue six queries for a tab nobody has opened. Flipping to true
225
+ * triggers the first load; flipping back does nothing.
226
+ */
227
+ set Active(value) {
228
+ this.active = value;
229
+ if (value && this.agentID && !this.HasLoaded && !this.IsLoading)
230
+ void this.Load();
231
+ }
232
+ get Active() {
233
+ return this.active;
234
+ }
235
+ /** The agent's own `ExposeAsAction` flag — a pathway that lives on the agent, not in another table. */
236
+ ExposeAsAction = false;
237
+ /** The agent's parent, when it is a child sub-agent. Named so the row can say who calls it. */
238
+ ParentAgentName = null;
239
+ ParentAgentID = null;
240
+ /** Intent only — the host navigates. */
241
+ RecordOpenRequested = new EventEmitter();
242
+ IsLoading = false;
243
+ HasLoaded = false;
244
+ LoadError = null;
245
+ Groups = [];
246
+ Summary = { Total: 0, Live: 0, IsAutomated: false, NextRunAt: null };
247
+ agentID = null;
248
+ active = false;
249
+ constructor(cdr) {
250
+ super();
251
+ this.cdr = cdr;
252
+ }
253
+ /**
254
+ * Rebuilds the index.
255
+ *
256
+ * Public so a host can offer Refresh, and so an agent-context tool can drive it — the same
257
+ * entry point either way, rather than a private loader plus a public wrapper that can drift.
258
+ */
259
+ async Load() {
260
+ const id = this.agentID;
261
+ if (!id || !IsUUID(id)) {
262
+ this.Groups = [];
263
+ this.Summary = SummarizeInvocations([]);
264
+ this.HasLoaded = true;
265
+ this.cdr.markForCheck();
266
+ return;
267
+ }
268
+ this.IsLoading = true;
269
+ this.LoadError = null;
270
+ this.cdr.markForCheck();
271
+ try {
272
+ const pathways = [
273
+ ...(await this.loadDirectPathways(id)),
274
+ ...(await this.loadDataChangePathways(id)),
275
+ ...this.loadAgentPathways(),
276
+ ];
277
+ this.Groups = GroupInvocations(pathways);
278
+ this.Summary = SummarizeInvocations(pathways);
279
+ this.HasLoaded = true;
280
+ }
281
+ catch (e) {
282
+ this.LoadError = e instanceof Error ? e.message : String(e);
283
+ this.Groups = [];
284
+ this.Summary = SummarizeInvocations([]);
285
+ }
286
+ finally {
287
+ this.IsLoading = false;
288
+ this.cdr.markForCheck();
289
+ }
290
+ }
291
+ /**
292
+ * The four substrates that name the agent by id on their own row, in one round trip.
293
+ *
294
+ * Batched through `RunViews` rather than four awaited calls: this is one screen, and four
295
+ * sequential round trips is the difference between a tab that opens and a tab that loads.
296
+ */
297
+ async loadDirectPathways(agentID) {
298
+ const rv = RunView.FromMetadataProvider(this.ProviderToUse);
299
+ const [jobs, routines, processes, steps, relationships] = await rv.RunViews([
300
+ {
301
+ EntityName: 'MJ: Scheduled Jobs',
302
+ // `Configuration` is free-form JSON, so there is no column to equal. The id is
303
+ // UUID-checked above, which is what makes this concatenation safe.
304
+ ExtraFilter: `Configuration LIKE '%${agentID}%'`,
305
+ OrderBy: 'Name ASC',
306
+ ResultType: 'entity_object',
307
+ },
308
+ {
309
+ EntityName: 'MJ: User Routines',
310
+ ExtraFilter: `TargetType='Agent' AND TargetID='${agentID}'`,
311
+ OrderBy: 'Name ASC',
312
+ ResultType: 'entity_object',
313
+ },
314
+ {
315
+ EntityName: 'MJ: Record Processes',
316
+ ExtraFilter: `WorkType='Agent' AND AgentID='${agentID}'`,
317
+ OrderBy: 'Name ASC',
318
+ ResultType: 'entity_object',
319
+ },
320
+ {
321
+ EntityName: 'MJ: AI Agent Steps',
322
+ ExtraFilter: `SubAgentID='${agentID}'`,
323
+ OrderBy: 'Name ASC',
324
+ ResultType: 'entity_object',
325
+ },
326
+ {
327
+ EntityName: 'MJ: AI Agent Relationships',
328
+ ExtraFilter: `SubAgentID='${agentID}'`,
329
+ ResultType: 'entity_object',
330
+ },
331
+ ]);
332
+ const out = [];
333
+ if (jobs.Success) {
334
+ for (const job of jobs.Results) {
335
+ out.push({
336
+ Kind: 'Schedule',
337
+ Title: job.Name,
338
+ Trigger: DescribeCron(job.CronExpression, job.Timezone),
339
+ State: ResolveInvocationState(job.Status),
340
+ StateDetail: this.explainState(job.Status),
341
+ EntityName: 'MJ: Scheduled Jobs',
342
+ RecordID: job.ID,
343
+ LastRunAt: job.LastRunAt,
344
+ NextRunAt: job.NextRunAt,
345
+ });
346
+ }
347
+ }
348
+ if (routines.Success) {
349
+ for (const routine of routines.Results) {
350
+ out.push({
351
+ Kind: 'Routine',
352
+ Title: routine.Name,
353
+ // A Monitoring routine still runs on a cron; what differs is that it only speaks
354
+ // up when its condition holds, which is worth saying rather than implying.
355
+ Trigger: routine.RoutineType === 'Monitoring'
356
+ ? `${DescribeCron(routine.CronExpression, routine.Timezone)} — reports only when something changed`
357
+ : DescribeCron(routine.CronExpression, routine.Timezone),
358
+ State: ResolveInvocationState(routine.Status),
359
+ StateDetail: this.explainState(routine.Status),
360
+ EntityName: 'MJ: User Routines',
361
+ RecordID: routine.ID,
362
+ LastRunAt: routine.LastRunAt,
363
+ NextRunAt: routine.NextRunAt,
364
+ });
365
+ }
366
+ }
367
+ if (processes.Success) {
368
+ for (const process of processes.Results) {
369
+ out.push({
370
+ Kind: 'BulkOperation',
371
+ Title: process.Name,
372
+ Trigger: `Across ${process.Entity} records, when the operation is run`,
373
+ State: ResolveInvocationState(process.Status),
374
+ StateDetail: this.explainState(process.Status),
375
+ EntityName: 'MJ: Record Processes',
376
+ RecordID: process.ID,
377
+ });
378
+ }
379
+ }
380
+ if (steps.Success) {
381
+ for (const step of steps.Results) {
382
+ out.push({
383
+ Kind: 'CalledByAgent',
384
+ Title: step.Agent ?? 'Another agent',
385
+ Trigger: `As the "${step.Name}" step`,
386
+ State: ResolveInvocationState(step.Status),
387
+ StateDetail: this.explainState(step.Status),
388
+ // The step's owner is what someone wants to open, not the step row — the step is
389
+ // only reachable, and only meaningful, inside that agent's editor.
390
+ EntityName: 'MJ: AI Agents',
391
+ RecordID: step.AgentID,
392
+ });
393
+ }
394
+ }
395
+ if (relationships.Success) {
396
+ for (const rel of relationships.Results) {
397
+ out.push({
398
+ Kind: 'CalledByAgent',
399
+ Title: rel.Agent ?? 'Another agent',
400
+ Trigger: 'As a related sub-agent',
401
+ State: ResolveInvocationState(rel.Status),
402
+ StateDetail: this.explainState(rel.Status),
403
+ EntityName: 'MJ: AI Agents',
404
+ RecordID: rel.AgentID,
405
+ });
406
+ }
407
+ }
408
+ return out;
409
+ }
410
+ /**
411
+ * Entity-change bindings, which name the agent one table further out.
412
+ *
413
+ * An Entity Action does not reference an agent; it references the `Execute Agent` action, and the
414
+ * agent lives in that binding's `AgentID` **parameter**. So this walks params → bindings →
415
+ * invocation types. Three steps, but each one is a single batched query, and skipping straight to
416
+ * the bindings would find every agent-dispatching binding rather than this agent's.
417
+ */
418
+ async loadDataChangePathways(agentID) {
419
+ const rv = RunView.FromMetadataProvider(this.ProviderToUse);
420
+ const params = await rv.RunView({
421
+ EntityName: 'MJ: Entity Action Params',
422
+ ExtraFilter: `ActionParam='AgentID' AND Value='${agentID}'`,
423
+ ResultType: 'entity_object',
424
+ });
425
+ if (!params.Success || (params.Results ?? []).length === 0)
426
+ return [];
427
+ const bindingIDs = [...new Set((params.Results ?? []).map((p) => p.EntityActionID))].filter(IsUUID);
428
+ if (bindingIDs.length === 0)
429
+ return [];
430
+ const idList = bindingIDs.map((id) => `'${id}'`).join(',');
431
+ const [bindings, invocations] = await rv.RunViews([
432
+ {
433
+ EntityName: 'MJ: Entity Actions',
434
+ ExtraFilter: `ID IN (${idList})`,
435
+ ResultType: 'entity_object',
436
+ },
437
+ {
438
+ EntityName: 'MJ: Entity Action Invocations',
439
+ ExtraFilter: `EntityActionID IN (${idList})`,
440
+ ResultType: 'entity_object',
441
+ },
442
+ ]);
443
+ if (!bindings.Success)
444
+ return [];
445
+ const invocationsByBinding = new Map();
446
+ if (invocations.Success) {
447
+ for (const inv of invocations.Results) {
448
+ const list = invocationsByBinding.get(inv.EntityActionID) ?? [];
449
+ list.push(inv);
450
+ invocationsByBinding.set(inv.EntityActionID, list);
451
+ }
452
+ }
453
+ return bindings.Results.map((binding) => {
454
+ // Only the ACTIVE invocation types describe when this actually fires. Including disabled
455
+ // ones would tell someone the agent runs on delete when that hook is switched off.
456
+ const live = (invocationsByBinding.get(binding.ID) ?? []).filter((i) => i.Status === 'Active');
457
+ return {
458
+ Kind: 'DataChange',
459
+ Title: binding.Entity,
460
+ Trigger: DescribeInvocationTypes(live.map((i) => i.InvocationType)),
461
+ State: ResolveInvocationState(binding.Status),
462
+ StateDetail: this.explainState(binding.Status),
463
+ EntityName: 'MJ: Entity Actions',
464
+ RecordID: binding.ID,
465
+ };
466
+ });
467
+ }
468
+ /** The pathways carried on the agent's own record rather than in another table. */
469
+ loadAgentPathways() {
470
+ const out = [];
471
+ if (this.ExposeAsAction) {
472
+ out.push({
473
+ Kind: 'ExposedAsAction',
474
+ Title: 'Exposed as an action',
475
+ Trigger: 'Any action caller — another agent, a binding, an integration — can run this',
476
+ State: 'Live',
477
+ });
478
+ }
479
+ if (this.ParentAgentName) {
480
+ out.push({
481
+ Kind: 'CalledByAgent',
482
+ Title: this.ParentAgentName,
483
+ Trigger: 'As a child sub-agent',
484
+ State: 'Live',
485
+ EntityName: this.ParentAgentID ? 'MJ: AI Agents' : undefined,
486
+ RecordID: this.ParentAgentID ?? undefined,
487
+ });
488
+ }
489
+ return out;
490
+ }
491
+ /** Says why a pathway will not fire. Returns undefined when it will — there is nothing to explain. */
492
+ explainState(status) {
493
+ const normalized = (status ?? '').trim();
494
+ switch (ResolveInvocationState(normalized)) {
495
+ case 'Live':
496
+ return undefined;
497
+ case 'Paused':
498
+ return 'Paused — it will not fire until someone resumes it';
499
+ default:
500
+ return normalized ? `${normalized} — it will not fire` : 'Switched off';
501
+ }
502
+ }
503
+ OnRowActivated(pathway) {
504
+ if (!pathway.EntityName || !pathway.RecordID)
505
+ return;
506
+ this.RecordOpenRequested.emit(new AgentInvocationOpenRequestedEventArgs(pathway.EntityName, pathway.RecordID, pathway));
507
+ }
508
+ /** Template helper — coarse relative time, computed at render rather than stored. */
509
+ When(value) {
510
+ return DescribeWhen(value, new Date());
511
+ }
512
+ /** Template helper: the header line, phrased for whichever case the agent is in. */
513
+ get SummaryLine() {
514
+ if (this.Summary.Total === 0) {
515
+ return 'Nothing runs this agent automatically — it only runs when someone asks it to.';
516
+ }
517
+ if (this.Summary.Live === 0) {
518
+ const n = this.Summary.Total;
519
+ return `${n} pathway${n === 1 ? '' : 's'} point here, but none of them can fire right now.`;
520
+ }
521
+ const next = this.When(this.Summary.NextRunAt);
522
+ const base = `${this.Summary.Live} of ${this.Summary.Total} pathway${this.Summary.Total === 1 ? '' : 's'} can run this agent without anyone asking`;
523
+ return next ? `${base}. Next scheduled run ${next}.` : `${base}.`;
524
+ }
525
+ static ɵfac = function AgentInvocationsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AgentInvocationsComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
526
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AgentInvocationsComponent, selectors: [["mj-agent-invocations"]], inputs: { AgentID: "AgentID", Active: "Active", ExposeAsAction: "ExposeAsAction", ParentAgentName: "ParentAgentName", ParentAgentID: "ParentAgentID" }, outputs: { RecordOpenRequested: "RecordOpenRequested" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 1, consts: [[1, "mj-agent-inv"], ["text", "Finding everywhere this agent is invoked...", "size", "medium"], ["Variant", "error", 3, "Message"], [1, "mj-agent-inv__summary"], [1, "mj-agent-inv__summary-icon"], ["aria-hidden", "true", 1, "fa-solid", 3, "ngClass"], [1, "mj-agent-inv__summary-text"], [1, "mj-agent-inv__summary-line"], [1, "mj-agent-inv__summary-hint"], ["mjButton", "", "variant", "outline", "size", "sm", "title", "Re-check every source", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-refresh"], ["Icon", "fa-solid fa-hand", "Title", "Nothing invokes this agent automatically", "Message", "Give it a schedule, bind it to a data change, or call it from another agent \u2014 and every one of those will show up here."], [1, "mj-agent-inv__groups"], [1, "mj-agent-inv__group"], [1, "mj-agent-inv__group-head"], [1, "mj-agent-inv__group-icon"], ["aria-hidden", "true"], [1, "mj-agent-inv__group-title"], [1, "mj-agent-inv__group-count", 3, "title"], [1, "mj-agent-inv__rows"], [1, "mj-agent-inv__row", 3, "mj-agent-inv__row--muted"], [1, "mj-agent-inv__row"], ["type", "button", 1, "mj-agent-inv__row-main", 3, "title"], [1, "mj-agent-inv__row-main", "mj-agent-inv__row-main--static"], [1, "mj-agent-inv__row-meta"], ["title", "Next run", 1, "mj-agent-inv__row-next"], ["title", "Last run", 1, "mj-agent-inv__row-last"], [1, "mj-agent-inv__state", 3, "title"], ["type", "button", 1, "mj-agent-inv__row-main", 3, "click", "title"], [1, "mj-agent-inv__row-title"], [1, "mj-agent-inv__row-trigger"], ["aria-hidden", "true", 1, "fa-solid", "fa-forward"], ["aria-hidden", "true", 1, "fa-solid", "fa-clock-rotate-left"]], template: function AgentInvocationsComponent_Template(rf, ctx) { if (rf & 1) {
527
+ i0.ɵɵelementStart(0, "div", 0);
528
+ i0.ɵɵconditionalCreate(1, AgentInvocationsComponent_Conditional_1_Template, 1, 0, "mj-loading", 1)(2, AgentInvocationsComponent_Conditional_2_Template, 1, 1, "mj-alert", 2)(3, AgentInvocationsComponent_Conditional_3_Template, 12, 8);
529
+ i0.ɵɵelementEnd();
530
+ } if (rf & 2) {
531
+ i0.ɵɵadvance();
532
+ i0.ɵɵconditional(ctx.IsLoading && !ctx.HasLoaded ? 1 : ctx.LoadError ? 2 : 3);
533
+ } }, dependencies: [i1.NgClass, i2.MJEmptyStateComponent, i2.MJAlertComponent, i2.MJButtonDirective, i3.LoadingComponent], styles: [".mj-agent-inv[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n}\n\n\n\n\n.mj-agent-inv__summary[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 14px;\n padding: 14px 16px;\n border: 1px solid var(--mj-border-default);\n border-left: 4px solid var(--mj-border-strong);\n border-radius: 8px;\n background: var(--mj-bg-surface-sunken);\n}\n\n\n\n.mj-agent-inv__summary--automated[_ngcontent-%COMP%] {\n border-left-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n}\n\n.mj-agent-inv__summary-icon[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n flex: 0 0 36px;\n border-radius: 50%;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 15px;\n}\n\n.mj-agent-inv__summary--automated[_ngcontent-%COMP%] .mj-agent-inv__summary-icon[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 35%, transparent);\n}\n\n.mj-agent-inv__summary-text[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.mj-agent-inv__summary-line[_ngcontent-%COMP%] {\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n\n.mj-agent-inv__summary-hint[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--mj-text-muted);\n}\n\n\n\n\n.mj-agent-inv__groups[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n.mj-agent-inv__group[_ngcontent-%COMP%] {\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface-card);\n overflow: hidden;\n}\n\n.mj-agent-inv__group-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 14px;\n border-bottom: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-sunken);\n}\n\n.mj-agent-inv__group-icon[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n flex: 0 0 28px;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n color: var(--mj-brand-primary);\n font-size: 13px;\n}\n\n.mj-agent-inv__group-title[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.mj-agent-inv__group-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n\n.mj-agent-inv__group-title[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 1px 0 0;\n font-size: 12px;\n color: var(--mj-text-muted);\n}\n\n.mj-agent-inv__group-count[_ngcontent-%COMP%] {\n flex: 0 0 auto;\n padding: 2px 9px;\n border-radius: 10px;\n background: var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 11px;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n}\n\n.mj-agent-inv__group-count--live[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-success) 16%, transparent);\n color: var(--mj-status-success);\n}\n\n\n\n\n.mj-agent-inv__rows[_ngcontent-%COMP%] {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.mj-agent-inv__row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 0 14px 0 0;\n border-bottom: 1px solid color-mix(in srgb, var(--mj-border-default) 60%, transparent);\n}\n\n.mj-agent-inv__row[_ngcontent-%COMP%]:last-child {\n border-bottom: none;\n}\n\n\n\n.mj-agent-inv__row--muted[_ngcontent-%COMP%] .mj-agent-inv__row-title[_ngcontent-%COMP%], \n.mj-agent-inv__row--muted[_ngcontent-%COMP%] .mj-agent-inv__row-trigger[_ngcontent-%COMP%] {\n color: var(--mj-text-disabled);\n}\n\n.mj-agent-inv__row-main[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n flex: 1 1 auto;\n min-width: 0;\n padding: 11px 14px;\n border: none;\n background: transparent;\n text-align: left;\n font: inherit;\n cursor: pointer;\n border-radius: 6px;\n}\n\n.mj-agent-inv__row-main--static[_ngcontent-%COMP%] {\n cursor: default;\n}\n\nbutton.mj-agent-inv__row-main[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 7%, transparent);\n}\n\nbutton.mj-agent-inv__row-main[_ngcontent-%COMP%]:focus-visible {\n outline: 2px solid var(--mj-brand-primary);\n outline-offset: -2px;\n}\n\n.mj-agent-inv__row-title[_ngcontent-%COMP%] {\n font-size: 13px;\n font-weight: 600;\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n.mj-agent-inv__row-trigger[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n.mj-agent-inv__row-meta[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 0 0 auto;\n font-size: 11px;\n color: var(--mj-text-muted);\n white-space: nowrap;\n}\n\n.mj-agent-inv__row-next[_ngcontent-%COMP%], \n.mj-agent-inv__row-last[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-agent-inv__state[_ngcontent-%COMP%] {\n padding: 2px 8px;\n border-radius: 10px;\n background: var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.03em;\n text-transform: uppercase;\n}\n\n.mj-agent-inv__state--live[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-success) 16%, transparent);\n color: var(--mj-status-success);\n}\n\n.mj-agent-inv__state--paused[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-warning) 18%, transparent);\n color: var(--mj-status-warning);\n}\n\n\n\n\n@media (max-width: 720px) {\n .mj-agent-inv__row[_ngcontent-%COMP%] {\n align-items: flex-start;\n flex-direction: column;\n gap: 0;\n padding-bottom: 10px;\n }\n\n .mj-agent-inv__row-meta[_ngcontent-%COMP%] {\n padding: 0 14px;\n flex-wrap: wrap;\n white-space: normal;\n }\n\n .mj-agent-inv__summary[_ngcontent-%COMP%] {\n flex-wrap: wrap;\n }\n}"], changeDetection: 0 });
534
+ }
535
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AgentInvocationsComponent, [{
536
+ type: Component,
537
+ args: [{ standalone: false, selector: 'mj-agent-invocations', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mj-agent-inv\">\n @if (IsLoading && !HasLoaded) {\n <mj-loading text=\"Finding everywhere this agent is invoked...\" size=\"medium\"></mj-loading>\n } @else if (LoadError) {\n <mj-alert Variant=\"error\" [Message]=\"LoadError\"></mj-alert>\n } @else {\n <!-- The one-glance answer. Stated as a sentence rather than a row of numbers, because the\n question this surface exists for (\"does this thing run on its own?\") has a yes/no shape. -->\n <div class=\"mj-agent-inv__summary\" [class.mj-agent-inv__summary--automated]=\"Summary.IsAutomated\">\n <span class=\"mj-agent-inv__summary-icon\">\n <i class=\"fa-solid\" [ngClass]=\"Summary.IsAutomated ? 'fa-tower-broadcast' : 'fa-hand'\" aria-hidden=\"true\"></i>\n </span>\n <div class=\"mj-agent-inv__summary-text\">\n <span class=\"mj-agent-inv__summary-line\">{{ SummaryLine }}</span>\n <span class=\"mj-agent-inv__summary-hint\">\n Manual runs are not listed \u2014 this is only what happens without anyone present.\n </span>\n </div>\n <button mjButton variant=\"outline\" size=\"sm\" (click)=\"Load()\" [disabled]=\"IsLoading\" title=\"Re-check every source\">\n <i class=\"fa-solid fa-refresh\" [class.fa-spin]=\"IsLoading\" aria-hidden=\"true\"></i>\n </button>\n </div>\n\n @if (Groups.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-hand\"\n Title=\"Nothing invokes this agent automatically\"\n Message=\"Give it a schedule, bind it to a data change, or call it from another agent \u2014 and every one of those will show up here.\">\n </mj-empty-state>\n } @else {\n <div class=\"mj-agent-inv__groups\">\n @for (group of Groups; track group.Kind) {\n <section class=\"mj-agent-inv__group\">\n <header class=\"mj-agent-inv__group-head\">\n <span class=\"mj-agent-inv__group-icon\"><i [class]=\"group.Icon\" aria-hidden=\"true\"></i></span>\n <div class=\"mj-agent-inv__group-title\">\n <h3>{{ group.Label }}</h3>\n <p>{{ group.Blurb }}</p>\n </div>\n <span\n class=\"mj-agent-inv__group-count\"\n [class.mj-agent-inv__group-count--live]=\"group.LiveCount > 0\"\n [title]=\"group.LiveCount + ' of ' + group.Pathways.length + ' can fire right now'\">\n {{ group.LiveCount }}/{{ group.Pathways.length }}\n </span>\n </header>\n\n <ul class=\"mj-agent-inv__rows\">\n @for (pathway of group.Pathways; track $index) {\n <li class=\"mj-agent-inv__row\" [class.mj-agent-inv__row--muted]=\"pathway.State !== 'Live'\">\n <!-- A row with a record behind it is a button so it is reachable by keyboard; one\n without (Exposed as an action is a flag, not a row) is plain text rather than a\n button that would look clickable and do nothing. -->\n @if (pathway.EntityName && pathway.RecordID) {\n <button type=\"button\" class=\"mj-agent-inv__row-main\" (click)=\"OnRowActivated(pathway)\"\n [title]=\"'Open ' + pathway.Title\">\n <span class=\"mj-agent-inv__row-title\">{{ pathway.Title }}</span>\n <span class=\"mj-agent-inv__row-trigger\">{{ pathway.Trigger }}</span>\n </button>\n } @else {\n <div class=\"mj-agent-inv__row-main mj-agent-inv__row-main--static\">\n <span class=\"mj-agent-inv__row-title\">{{ pathway.Title }}</span>\n <span class=\"mj-agent-inv__row-trigger\">{{ pathway.Trigger }}</span>\n </div>\n }\n\n <div class=\"mj-agent-inv__row-meta\">\n @if (When(pathway.NextRunAt); as next) {\n <span class=\"mj-agent-inv__row-next\" title=\"Next run\">\n <i class=\"fa-solid fa-forward\" aria-hidden=\"true\"></i> {{ next }}\n </span>\n }\n @if (When(pathway.LastRunAt); as last) {\n <span class=\"mj-agent-inv__row-last\" title=\"Last run\">\n <i class=\"fa-solid fa-clock-rotate-left\" aria-hidden=\"true\"></i> {{ last }}\n </span>\n }\n <span\n class=\"mj-agent-inv__state\"\n [class.mj-agent-inv__state--live]=\"pathway.State === 'Live'\"\n [class.mj-agent-inv__state--paused]=\"pathway.State === 'Paused'\"\n [title]=\"pathway.StateDetail || 'This can fire right now'\">\n {{ pathway.State }}\n </span>\n </div>\n </li>\n }\n </ul>\n </section>\n }\n </div>\n }\n }\n</div>\n", styles: [".mj-agent-inv {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n}\n\n/* \u2500\u2500 Summary banner \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.mj-agent-inv__summary {\n display: flex;\n align-items: center;\n gap: 14px;\n padding: 14px 16px;\n border: 1px solid var(--mj-border-default);\n border-left: 4px solid var(--mj-border-strong);\n border-radius: 8px;\n background: var(--mj-bg-surface-sunken);\n}\n\n/* An automated agent is the finding, not the default \u2014 the accent says \"look at this\". */\n.mj-agent-inv__summary--automated {\n border-left-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n}\n\n.mj-agent-inv__summary-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n flex: 0 0 36px;\n border-radius: 50%;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 15px;\n}\n\n.mj-agent-inv__summary--automated .mj-agent-inv__summary-icon {\n color: var(--mj-brand-primary);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 35%, transparent);\n}\n\n.mj-agent-inv__summary-text {\n display: flex;\n flex-direction: column;\n gap: 2px;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.mj-agent-inv__summary-line {\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n\n.mj-agent-inv__summary-hint {\n font-size: 12px;\n color: var(--mj-text-muted);\n}\n\n/* \u2500\u2500 Groups \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.mj-agent-inv__groups {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n.mj-agent-inv__group {\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface-card);\n overflow: hidden;\n}\n\n.mj-agent-inv__group-head {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 14px;\n border-bottom: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-sunken);\n}\n\n.mj-agent-inv__group-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n flex: 0 0 28px;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n color: var(--mj-brand-primary);\n font-size: 13px;\n}\n\n.mj-agent-inv__group-title {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.mj-agent-inv__group-title h3 {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n\n.mj-agent-inv__group-title p {\n margin: 1px 0 0;\n font-size: 12px;\n color: var(--mj-text-muted);\n}\n\n.mj-agent-inv__group-count {\n flex: 0 0 auto;\n padding: 2px 9px;\n border-radius: 10px;\n background: var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 11px;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n}\n\n.mj-agent-inv__group-count--live {\n background: color-mix(in srgb, var(--mj-status-success) 16%, transparent);\n color: var(--mj-status-success);\n}\n\n/* \u2500\u2500 Rows \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.mj-agent-inv__rows {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.mj-agent-inv__row {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 0 14px 0 0;\n border-bottom: 1px solid color-mix(in srgb, var(--mj-border-default) 60%, transparent);\n}\n\n.mj-agent-inv__row:last-child {\n border-bottom: none;\n}\n\n/* Not merely dimmed \u2014 a pathway that cannot fire should read as inert at a glance. */\n.mj-agent-inv__row--muted .mj-agent-inv__row-title,\n.mj-agent-inv__row--muted .mj-agent-inv__row-trigger {\n color: var(--mj-text-disabled);\n}\n\n.mj-agent-inv__row-main {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n flex: 1 1 auto;\n min-width: 0;\n padding: 11px 14px;\n border: none;\n background: transparent;\n text-align: left;\n font: inherit;\n cursor: pointer;\n border-radius: 6px;\n}\n\n.mj-agent-inv__row-main--static {\n cursor: default;\n}\n\nbutton.mj-agent-inv__row-main:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 7%, transparent);\n}\n\nbutton.mj-agent-inv__row-main:focus-visible {\n outline: 2px solid var(--mj-brand-primary);\n outline-offset: -2px;\n}\n\n.mj-agent-inv__row-title {\n font-size: 13px;\n font-weight: 600;\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n.mj-agent-inv__row-trigger {\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n.mj-agent-inv__row-meta {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 0 0 auto;\n font-size: 11px;\n color: var(--mj-text-muted);\n white-space: nowrap;\n}\n\n.mj-agent-inv__row-next,\n.mj-agent-inv__row-last {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-agent-inv__state {\n padding: 2px 8px;\n border-radius: 10px;\n background: var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.03em;\n text-transform: uppercase;\n}\n\n.mj-agent-inv__state--live {\n background: color-mix(in srgb, var(--mj-status-success) 16%, transparent);\n color: var(--mj-status-success);\n}\n\n.mj-agent-inv__state--paused {\n background: color-mix(in srgb, var(--mj-status-warning) 18%, transparent);\n color: var(--mj-status-warning);\n}\n\n/* \u2500\u2500 Narrow layouts \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n@media (max-width: 720px) {\n .mj-agent-inv__row {\n align-items: flex-start;\n flex-direction: column;\n gap: 0;\n padding-bottom: 10px;\n }\n\n .mj-agent-inv__row-meta {\n padding: 0 14px;\n flex-wrap: wrap;\n white-space: normal;\n }\n\n .mj-agent-inv__summary {\n flex-wrap: wrap;\n }\n}\n"] }]
538
+ }], () => [{ type: i0.ChangeDetectorRef }], { AgentID: [{
539
+ type: Input
540
+ }], Active: [{
541
+ type: Input
542
+ }], ExposeAsAction: [{
543
+ type: Input
544
+ }], ParentAgentName: [{
545
+ type: Input
546
+ }], ParentAgentID: [{
547
+ type: Input
548
+ }], RecordOpenRequested: [{
549
+ type: Output
550
+ }] }); })();
551
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AgentInvocationsComponent, { className: "AgentInvocationsComponent", filePath: "src/lib/components/agent-invocations.component.ts", lineNumber: 72 }); })();
552
+ //# sourceMappingURL=agent-invocations.component.js.map