@mastra/playground-ui 66.0.0 → 66.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/domains/traces/components/format-trace-thread-messages.cjs.js +52 -0
  2. package/dist/domains/traces/components/format-trace-thread-messages.cjs.js.map +1 -1
  3. package/dist/domains/traces/components/format-trace-thread-messages.es.js +51 -1
  4. package/dist/domains/traces/components/format-trace-thread-messages.es.js.map +1 -1
  5. package/dist/domains/traces/components/read-only-tool-call-provider.cjs.js +23 -0
  6. package/dist/domains/traces/components/read-only-tool-call-provider.cjs.js.map +1 -0
  7. package/dist/domains/traces/components/read-only-tool-call-provider.d.ts +1 -0
  8. package/dist/domains/traces/components/read-only-tool-call-provider.es.js +22 -0
  9. package/dist/domains/traces/components/read-only-tool-call-provider.es.js.map +1 -0
  10. package/dist/domains/traces/components/span-data-panel-view.cjs.js +123 -67
  11. package/dist/domains/traces/components/span-data-panel-view.cjs.js.map +1 -1
  12. package/dist/domains/traces/components/span-data-panel-view.es.js +131 -75
  13. package/dist/domains/traces/components/span-data-panel-view.es.js.map +1 -1
  14. package/dist/domains/traces/components/span-details-view.cjs.js +19 -11
  15. package/dist/domains/traces/components/span-details-view.cjs.js.map +1 -1
  16. package/dist/domains/traces/components/span-details-view.es.js +22 -14
  17. package/dist/domains/traces/components/span-details-view.es.js.map +1 -1
  18. package/dist/domains/traces/components/span-outcome.cjs.js +78 -0
  19. package/dist/domains/traces/components/span-outcome.cjs.js.map +1 -0
  20. package/dist/domains/traces/components/span-outcome.d.ts +1 -0
  21. package/dist/domains/traces/components/span-outcome.es.js +77 -0
  22. package/dist/domains/traces/components/span-outcome.es.js.map +1 -0
  23. package/dist/domains/traces/components/span-outcome.utils.cjs.js +360 -0
  24. package/dist/domains/traces/components/span-outcome.utils.cjs.js.map +1 -0
  25. package/dist/domains/traces/components/span-outcome.utils.d.ts +1 -0
  26. package/dist/domains/traces/components/span-outcome.utils.es.js +357 -0
  27. package/dist/domains/traces/components/span-outcome.utils.es.js.map +1 -0
  28. package/dist/domains/traces/components/span-payload/span-error-renderer.cjs.js +32 -15
  29. package/dist/domains/traces/components/span-payload/span-error-renderer.cjs.js.map +1 -1
  30. package/dist/domains/traces/components/span-payload/span-error-renderer.es.js +32 -16
  31. package/dist/domains/traces/components/span-payload/span-error-renderer.es.js.map +1 -1
  32. package/dist/domains/traces/components/span-payload/span-input-renderers.cjs.js +2 -2
  33. package/dist/domains/traces/components/span-payload/span-input-renderers.es.js +2 -2
  34. package/dist/domains/traces/components/span-payload/span-output-renderers.cjs.js +2 -10
  35. package/dist/domains/traces/components/span-payload/span-output-renderers.cjs.js.map +1 -1
  36. package/dist/domains/traces/components/span-payload/span-output-renderers.es.js +2 -10
  37. package/dist/domains/traces/components/span-payload/span-output-renderers.es.js.map +1 -1
  38. package/dist/domains/traces/components/span-payload/span-payload-json.cjs.js +22 -1
  39. package/dist/domains/traces/components/span-payload/span-payload-json.cjs.js.map +1 -1
  40. package/dist/domains/traces/components/span-payload/span-payload-json.es.js +22 -1
  41. package/dist/domains/traces/components/span-payload/span-payload-json.es.js.map +1 -1
  42. package/dist/domains/traces/components/span-payload/span-payload-messages.cjs.js +1 -1
  43. package/dist/domains/traces/components/span-payload/span-payload-messages.es.js +1 -1
  44. package/dist/domains/traces/components/span-payload/span-payload-primitives.cjs.js +1 -1
  45. package/dist/domains/traces/components/span-payload/span-payload-primitives.es.js +1 -1
  46. package/dist/domains/traces/components/span-payload/span-payload-processor.cjs.js +4 -7
  47. package/dist/domains/traces/components/span-payload/span-payload-processor.cjs.js.map +1 -1
  48. package/dist/domains/traces/components/span-payload/span-payload-processor.es.js +4 -7
  49. package/dist/domains/traces/components/span-payload/span-payload-processor.es.js.map +1 -1
  50. package/dist/domains/traces/components/span-payload/span-payload-registry.cjs.js +21 -19
  51. package/dist/domains/traces/components/span-payload/span-payload-registry.cjs.js.map +1 -1
  52. package/dist/domains/traces/components/span-payload/span-payload-registry.es.js +22 -20
  53. package/dist/domains/traces/components/span-payload/span-payload-registry.es.js.map +1 -1
  54. package/dist/domains/traces/components/span-payload/span-payload-section.cjs.js +62 -19
  55. package/dist/domains/traces/components/span-payload/span-payload-section.cjs.js.map +1 -1
  56. package/dist/domains/traces/components/span-payload/span-payload-section.es.js +62 -20
  57. package/dist/domains/traces/components/span-payload/span-payload-section.es.js.map +1 -1
  58. package/dist/domains/traces/components/span-payload/span-payload-tool.cjs.js +1 -1
  59. package/dist/domains/traces/components/span-payload/span-payload-tool.es.js +1 -1
  60. package/dist/domains/traces/components/span-payload/span-processor-attributes.cjs.js +51 -140
  61. package/dist/domains/traces/components/span-payload/span-processor-attributes.cjs.js.map +1 -1
  62. package/dist/domains/traces/components/span-payload/span-processor-attributes.es.js +54 -143
  63. package/dist/domains/traces/components/span-payload/span-processor-attributes.es.js.map +1 -1
  64. package/dist/domains/traces/components/span-payload/span-processor-mutations.cjs.js +99 -0
  65. package/dist/domains/traces/components/span-payload/span-processor-mutations.cjs.js.map +1 -0
  66. package/dist/domains/traces/components/span-payload/span-processor-mutations.d.ts +1 -0
  67. package/dist/domains/traces/components/span-payload/span-processor-mutations.es.js +98 -0
  68. package/dist/domains/traces/components/span-payload/span-processor-mutations.es.js.map +1 -0
  69. package/dist/domains/traces/components/span-payload/span-tools-section.cjs.js +48 -3
  70. package/dist/domains/traces/components/span-payload/span-tools-section.cjs.js.map +1 -1
  71. package/dist/domains/traces/components/span-payload/span-tools-section.es.js +48 -5
  72. package/dist/domains/traces/components/span-payload/span-tools-section.es.js.map +1 -1
  73. package/dist/domains/traces/components/span-payload.cjs.js +6 -1
  74. package/dist/domains/traces/components/span-payload.es.js +5 -4
  75. package/dist/domains/traces/components/thread-trace/thread-trace-spans.cjs.js +1 -1
  76. package/dist/domains/traces/components/thread-trace/thread-trace-spans.es.js +1 -1
  77. package/dist/domains/traces/components/trace-data-panel-view.cjs.js +1 -1
  78. package/dist/domains/traces/components/trace-data-panel-view.es.js +1 -1
  79. package/dist/domains/traces/components/trace-details-view.cjs.js +1 -1
  80. package/dist/domains/traces/components/trace-details-view.es.js +1 -1
  81. package/dist/domains/traces/components/trace-thread-item-view.cjs.js +26 -38
  82. package/dist/domains/traces/components/trace-thread-item-view.cjs.js.map +1 -1
  83. package/dist/domains/traces/components/trace-thread-item-view.es.js +26 -38
  84. package/dist/domains/traces/components/trace-thread-item-view.es.js.map +1 -1
  85. package/dist/domains/traces/components.cjs.js +7 -2
  86. package/dist/domains/traces/components.es.js +6 -5
  87. package/dist/domains/traces/hooks/use-trace-span-navigation.cjs.js +1 -1
  88. package/dist/domains/traces/hooks/use-trace-span-navigation.es.js +1 -1
  89. package/dist/domains/traces.cjs.js +7 -2
  90. package/dist/domains/traces.es.js +6 -5
  91. package/dist/{span-payload-primitives-Fi1kSYyM.js → span-payload-primitives-CNDSzk1Q.js} +2 -2
  92. package/dist/{span-payload-primitives-Fi1kSYyM.js.map → span-payload-primitives-CNDSzk1Q.js.map} +1 -1
  93. package/dist/{span-payload-primitives-rxerCV7Y.cjs → span-payload-primitives-DNhjpAtm.cjs} +2 -2
  94. package/dist/{span-payload-primitives-rxerCV7Y.cjs.map → span-payload-primitives-DNhjpAtm.cjs.map} +1 -1
  95. package/dist/src/domains/traces/components/format-trace-thread-messages.d.ts +14 -0
  96. package/dist/src/domains/traces/components/read-only-tool-call-provider.d.ts +5 -0
  97. package/dist/src/domains/traces/components/span-outcome.d.ts +15 -0
  98. package/dist/src/domains/traces/components/span-outcome.utils.d.ts +32 -0
  99. package/dist/src/domains/traces/components/span-payload/index.d.ts +4 -3
  100. package/dist/src/domains/traces/components/span-payload/span-error-renderer.d.ts +2 -0
  101. package/dist/src/domains/traces/components/span-payload/span-payload-json.d.ts +3 -1
  102. package/dist/src/domains/traces/components/span-payload/span-payload-processor.d.ts +1 -4
  103. package/dist/src/domains/traces/components/span-payload/span-payload-registry.d.ts +5 -14
  104. package/dist/src/domains/traces/components/span-payload/span-payload-section.d.ts +20 -1
  105. package/dist/src/domains/traces/components/span-payload/span-processor-attributes.d.ts +4 -4
  106. package/dist/src/domains/traces/components/span-payload/span-processor-mutations.d.ts +5 -0
  107. package/dist/src/domains/traces/components/span-payload/span-tools-section.d.ts +14 -2
  108. package/dist/style.css +22 -2
  109. package/package.json +6 -6
@@ -1,163 +1,74 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_utils = require("../../../../utils-uDc1ofX1.cjs");
2
3
  const require_utils_duration = require("../../../../utils/duration.cjs.js");
3
4
  const require_Txt = require("../../../../Txt-BnoSqxKE.cjs");
4
- const require_Notice = require("../../../../Notice-DWNeCe-t.cjs");
5
5
  const require_DataKeysAndValues = require("../../../../DataKeysAndValues-CHQcnHzv.cjs");
6
- const require_domains_traces_components_span_payload_span_payload_json = require("./span-payload-json.cjs.js");
7
6
  const require_domains_traces_components_span_payload_span_payload_registry = require("./span-payload-registry.cjs.js");
8
- const require_span_payload_primitives = require("../../../../span-payload-primitives-rxerCV7Y.cjs");
9
- const require_domains_traces_components_span_payload_span_payload_messages = require("./span-payload-messages.cjs.js");
10
- let react = require("react");
11
7
  let react_jsx_runtime = require("react/jsx-runtime");
12
8
  let _mastra_core_observability = require("@mastra/core/observability");
13
9
  // src/domains/traces/components/span-payload/span-processor-attributes.tsx
14
- /** Mutation kinds as actions a reader recognises. */
15
- var MUTATION_LABELS = {
16
- add: "Added messages",
17
- addSystem: "Added system message",
18
- removeByIds: "Removed messages",
19
- clear: "Cleared messages"
20
- };
21
- var describeMutation = (mutation) => [
22
- mutation.source,
23
- mutation.tag,
24
- mutation.count !== void 0 ? `${mutation.count} message${mutation.count === 1 ? "" : "s"}` : void 0
25
- ].filter(Boolean).join(" · ");
26
10
  /**
27
- * Splits the mutation log: changes that only carry a count are added up per
28
- * type, source and tag into one row each; changes carrying a message, removed
29
- * ids, or an unreadable entry keep their own detailed item.
11
+ * Where a processor ran in the pipeline, and the tripwire that stopped the run, as labelled values.
12
+ * Renders nothing for a span with no recorded phase.
30
13
  */
31
- function groupMutations(mutations) {
32
- const rows = /* @__PURE__ */ new Map();
33
- const detailed = [];
34
- for (const mutation of mutations) {
35
- if (typeof mutation !== "object" || mutation === null) {
36
- detailed.push(mutation);
37
- continue;
38
- }
39
- if (mutation.message !== void 0 || mutation.ids && mutation.ids.length > 0) {
40
- detailed.push(mutation);
41
- continue;
42
- }
43
- const key = JSON.stringify([
44
- mutation.type,
45
- mutation.source,
46
- mutation.tag
47
- ]);
48
- const row = rows.get(key);
49
- if (row) row.count = row.count === void 0 || mutation.count === void 0 ? void 0 : row.count + mutation.count;
50
- else rows.set(key, {
51
- label: MUTATION_LABELS[mutation.type] ?? mutation.type,
52
- source: mutation.source,
53
- tag: mutation.tag,
54
- count: mutation.count
55
- });
56
- }
57
- return {
58
- rows: [...rows.values()],
59
- detailed
60
- };
61
- }
62
- function Mutations({ mutations }) {
63
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
64
- "data-slot": "span-processor-mutations",
65
- className: "flex flex-col gap-1.5",
66
- children: mutations.map((mutation, index) => {
67
- if (typeof mutation !== "object" || mutation === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_json.SpanPayloadJson, { value: mutation }) }, index);
68
- const detail = describeMutation(mutation);
69
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
70
- className: "flex flex-col gap-2",
71
- children: [
72
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
73
- className: "flex flex-wrap items-center gap-2",
74
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
75
- tone: "ink",
76
- as: "span",
77
- variant: "body",
78
- children: MUTATION_LABELS[mutation.type] ?? mutation.type
79
- }), detail && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
80
- as: "span",
81
- variant: "meta",
82
- tone: "faint",
83
- children: detail
84
- })]
85
- }),
86
- mutation.message !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_messages.SpanPayloadMessages, { value: [mutation.message] }),
87
- mutation.ids && mutation.ids.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_span_payload_primitives.SpanPayloadCollapsible, {
88
- label: `Removed ids (${mutation.ids.length})`,
89
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_json.SpanPayloadJson, { value: mutation.ids })
90
- })
91
- ]
92
- }, index);
93
- })
94
- });
95
- }
96
- /**
97
- * The runner-owned attributes of a processor span, as labelled values.
98
- * `describeProcessorPipeline` decides which keys are known, so "Other attributes"
99
- * holds only what this view does not show.
100
- */
101
- function SpanProcessorAttributes({ span }) {
14
+ function SpanProcessorAttributes({ span, className }) {
102
15
  const pipeline = (0, _mastra_core_observability.describeProcessorPipeline)(require_domains_traces_components_span_payload_span_payload_registry.asCoreSpan(span));
103
16
  if (!pipeline) return null;
104
- const { phaseLabel, executor, processorIndex, hookDurationMs, messageListMutations, tripwireAbort, rest } = pipeline;
105
- const input = (0, _mastra_core_observability.describeSpanInput)(require_domains_traces_components_span_payload_span_payload_registry.asCoreSpan(span));
106
- const { stepNumber, retryCount, messageId } = input?.type === "processor" ? require_domains_traces_components_span_payload_span_payload_registry.getProcessorRunContext(input.value) : {};
17
+ const { phaseLabel, executor, processorIndex, hookDurationMs, tripwireAbort } = pipeline;
107
18
  const processorName = span.entityName ?? span.entityId;
108
- const hookDuration = hookDurationMs === void 0 ? void 0 : require_utils_duration.formatDuration(hookDurationMs);
109
- const mutations = groupMutations(messageListMutations ?? []);
110
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
19
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
111
20
  "data-slot": "span-processor-attributes",
112
- className: "flex flex-col gap-3",
113
- children: [
114
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_DataKeysAndValues.DataKeysAndValues, { children: [
115
- processorName && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Processor" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: processorName })] }),
116
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Phase" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: phaseLabel })] }),
117
- executor && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Executor" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: executor === "workflow" ? "Workflow" : "Legacy" })] }),
118
- processorIndex !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Pipeline position" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: processorIndex + 1 })] }),
119
- stepNumber !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Step" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: stepNumber })] }),
120
- retryCount !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Retries" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: retryCount })] }),
121
- messageId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Assistant message id" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.ValueWithCopyBtn, {
122
- copyValue: messageId,
123
- copyTooltip: "Copy assistant message id",
124
- children: messageId.slice(0, 6)
125
- })] }),
126
- hookDuration && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Hook duration" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
21
+ className,
22
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_DataKeysAndValues.DataKeysAndValues, { children: [
23
+ processorName && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
24
+ label: "Processor",
25
+ children: processorName
26
+ }),
27
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
28
+ label: "Phase",
29
+ children: phaseLabel
30
+ }),
31
+ executor && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
32
+ label: "Executor",
33
+ children: executor === "workflow" ? "Workflow" : "Legacy"
34
+ }),
35
+ processorIndex !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
36
+ label: "Pipeline position",
37
+ children: processorIndex + 1
38
+ }),
39
+ hookDurationMs !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
40
+ label: "Hook duration",
41
+ children: require_utils_duration.formatDuration(hookDurationMs)
42
+ }),
43
+ tripwireAbort?.reason && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
44
+ label: "Tripwire",
45
+ wrap: true,
46
+ children: tripwireAbort.reason
47
+ }),
48
+ tripwireAbort?.retry !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
49
+ label: "Retry",
50
+ children: tripwireAbort.retry ? "Yes" : "No"
51
+ }),
52
+ tripwireAbort?.metadata !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
53
+ label: "Tripwire metadata",
54
+ wrap: true,
55
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
127
56
  as: "span",
128
57
  variant: "body-sm",
129
58
  font: "mono",
130
- children: hookDuration
131
- }) })] }),
132
- mutations.rows.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: row.label }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: describeMutation(row) })] }, JSON.stringify([
133
- row.label,
134
- row.source,
135
- row.tag
136
- ])))
137
- ] }),
138
- tripwireAbort && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Notice.Notice, {
139
- variant: "destructive",
140
- title: "Tripwire",
141
- children: [
142
- tripwireAbort.reason && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Notice.Notice.Message, { children: tripwireAbort.reason }),
143
- tripwireAbort.retry !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_DataKeysAndValues.DataKeysAndValues, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: "Retry" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, { children: tripwireAbort.retry ? "Yes" : "No" })] }),
144
- tripwireAbort.metadata !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_span_payload_primitives.SpanPayloadCollapsible, {
145
- label: "Metadata",
146
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_json.SpanPayloadJson, { value: tripwireAbort.metadata })
147
- })
148
- ]
149
- }),
150
- mutations.detailed.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_span_payload_primitives.SpanPayloadField, {
151
- label: "Message list changes",
152
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Mutations, { mutations: mutations.detailed })
153
- }),
154
- rest && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_span_payload_primitives.SpanPayloadCollapsible, {
155
- label: "Other attributes",
156
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_json.SpanPayloadJson, { value: rest })
59
+ className: "break-all",
60
+ children: JSON.stringify(tripwireAbort.metadata)
61
+ })
157
62
  })
158
- ]
63
+ ] })
159
64
  });
160
65
  }
66
+ function Row({ label, wrap, children }) {
67
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Key, { children: label }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataKeysAndValues.DataKeysAndValues.Value, {
68
+ className: require_utils.cn(wrap && "break-words whitespace-pre-wrap"),
69
+ children
70
+ })] });
71
+ }
161
72
  exports.SpanProcessorAttributes = SpanProcessorAttributes;
162
73
 
163
74
  //# sourceMappingURL=span-processor-attributes.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"span-processor-attributes.cjs.js","names":["SpanPayloadJson","Txt","SpanPayloadMessages","SpanPayloadCollapsible","describeProcessorPipeline","asCoreSpan","describeSpanInput","getProcessorRunContext","formatDuration","DataKeysAndValues","_Fragment","Fragment","Notice","SpanPayloadField"],"sources":["../../../../../src/domains/traces/components/span-payload/span-processor-attributes.tsx"],"sourcesContent":["import { describeProcessorPipeline, describeSpanInput } from '@mastra/core/observability';\nimport type { ProcessorPipelineDescription } from '@mastra/core/observability';\nimport { Fragment } from 'react';\nimport type { SpanRecord } from '../../types';\nimport { SpanPayloadJson } from './span-payload-json';\nimport { SpanPayloadMessages } from './span-payload-messages';\nimport { SpanPayloadCollapsible, SpanPayloadField } from './span-payload-primitives';\nimport { asCoreSpan, getProcessorRunContext } from './span-payload-registry';\nimport { DataKeysAndValues } from '@/ds/components/DataKeysAndValues';\nimport { Notice } from '@/ds/components/Notice';\nimport { Txt } from '@/ds/components/Txt/Txt';\nimport { formatDuration } from '@/utils/duration';\n\n/** Mutation kinds as actions a reader recognises. */\nconst MUTATION_LABELS: Record<string, string> = {\n add: 'Added messages',\n addSystem: 'Added system message',\n removeByIds: 'Removed messages',\n clear: 'Cleared messages',\n};\n\ntype Mutation = NonNullable<ProcessorPipelineDescription['messageListMutations']>[number];\n\nconst describeMutation = (mutation: Pick<Mutation, 'source' | 'tag' | 'count'>) =>\n [\n mutation.source,\n mutation.tag,\n mutation.count !== undefined ? `${mutation.count} message${mutation.count === 1 ? '' : 's'}` : undefined,\n ]\n .filter(Boolean)\n .join(' · ');\n\n/**\n * Splits the mutation log: changes that only carry a count are added up per\n * type, source and tag into one row each; changes carrying a message, removed\n * ids, or an unreadable entry keep their own detailed item.\n */\nfunction groupMutations(mutations: readonly Mutation[]) {\n const rows = new Map<string, { label: string; source?: string; tag?: string; count?: number }>();\n const detailed: Mutation[] = [];\n\n for (const mutation of mutations) {\n if (typeof mutation !== 'object' || mutation === null) {\n detailed.push(mutation);\n continue;\n }\n if (mutation.message !== undefined || (mutation.ids && mutation.ids.length > 0)) {\n detailed.push(mutation);\n continue;\n }\n const key = JSON.stringify([mutation.type, mutation.source, mutation.tag]);\n const row = rows.get(key);\n if (row) {\n row.count = row.count === undefined || mutation.count === undefined ? undefined : row.count + mutation.count;\n } else {\n rows.set(key, {\n label: MUTATION_LABELS[mutation.type] ?? mutation.type,\n source: mutation.source,\n tag: mutation.tag,\n count: mutation.count,\n });\n }\n }\n\n return { rows: [...rows.values()], detailed };\n}\n\nfunction Mutations({ mutations }: { mutations: readonly Mutation[] }) {\n return (\n <ul data-slot=\"span-processor-mutations\" className=\"flex flex-col gap-1.5\">\n {mutations.map((mutation, index) => {\n if (typeof mutation !== 'object' || mutation === null) {\n return (\n <li key={index}>\n <SpanPayloadJson value={mutation} />\n </li>\n );\n }\n const detail = describeMutation(mutation);\n\n return (\n <li key={index} className=\"flex flex-col gap-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <Txt tone=\"ink\" as=\"span\" variant=\"body\">\n {MUTATION_LABELS[mutation.type] ?? mutation.type}\n </Txt>\n {detail && (\n <Txt as=\"span\" variant=\"meta\" tone=\"faint\">\n {detail}\n </Txt>\n )}\n </div>\n {mutation.message !== undefined && <SpanPayloadMessages value={[mutation.message]} />}\n {mutation.ids && mutation.ids.length > 0 && (\n <SpanPayloadCollapsible label={`Removed ids (${mutation.ids.length})`}>\n <SpanPayloadJson value={mutation.ids} />\n </SpanPayloadCollapsible>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport interface SpanProcessorAttributesProps {\n span: SpanRecord;\n}\n\n/**\n * The runner-owned attributes of a processor span, as labelled values.\n * `describeProcessorPipeline` decides which keys are known, so \"Other attributes\"\n * holds only what this view does not show.\n */\nexport function SpanProcessorAttributes({ span }: SpanProcessorAttributesProps) {\n const pipeline = describeProcessorPipeline(asCoreSpan(span));\n if (!pipeline) return null;\n\n const { phaseLabel, executor, processorIndex, hookDurationMs, messageListMutations, tripwireAbort, rest } = pipeline;\n const input = describeSpanInput(asCoreSpan(span));\n const { stepNumber, retryCount, messageId } = input?.type === 'processor' ? getProcessorRunContext(input.value) : {};\n const processorName = span.entityName ?? span.entityId;\n const hookDuration = hookDurationMs === undefined ? undefined : formatDuration(hookDurationMs);\n const mutations = groupMutations(messageListMutations ?? []);\n\n return (\n <div data-slot=\"span-processor-attributes\" className=\"flex flex-col gap-3\">\n <DataKeysAndValues>\n {processorName && (\n <>\n <DataKeysAndValues.Key>Processor</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{processorName}</DataKeysAndValues.Value>\n </>\n )}\n <>\n <DataKeysAndValues.Key>Phase</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{phaseLabel}</DataKeysAndValues.Value>\n </>\n {executor && (\n <>\n <DataKeysAndValues.Key>Executor</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{executor === 'workflow' ? 'Workflow' : 'Legacy'}</DataKeysAndValues.Value>\n </>\n )}\n {processorIndex !== undefined && (\n <>\n <DataKeysAndValues.Key>Pipeline position</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{processorIndex + 1}</DataKeysAndValues.Value>\n </>\n )}\n {stepNumber !== undefined && (\n <>\n <DataKeysAndValues.Key>Step</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{stepNumber}</DataKeysAndValues.Value>\n </>\n )}\n {retryCount !== undefined && (\n <>\n <DataKeysAndValues.Key>Retries</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{retryCount}</DataKeysAndValues.Value>\n </>\n )}\n {messageId !== undefined && (\n <>\n <DataKeysAndValues.Key>Assistant message id</DataKeysAndValues.Key>\n <DataKeysAndValues.ValueWithCopyBtn copyValue={messageId} copyTooltip=\"Copy assistant message id\">\n {messageId.slice(0, 6)}\n </DataKeysAndValues.ValueWithCopyBtn>\n </>\n )}\n {hookDuration && (\n <>\n <DataKeysAndValues.Key>Hook duration</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>\n <Txt as=\"span\" variant=\"body-sm\" font=\"mono\">\n {hookDuration}\n </Txt>\n </DataKeysAndValues.Value>\n </>\n )}\n {mutations.rows.map(row => (\n <Fragment key={JSON.stringify([row.label, row.source, row.tag])}>\n <DataKeysAndValues.Key>{row.label}</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{describeMutation(row)}</DataKeysAndValues.Value>\n </Fragment>\n ))}\n </DataKeysAndValues>\n\n {tripwireAbort && (\n <Notice variant=\"destructive\" title=\"Tripwire\">\n {tripwireAbort.reason && <Notice.Message>{tripwireAbort.reason}</Notice.Message>}\n {tripwireAbort.retry !== undefined && (\n <DataKeysAndValues>\n <DataKeysAndValues.Key>Retry</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{tripwireAbort.retry ? 'Yes' : 'No'}</DataKeysAndValues.Value>\n </DataKeysAndValues>\n )}\n {tripwireAbort.metadata !== undefined && (\n <SpanPayloadCollapsible label=\"Metadata\">\n <SpanPayloadJson value={tripwireAbort.metadata} />\n </SpanPayloadCollapsible>\n )}\n </Notice>\n )}\n\n {mutations.detailed.length > 0 && (\n <SpanPayloadField label=\"Message list changes\">\n <Mutations mutations={mutations.detailed} />\n </SpanPayloadField>\n )}\n\n {rest && (\n <SpanPayloadCollapsible label=\"Other attributes\">\n <SpanPayloadJson value={rest} />\n </SpanPayloadCollapsible>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAM,kBAA0C;CAC9C,KAAK;CACL,WAAW;CACX,aAAa;CACb,OAAO;AACT;AAIA,IAAM,oBAAoB,aACxB;CACE,SAAS;CACT,SAAS;CACT,SAAS,UAAU,KAAA,IAAY,GAAG,SAAS,MAAM,UAAU,SAAS,UAAU,IAAI,KAAK,QAAQ,KAAA;AACjG,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,KAAK;;;;;;AAOf,SAAS,eAAe,WAAgC;CACtD,MAAM,uBAAO,IAAI,IAA8E;CAC/F,MAAM,WAAuB,CAAC;CAE9B,KAAK,MAAM,YAAY,WAAW;EAChC,IAAI,OAAO,aAAa,YAAY,aAAa,MA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ACV,gCAAAA,wBAAD;IAAwB,OAAM;IAC5B,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACH,iEAAAA,iBAAD,EAAiB,OAAO,KAAO,CAAA;GACT,CAAA;EAEvB;;AAET"}
1
+ {"version":3,"file":"span-processor-attributes.cjs.js","names":["describeProcessorPipeline","asCoreSpan","DataKeysAndValues","formatDuration","Txt","_Fragment","cn"],"sources":["../../../../../src/domains/traces/components/span-payload/span-processor-attributes.tsx"],"sourcesContent":["import { describeProcessorPipeline } from '@mastra/core/observability';\nimport type { ReactNode } from 'react';\nimport type { SpanRecord } from '../../types';\nimport { asCoreSpan } from './span-payload-registry';\nimport { DataKeysAndValues } from '@/ds/components/DataKeysAndValues';\nimport { Txt } from '@/ds/components/Txt/Txt';\nimport { cn } from '@/lib/utils';\nimport { formatDuration } from '@/utils/duration';\n\nexport interface SpanProcessorAttributesProps {\n span: SpanRecord;\n className?: string;\n}\n\n/**\n * Where a processor ran in the pipeline, and the tripwire that stopped the run, as labelled values.\n * Renders nothing for a span with no recorded phase.\n */\nexport function SpanProcessorAttributes({ span, className }: SpanProcessorAttributesProps) {\n const pipeline = describeProcessorPipeline(asCoreSpan(span));\n if (!pipeline) return null;\n\n const { phaseLabel, executor, processorIndex, hookDurationMs, tripwireAbort } = pipeline;\n const processorName = span.entityName ?? span.entityId;\n\n return (\n <div data-slot=\"span-processor-attributes\" className={className}>\n <DataKeysAndValues>\n {processorName && <Row label=\"Processor\">{processorName}</Row>}\n <Row label=\"Phase\">{phaseLabel}</Row>\n {executor && <Row label=\"Executor\">{executor === 'workflow' ? 'Workflow' : 'Legacy'}</Row>}\n {/* processorIndex is 0-based; the position reads 1-based. */}\n {processorIndex !== undefined && <Row label=\"Pipeline position\">{processorIndex + 1}</Row>}\n {hookDurationMs !== undefined && <Row label=\"Hook duration\">{formatDuration(hookDurationMs)}</Row>}\n {tripwireAbort?.reason && (\n <Row label=\"Tripwire\" wrap>\n {tripwireAbort.reason}\n </Row>\n )}\n {tripwireAbort?.retry !== undefined && <Row label=\"Retry\">{tripwireAbort.retry ? 'Yes' : 'No'}</Row>}\n {tripwireAbort?.metadata !== undefined && (\n <Row label=\"Tripwire metadata\" wrap>\n <Txt as=\"span\" variant=\"body-sm\" font=\"mono\" className=\"break-all\">\n {JSON.stringify(tripwireAbort.metadata)}\n </Txt>\n </Row>\n )}\n </DataKeysAndValues>\n </div>\n );\n}\n\nfunction Row({ label, wrap, children }: { label: string; wrap?: boolean; children: ReactNode }) {\n return (\n <>\n <DataKeysAndValues.Key>{label}</DataKeysAndValues.Key>\n <DataKeysAndValues.Value className={cn(wrap && 'break-words whitespace-pre-wrap')}>\n {children}\n </DataKeysAndValues.Value>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAAgB,wBAAwB,EAAE,MAAM,aAA2C;CACzF,MAAM,YAAA,GAAWA,2BAAAA,0BAAAA,CAA0BC,qEAAAA,WAAW,IAAI,CAAC;CAC3D,IAAI,CAAC,UAAU,OAAO;CAEtB,MAAM,EAAE,YAAY,UAAU,gBAAgB,gBAAgB,kBAAkB;CAChF,MAAM,gBAAgB,KAAK,cAAc,KAAK;CAE9C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,aAAU;EAAuC;EACpD,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,0BAAAA,mBAAD,EAAA,UAAA;GACG,iBAAiB,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAa,UAAA;GAAmB,CAAA;GAC7D,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAS,UAAA;GAAgB,CAAA;GACnC,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAY,UAAA,aAAa,aAAa,aAAa;GAAc,CAAA;GAExF,mBAAmB,KAAA,KAAa,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAqB,UAAA,iBAAiB;GAAO,CAAA;GACxF,mBAAmB,KAAA,KAAa,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAiB,UAAAC,uBAAAA,eAAe,cAAc;GAAO,CAAA;GAChG,eAAe,UACd,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAW,MAAA;IACnB,UAAA,cAAc;GACZ,CAAA;GAEN,eAAe,UAAU,KAAA,KAAa,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAS,UAAA,cAAc,QAAQ,QAAQ;GAAU,CAAA;GAClG,eAAe,aAAa,KAAA,KAC3B,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAK,OAAM;IAAoB,MAAA;IAC7B,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;KAAK,IAAG;KAAO,SAAQ;KAAU,MAAK;KAAO,WAAU;KACpD,UAAA,KAAK,UAAU,cAAc,QAAQ;IACnC,CAAA;GACF,CAAA;EAEU,EAAA,CAAA;CAChB,CAAA;AAET;AAEA,SAAS,IAAI,EAAE,OAAO,MAAM,YAAoE;CAC9F,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACH,0BAAAA,kBAAkB,KAAnB,EAAA,UAAwB,MAA6B,CAAA,GACrD,iBAAA,GAAA,kBAAA,IAAA,CAACA,0BAAAA,kBAAkB,OAAnB;EAAyB,WAAWI,cAAAA,GAAG,QAAQ,iCAAiC;EAC7E;CACsB,CAAA,CACzB,EAAA,CAAA;AAEN"}
@@ -1,162 +1,73 @@
1
+ import { t as cn } from "../../../../utils-DQx8TpNT.js";
1
2
  import { formatDuration } from "../../../../utils/duration.es.js";
2
3
  import { t as Txt } from "../../../../Txt-BM6TVV_c.js";
3
- import { t as Notice } from "../../../../Notice-CyKngbbv.js";
4
4
  import { t as DataKeysAndValues } from "../../../../DataKeysAndValues-B2jquIjh.js";
5
- import { SpanPayloadJson } from "./span-payload-json.es.js";
6
- import { asCoreSpan, getProcessorRunContext } from "./span-payload-registry.es.js";
7
- import { n as SpanPayloadField, t as SpanPayloadCollapsible } from "../../../../span-payload-primitives-Fi1kSYyM.js";
8
- import { SpanPayloadMessages } from "./span-payload-messages.es.js";
9
- import { Fragment } from "react";
10
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
- import { describeProcessorPipeline, describeSpanInput } from "@mastra/core/observability";
5
+ import { asCoreSpan } from "./span-payload-registry.es.js";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { describeProcessorPipeline } from "@mastra/core/observability";
12
8
  // src/domains/traces/components/span-payload/span-processor-attributes.tsx
13
- /** Mutation kinds as actions a reader recognises. */
14
- var MUTATION_LABELS = {
15
- add: "Added messages",
16
- addSystem: "Added system message",
17
- removeByIds: "Removed messages",
18
- clear: "Cleared messages"
19
- };
20
- var describeMutation = (mutation) => [
21
- mutation.source,
22
- mutation.tag,
23
- mutation.count !== void 0 ? `${mutation.count} message${mutation.count === 1 ? "" : "s"}` : void 0
24
- ].filter(Boolean).join(" · ");
25
9
  /**
26
- * Splits the mutation log: changes that only carry a count are added up per
27
- * type, source and tag into one row each; changes carrying a message, removed
28
- * ids, or an unreadable entry keep their own detailed item.
10
+ * Where a processor ran in the pipeline, and the tripwire that stopped the run, as labelled values.
11
+ * Renders nothing for a span with no recorded phase.
29
12
  */
30
- function groupMutations(mutations) {
31
- const rows = /* @__PURE__ */ new Map();
32
- const detailed = [];
33
- for (const mutation of mutations) {
34
- if (typeof mutation !== "object" || mutation === null) {
35
- detailed.push(mutation);
36
- continue;
37
- }
38
- if (mutation.message !== void 0 || mutation.ids && mutation.ids.length > 0) {
39
- detailed.push(mutation);
40
- continue;
41
- }
42
- const key = JSON.stringify([
43
- mutation.type,
44
- mutation.source,
45
- mutation.tag
46
- ]);
47
- const row = rows.get(key);
48
- if (row) row.count = row.count === void 0 || mutation.count === void 0 ? void 0 : row.count + mutation.count;
49
- else rows.set(key, {
50
- label: MUTATION_LABELS[mutation.type] ?? mutation.type,
51
- source: mutation.source,
52
- tag: mutation.tag,
53
- count: mutation.count
54
- });
55
- }
56
- return {
57
- rows: [...rows.values()],
58
- detailed
59
- };
60
- }
61
- function Mutations({ mutations }) {
62
- return /* @__PURE__ */ jsx("ul", {
63
- "data-slot": "span-processor-mutations",
64
- className: "flex flex-col gap-1.5",
65
- children: mutations.map((mutation, index) => {
66
- if (typeof mutation !== "object" || mutation === null) return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SpanPayloadJson, { value: mutation }) }, index);
67
- const detail = describeMutation(mutation);
68
- return /* @__PURE__ */ jsxs("li", {
69
- className: "flex flex-col gap-2",
70
- children: [
71
- /* @__PURE__ */ jsxs("div", {
72
- className: "flex flex-wrap items-center gap-2",
73
- children: [/* @__PURE__ */ jsx(Txt, {
74
- tone: "ink",
75
- as: "span",
76
- variant: "body",
77
- children: MUTATION_LABELS[mutation.type] ?? mutation.type
78
- }), detail && /* @__PURE__ */ jsx(Txt, {
79
- as: "span",
80
- variant: "meta",
81
- tone: "faint",
82
- children: detail
83
- })]
84
- }),
85
- mutation.message !== void 0 && /* @__PURE__ */ jsx(SpanPayloadMessages, { value: [mutation.message] }),
86
- mutation.ids && mutation.ids.length > 0 && /* @__PURE__ */ jsx(SpanPayloadCollapsible, {
87
- label: `Removed ids (${mutation.ids.length})`,
88
- children: /* @__PURE__ */ jsx(SpanPayloadJson, { value: mutation.ids })
89
- })
90
- ]
91
- }, index);
92
- })
93
- });
94
- }
95
- /**
96
- * The runner-owned attributes of a processor span, as labelled values.
97
- * `describeProcessorPipeline` decides which keys are known, so "Other attributes"
98
- * holds only what this view does not show.
99
- */
100
- function SpanProcessorAttributes({ span }) {
13
+ function SpanProcessorAttributes({ span, className }) {
101
14
  const pipeline = describeProcessorPipeline(asCoreSpan(span));
102
15
  if (!pipeline) return null;
103
- const { phaseLabel, executor, processorIndex, hookDurationMs, messageListMutations, tripwireAbort, rest } = pipeline;
104
- const input = describeSpanInput(asCoreSpan(span));
105
- const { stepNumber, retryCount, messageId } = input?.type === "processor" ? getProcessorRunContext(input.value) : {};
16
+ const { phaseLabel, executor, processorIndex, hookDurationMs, tripwireAbort } = pipeline;
106
17
  const processorName = span.entityName ?? span.entityId;
107
- const hookDuration = hookDurationMs === void 0 ? void 0 : formatDuration(hookDurationMs);
108
- const mutations = groupMutations(messageListMutations ?? []);
109
- return /* @__PURE__ */ jsxs("div", {
18
+ return /* @__PURE__ */ jsx("div", {
110
19
  "data-slot": "span-processor-attributes",
111
- className: "flex flex-col gap-3",
112
- children: [
113
- /* @__PURE__ */ jsxs(DataKeysAndValues, { children: [
114
- processorName && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Processor" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: processorName })] }),
115
- /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Phase" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: phaseLabel })] }),
116
- executor && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Executor" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: executor === "workflow" ? "Workflow" : "Legacy" })] }),
117
- processorIndex !== void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Pipeline position" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: processorIndex + 1 })] }),
118
- stepNumber !== void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Step" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: stepNumber })] }),
119
- retryCount !== void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Retries" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: retryCount })] }),
120
- messageId !== void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Assistant message id" }), /* @__PURE__ */ jsx(DataKeysAndValues.ValueWithCopyBtn, {
121
- copyValue: messageId,
122
- copyTooltip: "Copy assistant message id",
123
- children: messageId.slice(0, 6)
124
- })] }),
125
- hookDuration && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Hook duration" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: /* @__PURE__ */ jsx(Txt, {
20
+ className,
21
+ children: /* @__PURE__ */ jsxs(DataKeysAndValues, { children: [
22
+ processorName && /* @__PURE__ */ jsx(Row, {
23
+ label: "Processor",
24
+ children: processorName
25
+ }),
26
+ /* @__PURE__ */ jsx(Row, {
27
+ label: "Phase",
28
+ children: phaseLabel
29
+ }),
30
+ executor && /* @__PURE__ */ jsx(Row, {
31
+ label: "Executor",
32
+ children: executor === "workflow" ? "Workflow" : "Legacy"
33
+ }),
34
+ processorIndex !== void 0 && /* @__PURE__ */ jsx(Row, {
35
+ label: "Pipeline position",
36
+ children: processorIndex + 1
37
+ }),
38
+ hookDurationMs !== void 0 && /* @__PURE__ */ jsx(Row, {
39
+ label: "Hook duration",
40
+ children: formatDuration(hookDurationMs)
41
+ }),
42
+ tripwireAbort?.reason && /* @__PURE__ */ jsx(Row, {
43
+ label: "Tripwire",
44
+ wrap: true,
45
+ children: tripwireAbort.reason
46
+ }),
47
+ tripwireAbort?.retry !== void 0 && /* @__PURE__ */ jsx(Row, {
48
+ label: "Retry",
49
+ children: tripwireAbort.retry ? "Yes" : "No"
50
+ }),
51
+ tripwireAbort?.metadata !== void 0 && /* @__PURE__ */ jsx(Row, {
52
+ label: "Tripwire metadata",
53
+ wrap: true,
54
+ children: /* @__PURE__ */ jsx(Txt, {
126
55
  as: "span",
127
56
  variant: "body-sm",
128
57
  font: "mono",
129
- children: hookDuration
130
- }) })] }),
131
- mutations.rows.map((row) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: row.label }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: describeMutation(row) })] }, JSON.stringify([
132
- row.label,
133
- row.source,
134
- row.tag
135
- ])))
136
- ] }),
137
- tripwireAbort && /* @__PURE__ */ jsxs(Notice, {
138
- variant: "destructive",
139
- title: "Tripwire",
140
- children: [
141
- tripwireAbort.reason && /* @__PURE__ */ jsx(Notice.Message, { children: tripwireAbort.reason }),
142
- tripwireAbort.retry !== void 0 && /* @__PURE__ */ jsxs(DataKeysAndValues, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: "Retry" }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, { children: tripwireAbort.retry ? "Yes" : "No" })] }),
143
- tripwireAbort.metadata !== void 0 && /* @__PURE__ */ jsx(SpanPayloadCollapsible, {
144
- label: "Metadata",
145
- children: /* @__PURE__ */ jsx(SpanPayloadJson, { value: tripwireAbort.metadata })
146
- })
147
- ]
148
- }),
149
- mutations.detailed.length > 0 && /* @__PURE__ */ jsx(SpanPayloadField, {
150
- label: "Message list changes",
151
- children: /* @__PURE__ */ jsx(Mutations, { mutations: mutations.detailed })
152
- }),
153
- rest && /* @__PURE__ */ jsx(SpanPayloadCollapsible, {
154
- label: "Other attributes",
155
- children: /* @__PURE__ */ jsx(SpanPayloadJson, { value: rest })
58
+ className: "break-all",
59
+ children: JSON.stringify(tripwireAbort.metadata)
60
+ })
156
61
  })
157
- ]
62
+ ] })
158
63
  });
159
64
  }
65
+ function Row({ label, wrap, children }) {
66
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DataKeysAndValues.Key, { children: label }), /* @__PURE__ */ jsx(DataKeysAndValues.Value, {
67
+ className: cn(wrap && "break-words whitespace-pre-wrap"),
68
+ children
69
+ })] });
70
+ }
160
71
  export { SpanProcessorAttributes };
161
72
 
162
73
  //# sourceMappingURL=span-processor-attributes.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"span-processor-attributes.es.js","names":["_Fragment"],"sources":["../../../../../src/domains/traces/components/span-payload/span-processor-attributes.tsx"],"sourcesContent":["import { describeProcessorPipeline, describeSpanInput } from '@mastra/core/observability';\nimport type { ProcessorPipelineDescription } from '@mastra/core/observability';\nimport { Fragment } from 'react';\nimport type { SpanRecord } from '../../types';\nimport { SpanPayloadJson } from './span-payload-json';\nimport { SpanPayloadMessages } from './span-payload-messages';\nimport { SpanPayloadCollapsible, SpanPayloadField } from './span-payload-primitives';\nimport { asCoreSpan, getProcessorRunContext } from './span-payload-registry';\nimport { DataKeysAndValues } from '@/ds/components/DataKeysAndValues';\nimport { Notice } from '@/ds/components/Notice';\nimport { Txt } from '@/ds/components/Txt/Txt';\nimport { formatDuration } from '@/utils/duration';\n\n/** Mutation kinds as actions a reader recognises. */\nconst MUTATION_LABELS: Record<string, string> = {\n add: 'Added messages',\n addSystem: 'Added system message',\n removeByIds: 'Removed messages',\n clear: 'Cleared messages',\n};\n\ntype Mutation = NonNullable<ProcessorPipelineDescription['messageListMutations']>[number];\n\nconst describeMutation = (mutation: Pick<Mutation, 'source' | 'tag' | 'count'>) =>\n [\n mutation.source,\n mutation.tag,\n mutation.count !== undefined ? `${mutation.count} message${mutation.count === 1 ? '' : 's'}` : undefined,\n ]\n .filter(Boolean)\n .join(' · ');\n\n/**\n * Splits the mutation log: changes that only carry a count are added up per\n * type, source and tag into one row each; changes carrying a message, removed\n * ids, or an unreadable entry keep their own detailed item.\n */\nfunction groupMutations(mutations: readonly Mutation[]) {\n const rows = new Map<string, { label: string; source?: string; tag?: string; count?: number }>();\n const detailed: Mutation[] = [];\n\n for (const mutation of mutations) {\n if (typeof mutation !== 'object' || mutation === null) {\n detailed.push(mutation);\n continue;\n }\n if (mutation.message !== undefined || (mutation.ids && mutation.ids.length > 0)) {\n detailed.push(mutation);\n continue;\n }\n const key = JSON.stringify([mutation.type, mutation.source, mutation.tag]);\n const row = rows.get(key);\n if (row) {\n row.count = row.count === undefined || mutation.count === undefined ? undefined : row.count + mutation.count;\n } else {\n rows.set(key, {\n label: MUTATION_LABELS[mutation.type] ?? mutation.type,\n source: mutation.source,\n tag: mutation.tag,\n count: mutation.count,\n });\n }\n }\n\n return { rows: [...rows.values()], detailed };\n}\n\nfunction Mutations({ mutations }: { mutations: readonly Mutation[] }) {\n return (\n <ul data-slot=\"span-processor-mutations\" className=\"flex flex-col gap-1.5\">\n {mutations.map((mutation, index) => {\n if (typeof mutation !== 'object' || mutation === null) {\n return (\n <li key={index}>\n <SpanPayloadJson value={mutation} />\n </li>\n );\n }\n const detail = describeMutation(mutation);\n\n return (\n <li key={index} className=\"flex flex-col gap-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <Txt tone=\"ink\" as=\"span\" variant=\"body\">\n {MUTATION_LABELS[mutation.type] ?? mutation.type}\n </Txt>\n {detail && (\n <Txt as=\"span\" variant=\"meta\" tone=\"faint\">\n {detail}\n </Txt>\n )}\n </div>\n {mutation.message !== undefined && <SpanPayloadMessages value={[mutation.message]} />}\n {mutation.ids && mutation.ids.length > 0 && (\n <SpanPayloadCollapsible label={`Removed ids (${mutation.ids.length})`}>\n <SpanPayloadJson value={mutation.ids} />\n </SpanPayloadCollapsible>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport interface SpanProcessorAttributesProps {\n span: SpanRecord;\n}\n\n/**\n * The runner-owned attributes of a processor span, as labelled values.\n * `describeProcessorPipeline` decides which keys are known, so \"Other attributes\"\n * holds only what this view does not show.\n */\nexport function SpanProcessorAttributes({ span }: SpanProcessorAttributesProps) {\n const pipeline = describeProcessorPipeline(asCoreSpan(span));\n if (!pipeline) return null;\n\n const { phaseLabel, executor, processorIndex, hookDurationMs, messageListMutations, tripwireAbort, rest } = pipeline;\n const input = describeSpanInput(asCoreSpan(span));\n const { stepNumber, retryCount, messageId } = input?.type === 'processor' ? getProcessorRunContext(input.value) : {};\n const processorName = span.entityName ?? span.entityId;\n const hookDuration = hookDurationMs === undefined ? undefined : formatDuration(hookDurationMs);\n const mutations = groupMutations(messageListMutations ?? []);\n\n return (\n <div data-slot=\"span-processor-attributes\" className=\"flex flex-col gap-3\">\n <DataKeysAndValues>\n {processorName && (\n <>\n <DataKeysAndValues.Key>Processor</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{processorName}</DataKeysAndValues.Value>\n </>\n )}\n <>\n <DataKeysAndValues.Key>Phase</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{phaseLabel}</DataKeysAndValues.Value>\n </>\n {executor && (\n <>\n <DataKeysAndValues.Key>Executor</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{executor === 'workflow' ? 'Workflow' : 'Legacy'}</DataKeysAndValues.Value>\n </>\n )}\n {processorIndex !== undefined && (\n <>\n <DataKeysAndValues.Key>Pipeline position</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{processorIndex + 1}</DataKeysAndValues.Value>\n </>\n )}\n {stepNumber !== undefined && (\n <>\n <DataKeysAndValues.Key>Step</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{stepNumber}</DataKeysAndValues.Value>\n </>\n )}\n {retryCount !== undefined && (\n <>\n <DataKeysAndValues.Key>Retries</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{retryCount}</DataKeysAndValues.Value>\n </>\n )}\n {messageId !== undefined && (\n <>\n <DataKeysAndValues.Key>Assistant message id</DataKeysAndValues.Key>\n <DataKeysAndValues.ValueWithCopyBtn copyValue={messageId} copyTooltip=\"Copy assistant message id\">\n {messageId.slice(0, 6)}\n </DataKeysAndValues.ValueWithCopyBtn>\n </>\n )}\n {hookDuration && (\n <>\n <DataKeysAndValues.Key>Hook duration</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>\n <Txt as=\"span\" variant=\"body-sm\" font=\"mono\">\n {hookDuration}\n </Txt>\n </DataKeysAndValues.Value>\n </>\n )}\n {mutations.rows.map(row => (\n <Fragment key={JSON.stringify([row.label, row.source, row.tag])}>\n <DataKeysAndValues.Key>{row.label}</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{describeMutation(row)}</DataKeysAndValues.Value>\n </Fragment>\n ))}\n </DataKeysAndValues>\n\n {tripwireAbort && (\n <Notice variant=\"destructive\" title=\"Tripwire\">\n {tripwireAbort.reason && <Notice.Message>{tripwireAbort.reason}</Notice.Message>}\n {tripwireAbort.retry !== undefined && (\n <DataKeysAndValues>\n <DataKeysAndValues.Key>Retry</DataKeysAndValues.Key>\n <DataKeysAndValues.Value>{tripwireAbort.retry ? 'Yes' : 'No'}</DataKeysAndValues.Value>\n </DataKeysAndValues>\n )}\n {tripwireAbort.metadata !== undefined && (\n <SpanPayloadCollapsible label=\"Metadata\">\n <SpanPayloadJson value={tripwireAbort.metadata} />\n </SpanPayloadCollapsible>\n )}\n </Notice>\n )}\n\n {mutations.detailed.length > 0 && (\n <SpanPayloadField label=\"Message list changes\">\n <Mutations mutations={mutations.detailed} />\n </SpanPayloadField>\n )}\n\n {rest && (\n <SpanPayloadCollapsible label=\"Other attributes\">\n <SpanPayloadJson value={rest} />\n </SpanPayloadCollapsible>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAM,kBAA0C;CAC9C,KAAK;CACL,WAAW;CACX,aAAa;CACb,OAAO;AACT;AAIA,IAAM,oBAAoB,aACxB;CACE,SAAS;CACT,SAAS;CACT,SAAS,UAAU,KAAA,IAAY,GAAG,SAAS,MAAM,UAAU,SAAS,UAAU,IAAI,KAAK,QAAQ,KAAA;AACjG,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,KAAK;;;;;;AAOf,SAAS,eAAe,WAAgC;CACtD,MAAM,uBAAO,IAAI,IAA8E;CAC/F,MAAM,WAAuB,CAAC;CAE9B,KAAK,MAAM,Y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A6B,CAAA,GACzD,oBAAC,kBAAkB,OAAnB,EAAA,UAA0B,iBAAiB,GAAG,EAA2B,CAAA,CACjE,EAAA,GAHK,KAAK,UAAU;KAAC,IAAI;KAAO,IAAI;KAAQ,IAAI;IAAG,CAAC,CAGpD,CACX;GACgB,EAAA,CAAA;GAElB,iBACC,qBAAC,QAAD;IAAQ,SAAQ;IAAc,OAAM;IAApC,UAAA;KACG,cAAc,UAAU,oBAAC,OAAO,SAAR,EAAA,UAAiB,cAAc,OAAuB,CAAA;KAC9E,cAAc,UAAU,KAAA,KACvB,qBAAC,mBAAD,EAAA,UAAA,CACE,oBAAC,kBAAkB,KAAnB,EAAA,UAAuB,QAA4B,CAAA,GACnD,oBAAC,kBAAkB,OAAnB,EAAA,UAA0B,cAAc,QAAQ,QAAQ,KAA8B,CAAA,CACrE,EAAA,CAAA;KAEpB,cAAc,aAAa,KAAA,KAC1B,oBAAC,wBAAD;MAAwB,OAAM;MAC5B,UAAA,oBAAC,iBAAD,EAAiB,OAAO,cAAc,SAAW,CAAA;KAC3B,CAAA;IAEpB;;GAGT,UAAU,SAAS,SAAS,KAC3B,oBAAC,kBAAD;IAAkB,OAAM;IACtB,UAAA,oBAAC,WAAD,EAAW,WAAW,UAAU,SAAW,CAAA;GAC3B,CAAA;GAGnB,QACC,oBAAC,wBAAD;IAAwB,OAAM;IAC5B,UAAA,oBAAC,iBAAD,EAAiB,OAAO,KAAO,CAAA;GACT,CAAA;EAEvB;;AAET"}
1
+ {"version":3,"file":"span-processor-attributes.es.js","names":["_Fragment"],"sources":["../../../../../src/domains/traces/components/span-payload/span-processor-attributes.tsx"],"sourcesContent":["import { describeProcessorPipeline } from '@mastra/core/observability';\nimport type { ReactNode } from 'react';\nimport type { SpanRecord } from '../../types';\nimport { asCoreSpan } from './span-payload-registry';\nimport { DataKeysAndValues } from '@/ds/components/DataKeysAndValues';\nimport { Txt } from '@/ds/components/Txt/Txt';\nimport { cn } from '@/lib/utils';\nimport { formatDuration } from '@/utils/duration';\n\nexport interface SpanProcessorAttributesProps {\n span: SpanRecord;\n className?: string;\n}\n\n/**\n * Where a processor ran in the pipeline, and the tripwire that stopped the run, as labelled values.\n * Renders nothing for a span with no recorded phase.\n */\nexport function SpanProcessorAttributes({ span, className }: SpanProcessorAttributesProps) {\n const pipeline = describeProcessorPipeline(asCoreSpan(span));\n if (!pipeline) return null;\n\n const { phaseLabel, executor, processorIndex, hookDurationMs, tripwireAbort } = pipeline;\n const processorName = span.entityName ?? span.entityId;\n\n return (\n <div data-slot=\"span-processor-attributes\" className={className}>\n <DataKeysAndValues>\n {processorName && <Row label=\"Processor\">{processorName}</Row>}\n <Row label=\"Phase\">{phaseLabel}</Row>\n {executor && <Row label=\"Executor\">{executor === 'workflow' ? 'Workflow' : 'Legacy'}</Row>}\n {/* processorIndex is 0-based; the position reads 1-based. */}\n {processorIndex !== undefined && <Row label=\"Pipeline position\">{processorIndex + 1}</Row>}\n {hookDurationMs !== undefined && <Row label=\"Hook duration\">{formatDuration(hookDurationMs)}</Row>}\n {tripwireAbort?.reason && (\n <Row label=\"Tripwire\" wrap>\n {tripwireAbort.reason}\n </Row>\n )}\n {tripwireAbort?.retry !== undefined && <Row label=\"Retry\">{tripwireAbort.retry ? 'Yes' : 'No'}</Row>}\n {tripwireAbort?.metadata !== undefined && (\n <Row label=\"Tripwire metadata\" wrap>\n <Txt as=\"span\" variant=\"body-sm\" font=\"mono\" className=\"break-all\">\n {JSON.stringify(tripwireAbort.metadata)}\n </Txt>\n </Row>\n )}\n </DataKeysAndValues>\n </div>\n );\n}\n\nfunction Row({ label, wrap, children }: { label: string; wrap?: boolean; children: ReactNode }) {\n return (\n <>\n <DataKeysAndValues.Key>{label}</DataKeysAndValues.Key>\n <DataKeysAndValues.Value className={cn(wrap && 'break-words whitespace-pre-wrap')}>\n {children}\n </DataKeysAndValues.Value>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,wBAAwB,EAAE,MAAM,aAA2C;CACzF,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QAAQ,iCAAiC;EAC7E;CACsB,CAAA,CACzB,EAAA,CAAA;AAEN"}
@@ -0,0 +1,99 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_Txt = require("../../../../Txt-BnoSqxKE.cjs");
3
+ const require_string = require("../../../../string-CymY0aJ9.cjs");
4
+ const require_domains_traces_components_span_outcome_utils = require("../span-outcome.utils.cjs.js");
5
+ const require_domains_traces_components_span_payload_span_payload_json = require("./span-payload-json.cjs.js");
6
+ const require_span_payload_primitives = require("../../../../span-payload-primitives-DNhjpAtm.cjs");
7
+ const require_domains_traces_components_span_payload_span_payload_messages = require("./span-payload-messages.cjs.js");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ // src/domains/traces/components/span-payload/span-processor-mutations.tsx
10
+ var messages = (count) => count === void 0 ? "messages" : require_string.pluralize(count, "message");
11
+ /** What a recorded change did to the message list, as one sentence. */
12
+ function describeMutation(mutation) {
13
+ const { type, source, count, tag } = mutation;
14
+ switch (type) {
15
+ case "add":
16
+ if (source === "memory") return `Added ${messages(count)} from memory to the conversation`;
17
+ if (source === "input") return `Added ${messages(count)} to this turn's input`;
18
+ if (source === "response") return `Added ${messages(count)} to the model's response`;
19
+ if (source === "context") return `Added ${messages(count)} of context to the conversation`;
20
+ if (source === "system") return `Added ${messages(count)} to the system prompt`;
21
+ return `Added ${messages(count)} to the conversation`;
22
+ case "addSystem": return `Added ${count && count > 1 ? messages(count) : "a"}${tag ? ` "${tag}"` : ""}${count && count > 1 ? "" : " message"} to the system prompt`;
23
+ case "clear":
24
+ if (source === "input") return `Took ${messages(count)} from this turn's input out of the conversation`;
25
+ if (source === "response") return `Took ${messages(count)} from the model's response out of the conversation`;
26
+ return `Cleared the whole conversation (${messages(count)})`;
27
+ case "removeByIds":
28
+ if (source === "system") return `Removed ${messages(count ?? mutation.ids?.length)} from the system prompt`;
29
+ return `Removed ${messages(count ?? mutation.ids?.length)} from the conversation`;
30
+ default: return `${String(type)}${source ? ` (${source})` : ""}`;
31
+ }
32
+ }
33
+ /**
34
+ * The recorded changes in the order they happened. Back-to-back changes of the same
35
+ * kind that only carry a count (e.g. two single-message adds from memory) read as one step.
36
+ */
37
+ function toSteps(mutations) {
38
+ const steps = [];
39
+ for (const mutation of mutations) {
40
+ const previous = steps.at(-1);
41
+ if (isCountOnly(previous) && isCountOnly(mutation) && isSameKind(previous, mutation)) {
42
+ steps[steps.length - 1] = {
43
+ ...previous,
44
+ count: previous.count + mutation.count
45
+ };
46
+ continue;
47
+ }
48
+ steps.push(mutation);
49
+ }
50
+ return steps;
51
+ }
52
+ var isCountOnly = (mutation) => typeof mutation === "object" && mutation !== null && mutation.count !== void 0 && mutation.message === void 0 && !(mutation.ids && mutation.ids.length > 0);
53
+ var isSameKind = (a, b) => a.type === b.type && a.source === b.source && a.tag === b.tag;
54
+ function MutationSteps({ mutations }) {
55
+ const steps = toSteps(mutations);
56
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
57
+ "data-slot": "span-processor-mutations",
58
+ className: "flex list-none flex-col divide-y divide-border",
59
+ children: steps.map((mutation, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
60
+ className: "flex gap-3 py-3 first:pt-0 last:pb-0",
61
+ children: [steps.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Txt.Txt, {
62
+ as: "span",
63
+ variant: "body-sm",
64
+ tone: "faint",
65
+ font: "mono",
66
+ className: "tabular-nums",
67
+ children: [index + 1, "."]
68
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
69
+ className: "flex min-w-0 flex-1 flex-col gap-2",
70
+ children: typeof mutation === "object" && mutation !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
71
+ (mutation.message === void 0 || mutation.type === "removeByIds") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
72
+ as: "p",
73
+ variant: "body-sm",
74
+ tone: "ink",
75
+ "data-slot": "span-processor-mutation-step",
76
+ children: describeMutation(mutation)
77
+ }),
78
+ mutation.message !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_messages.SpanPayloadMessages, { value: [mutation.message] }),
79
+ mutation.ids && mutation.ids.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_span_payload_primitives.SpanPayloadCollapsible, {
80
+ label: `Removed ids (${mutation.ids.length})`,
81
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_json.SpanPayloadJson, { value: mutation.ids })
82
+ })
83
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_span_payload_span_payload_json.SpanPayloadJson, { value: mutation })
84
+ })]
85
+ }, index))
86
+ });
87
+ }
88
+ /** What a pipeline span changed in the message list, step by step; `null` when it changed nothing. */
89
+ function SpanProcessorMutations({ span }) {
90
+ const mutations = require_domains_traces_components_span_outcome_utils.getSpanChanges(span);
91
+ if (mutations.length === 0) return null;
92
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
93
+ "data-slot": "span-processor-changes",
94
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MutationSteps, { mutations })
95
+ });
96
+ }
97
+ exports.SpanProcessorMutations = SpanProcessorMutations;
98
+
99
+ //# sourceMappingURL=span-processor-mutations.cjs.js.map