@arizeai/phoenix-cli 1.6.1 → 1.7.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.
- package/README.md +170 -1
- package/build/commands/annotationConfig.d.ts +4 -0
- package/build/commands/annotationConfig.d.ts.map +1 -1
- package/build/commands/annotationConfig.js +506 -8
- package/build/commands/annotationConfig.js.map +1 -1
- package/build/commands/annotationConfigValues.d.ts +35 -0
- package/build/commands/annotationConfigValues.d.ts.map +1 -0
- package/build/commands/annotationConfigValues.js +97 -0
- package/build/commands/annotationConfigValues.js.map +1 -0
- package/build/commands/dataset.d.ts.map +1 -1
- package/build/commands/dataset.js +2 -7
- package/build/commands/dataset.js.map +1 -1
- package/build/commands/docs.d.ts.map +1 -1
- package/build/commands/docs.js +2 -1
- package/build/commands/docs.js.map +1 -1
- package/build/commands/formatAnnotationConfigs.d.ts +16 -0
- package/build/commands/formatAnnotationConfigs.d.ts.map +1 -1
- package/build/commands/formatAnnotationConfigs.js +15 -0
- package/build/commands/formatAnnotationConfigs.js.map +1 -1
- package/build/commands/profile.d.ts.map +1 -1
- package/build/commands/profile.js +2 -4
- package/build/commands/profile.js.map +1 -1
- package/build/optionParsers.d.ts +17 -0
- package/build/optionParsers.d.ts.map +1 -0
- package/build/optionParsers.js +22 -0
- package/build/optionParsers.js.map +1 -0
- package/build/pxi/App.d.ts.map +1 -1
- package/build/pxi/App.js +219 -28
- package/build/pxi/App.js.map +1 -1
- package/build/pxi/draftEditor.d.ts +31 -0
- package/build/pxi/draftEditor.d.ts.map +1 -0
- package/build/pxi/draftEditor.js +95 -0
- package/build/pxi/draftEditor.js.map +1 -0
- package/build/pxi/index.d.ts.map +1 -1
- package/build/pxi/index.js +9 -0
- package/build/pxi/index.js.map +1 -1
- package/build/pxi/toolPresentation.d.ts +56 -0
- package/build/pxi/toolPresentation.d.ts.map +1 -0
- package/build/pxi/toolPresentation.js +295 -0
- package/build/pxi/toolPresentation.js.map +1 -0
- package/build/pxi/toolProgress.d.ts +2 -1
- package/build/pxi/toolProgress.d.ts.map +1 -1
- package/build/pxi/toolProgress.js +10 -1
- package/build/pxi/toolProgress.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ToolProgressState } from "./toolProgress.js";
|
|
2
|
+
/**
|
|
3
|
+
* Derives the display elements for one tool call — a terminal-safe icon, a
|
|
4
|
+
* one-line preview of what the tool is doing, and a few detail/error lines —
|
|
5
|
+
* from the tool's (possibly still-streaming) input and output. This mirrors
|
|
6
|
+
* the web UI's per-tool presentation registry in
|
|
7
|
+
* `app/src/components/agent/ToolPart.tsx`, which cannot be imported from this
|
|
8
|
+
* package.
|
|
9
|
+
*
|
|
10
|
+
* Everything here is pure string derivation so it stays cheap: the whole
|
|
11
|
+
* transcript re-renders on every stream snapshot, so presenters only read
|
|
12
|
+
* named fields and clamp raw text before splitting — tool payloads are never
|
|
13
|
+
* stringified or scanned in full.
|
|
14
|
+
*/
|
|
15
|
+
/** Display-ready description of one tool call, derived from its input/output. */
|
|
16
|
+
export type ToolPresentation = {
|
|
17
|
+
/** Terminal-safe glyph identifying the tool (single-width BMP unicode). */
|
|
18
|
+
icon: string;
|
|
19
|
+
/** One-line summary of what the tool is doing; empty until derivable. */
|
|
20
|
+
previewText: string;
|
|
21
|
+
/** Dimmed lines shown under the header, e.g. the bash command excerpt. */
|
|
22
|
+
detailLines: string[];
|
|
23
|
+
/** Red lines shown under the details, e.g. a stderr or error excerpt. */
|
|
24
|
+
errorLines: string[];
|
|
25
|
+
/** Short annotation appended to the header, e.g. `exit 1`. */
|
|
26
|
+
statusSuffix?: string;
|
|
27
|
+
/** Whether the completed call collapses to a single dim line. */
|
|
28
|
+
isQuiet: boolean;
|
|
29
|
+
/** The text of the collapsed quiet line, e.g. `Loaded skill datasets`. */
|
|
30
|
+
quietLabel?: string;
|
|
31
|
+
};
|
|
32
|
+
type ToolPresenterOptions = {
|
|
33
|
+
state: ToolProgressState;
|
|
34
|
+
input: unknown;
|
|
35
|
+
output: unknown;
|
|
36
|
+
errorText?: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Split text into at most `maxLines` display lines, clamping each line's
|
|
40
|
+
* length and appending a `… (+N more lines)` sentinel when lines were cut.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getClampedLines({ text, maxLines, }: {
|
|
43
|
+
text: string;
|
|
44
|
+
maxLines: number;
|
|
45
|
+
}): string[];
|
|
46
|
+
/**
|
|
47
|
+
* Build the {@link ToolPresentation} for a tool call: the bespoke presenter
|
|
48
|
+
* for known tools, else the generic first-string-field preview. Error text
|
|
49
|
+
* from the part is folded into `errorLines` when the presenter didn't already
|
|
50
|
+
* produce a more specific excerpt (e.g. bash stderr).
|
|
51
|
+
*/
|
|
52
|
+
export declare function getToolPresentation({ toolName, state, input, output, errorText, }: ToolPresenterOptions & {
|
|
53
|
+
toolName: string;
|
|
54
|
+
}): ToolPresentation;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=toolPresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolPresentation.d.ts","sourceRoot":"","sources":["../../src/pxi/toolPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;;;;;GAYG;AAEH,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,yEAAyE;IACzE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA8FF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,EAAE,CAsBX;AAqND;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,oBAAoB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,gBAAgB,CAmBhE"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
const GENERIC_TOOL_ICON = "◆";
|
|
2
|
+
/** Cap on how much of a raw payload string is ever inspected. */
|
|
3
|
+
const MAX_SOURCE_LENGTH = 1000;
|
|
4
|
+
const PREVIEW_MAX_LENGTH = 120;
|
|
5
|
+
const DETAIL_LINE_MAX_LENGTH = 200;
|
|
6
|
+
const COMMAND_DETAIL_MAX_LINES = 3;
|
|
7
|
+
const STDERR_MAX_LINES = 2;
|
|
8
|
+
const ERROR_TEXT_MAX_LINES = 3;
|
|
9
|
+
/**
|
|
10
|
+
* Input fields checked, in priority order, when deriving a generic preview
|
|
11
|
+
* for tools without a bespoke presenter.
|
|
12
|
+
*/
|
|
13
|
+
const GENERIC_PREVIEW_FIELDS = [
|
|
14
|
+
"summary",
|
|
15
|
+
"description",
|
|
16
|
+
"query",
|
|
17
|
+
"name",
|
|
18
|
+
"path",
|
|
19
|
+
"url",
|
|
20
|
+
"prompt",
|
|
21
|
+
"text",
|
|
22
|
+
"command",
|
|
23
|
+
];
|
|
24
|
+
/** How many input entries the generic fallback scans for any string value. */
|
|
25
|
+
const GENERIC_SCAN_LIMIT = 20;
|
|
26
|
+
/** Known field aliases for the target URL of provider-native web tools. */
|
|
27
|
+
const NATIVE_WEB_URL_FIELDS = ["url", "uri", "href"];
|
|
28
|
+
/** Known field aliases for the search text of provider-native web search. */
|
|
29
|
+
const NATIVE_WEB_SEARCH_QUERY_FIELDS = ["query", "q", "search_query"];
|
|
30
|
+
function asRecord(value) {
|
|
31
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
32
|
+
? value
|
|
33
|
+
: null;
|
|
34
|
+
}
|
|
35
|
+
function getStringField({ record, field, }) {
|
|
36
|
+
const value = record[field];
|
|
37
|
+
return typeof value === "string" ? value : "";
|
|
38
|
+
}
|
|
39
|
+
function getFirstStringField({ record, fields, }) {
|
|
40
|
+
for (const field of fields) {
|
|
41
|
+
const value = getStringField({ record, field });
|
|
42
|
+
if (value) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return "";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Collapse text to a single width-clamped line: whitespace runs (including
|
|
50
|
+
* newlines) become single spaces, and overlong text is cut with an ellipsis.
|
|
51
|
+
*/
|
|
52
|
+
function toSingleLine({ text, maxLength = PREVIEW_MAX_LENGTH, }) {
|
|
53
|
+
const collapsed = text
|
|
54
|
+
.slice(0, MAX_SOURCE_LENGTH)
|
|
55
|
+
.replace(/\s+/g, " ")
|
|
56
|
+
.trim();
|
|
57
|
+
return collapsed.length > maxLength
|
|
58
|
+
? `${collapsed.slice(0, maxLength)}…`
|
|
59
|
+
: collapsed;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Split text into at most `maxLines` display lines, clamping each line's
|
|
63
|
+
* length and appending a `… (+N more lines)` sentinel when lines were cut.
|
|
64
|
+
*/
|
|
65
|
+
export function getClampedLines({ text, maxLines, }) {
|
|
66
|
+
const truncatedSource = text.length > MAX_SOURCE_LENGTH;
|
|
67
|
+
const allLines = text
|
|
68
|
+
.slice(0, MAX_SOURCE_LENGTH)
|
|
69
|
+
.split("\n")
|
|
70
|
+
.filter((line) => line.trim().length > 0);
|
|
71
|
+
const visibleLines = allLines
|
|
72
|
+
.slice(0, maxLines)
|
|
73
|
+
.map((line) => line.length > DETAIL_LINE_MAX_LENGTH
|
|
74
|
+
? `${line.slice(0, DETAIL_LINE_MAX_LENGTH)}…`
|
|
75
|
+
: line);
|
|
76
|
+
const hiddenLineCount = allLines.length - visibleLines.length;
|
|
77
|
+
if (hiddenLineCount > 0) {
|
|
78
|
+
visibleLines.push(`… (+${hiddenLineCount} more ${hiddenLineCount === 1 ? "line" : "lines"})`);
|
|
79
|
+
}
|
|
80
|
+
else if (truncatedSource && visibleLines.length > 0) {
|
|
81
|
+
visibleLines.push("…");
|
|
82
|
+
}
|
|
83
|
+
return visibleLines;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Generic preview for tools without a bespoke presenter: a string input is
|
|
87
|
+
* used directly; a record input yields its first known preview field, else the
|
|
88
|
+
* first string value among its leading entries.
|
|
89
|
+
*/
|
|
90
|
+
function getGenericToolPreview({ input }) {
|
|
91
|
+
if (typeof input === "string") {
|
|
92
|
+
return toSingleLine({ text: input });
|
|
93
|
+
}
|
|
94
|
+
const record = asRecord(input);
|
|
95
|
+
if (!record) {
|
|
96
|
+
return "";
|
|
97
|
+
}
|
|
98
|
+
const fieldValue = getFirstStringField({
|
|
99
|
+
record,
|
|
100
|
+
fields: GENERIC_PREVIEW_FIELDS,
|
|
101
|
+
});
|
|
102
|
+
if (fieldValue) {
|
|
103
|
+
return toSingleLine({ text: fieldValue });
|
|
104
|
+
}
|
|
105
|
+
for (const value of Object.values(record).slice(0, GENERIC_SCAN_LIMIT)) {
|
|
106
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
107
|
+
return toSingleLine({ text: value });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return "";
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Bash presenter. The preview prefers the model-written `summary`, which
|
|
114
|
+
* streams in before `command`, so a description shows while the command is
|
|
115
|
+
* still arriving; the detail lines are an excerpt of the command itself. On
|
|
116
|
+
* completion, a non-zero exit code surfaces as a status suffix plus a stderr
|
|
117
|
+
* excerpt.
|
|
118
|
+
*/
|
|
119
|
+
function getBashPresentation({ state, input, output, }) {
|
|
120
|
+
const inputRecord = asRecord(input);
|
|
121
|
+
const summary = inputRecord
|
|
122
|
+
? getStringField({ record: inputRecord, field: "summary" })
|
|
123
|
+
: "";
|
|
124
|
+
const command = inputRecord
|
|
125
|
+
? getStringField({ record: inputRecord, field: "command" })
|
|
126
|
+
: "";
|
|
127
|
+
const presentation = {
|
|
128
|
+
icon: "$",
|
|
129
|
+
previewText: toSingleLine({ text: summary || command.split("\n")[0] }),
|
|
130
|
+
detailLines: command
|
|
131
|
+
? getClampedLines({ text: command, maxLines: COMMAND_DETAIL_MAX_LINES })
|
|
132
|
+
: [],
|
|
133
|
+
};
|
|
134
|
+
const outputRecord = state === "output-available" ? asRecord(output) : null;
|
|
135
|
+
if (outputRecord) {
|
|
136
|
+
const exitCode = outputRecord.exit_code;
|
|
137
|
+
if (typeof exitCode === "number" && exitCode !== 0) {
|
|
138
|
+
presentation.statusSuffix = `exit ${exitCode}`;
|
|
139
|
+
const stderr = getStringField({ record: outputRecord, field: "stderr" });
|
|
140
|
+
presentation.errorLines = stderr
|
|
141
|
+
? getClampedLines({ text: stderr, maxLines: STDERR_MAX_LINES })
|
|
142
|
+
: [];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return presentation;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Provider-native web search: prefer the query text; typed non-search actions
|
|
149
|
+
* (e.g. page reads) show a humanized action label with their target.
|
|
150
|
+
*/
|
|
151
|
+
function getWebSearchPresentation({ input, }) {
|
|
152
|
+
const presentation = { icon: "⌕" };
|
|
153
|
+
const record = asRecord(input);
|
|
154
|
+
if (typeof input === "string") {
|
|
155
|
+
presentation.previewText = toSingleLine({ text: input });
|
|
156
|
+
return presentation;
|
|
157
|
+
}
|
|
158
|
+
if (!record) {
|
|
159
|
+
return presentation;
|
|
160
|
+
}
|
|
161
|
+
const type = getStringField({ record, field: "type" });
|
|
162
|
+
if (type && type !== "search") {
|
|
163
|
+
const value = getFirstStringField({ record, fields: NATIVE_WEB_URL_FIELDS }) ||
|
|
164
|
+
getFirstStringField({ record, fields: NATIVE_WEB_SEARCH_QUERY_FIELDS });
|
|
165
|
+
const label = type
|
|
166
|
+
.split("_")
|
|
167
|
+
.filter(Boolean)
|
|
168
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
169
|
+
.join(" ");
|
|
170
|
+
presentation.previewText = toSingleLine({
|
|
171
|
+
text: value ? `${label}: ${value}` : label,
|
|
172
|
+
});
|
|
173
|
+
return presentation;
|
|
174
|
+
}
|
|
175
|
+
const query = getFirstStringField({
|
|
176
|
+
record,
|
|
177
|
+
fields: NATIVE_WEB_SEARCH_QUERY_FIELDS,
|
|
178
|
+
});
|
|
179
|
+
if (query) {
|
|
180
|
+
presentation.previewText = toSingleLine({ text: query });
|
|
181
|
+
return presentation;
|
|
182
|
+
}
|
|
183
|
+
const queries = record.queries;
|
|
184
|
+
if (Array.isArray(queries)) {
|
|
185
|
+
const firstQuery = queries.find((value) => typeof value === "string" && value.length > 0);
|
|
186
|
+
if (firstQuery) {
|
|
187
|
+
presentation.previewText = toSingleLine({ text: firstQuery });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return presentation;
|
|
191
|
+
}
|
|
192
|
+
function getWebFetchPresentation({ input, }) {
|
|
193
|
+
const record = asRecord(input);
|
|
194
|
+
return {
|
|
195
|
+
icon: "↓",
|
|
196
|
+
previewText: record
|
|
197
|
+
? toSingleLine({
|
|
198
|
+
text: getFirstStringField({ record, fields: NATIVE_WEB_URL_FIELDS }),
|
|
199
|
+
})
|
|
200
|
+
: "",
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function getCallSubagentPresentation({ input, }) {
|
|
204
|
+
const record = asRecord(input);
|
|
205
|
+
return {
|
|
206
|
+
icon: "◇",
|
|
207
|
+
previewText: record
|
|
208
|
+
? toSingleLine({ text: getStringField({ record, field: "name" }) })
|
|
209
|
+
: "",
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Skill loads are routine bookkeeping: once complete they collapse to a
|
|
214
|
+
* single dim `Loaded skill <name>` line instead of a full tool row.
|
|
215
|
+
*/
|
|
216
|
+
function getLoadSkillPresentation({ state, input, }) {
|
|
217
|
+
const record = asRecord(input);
|
|
218
|
+
const skillName = record
|
|
219
|
+
? getStringField({ record, field: "skill_name" })
|
|
220
|
+
: "";
|
|
221
|
+
const presentation = {
|
|
222
|
+
icon: "✦",
|
|
223
|
+
previewText: toSingleLine({ text: skillName }),
|
|
224
|
+
};
|
|
225
|
+
if (state === "output-available") {
|
|
226
|
+
presentation.isQuiet = true;
|
|
227
|
+
presentation.quietLabel = skillName
|
|
228
|
+
? `Loaded skill ${toSingleLine({ text: skillName })}`
|
|
229
|
+
: "Loaded skill";
|
|
230
|
+
}
|
|
231
|
+
return presentation;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Skill resource reads are routine bookkeeping, like skill loads: once
|
|
235
|
+
* complete they collapse to a single dim `Read skill resource
|
|
236
|
+
* <skill>/<resource>` line instead of a full tool row.
|
|
237
|
+
*/
|
|
238
|
+
function getReadSkillResourcePresentation({ state, input, }) {
|
|
239
|
+
const record = asRecord(input);
|
|
240
|
+
const skillName = record
|
|
241
|
+
? getStringField({ record, field: "skill_name" })
|
|
242
|
+
: "";
|
|
243
|
+
const resourceName = record
|
|
244
|
+
? getStringField({ record, field: "resource_name" })
|
|
245
|
+
: "";
|
|
246
|
+
const resourceLabel = toSingleLine({
|
|
247
|
+
text: [skillName, resourceName].filter(Boolean).join("/"),
|
|
248
|
+
});
|
|
249
|
+
const presentation = {
|
|
250
|
+
icon: "✦",
|
|
251
|
+
previewText: resourceLabel,
|
|
252
|
+
};
|
|
253
|
+
if (state === "output-available") {
|
|
254
|
+
presentation.isQuiet = true;
|
|
255
|
+
presentation.quietLabel = resourceLabel
|
|
256
|
+
? `Read skill resource ${resourceLabel}`
|
|
257
|
+
: "Read skill resource";
|
|
258
|
+
}
|
|
259
|
+
return presentation;
|
|
260
|
+
}
|
|
261
|
+
const TOOL_PRESENTERS = {
|
|
262
|
+
bash: getBashPresentation,
|
|
263
|
+
web_search: getWebSearchPresentation,
|
|
264
|
+
web_fetch: getWebFetchPresentation,
|
|
265
|
+
call_subagent: getCallSubagentPresentation,
|
|
266
|
+
load_skill: getLoadSkillPresentation,
|
|
267
|
+
read_skill_resource: getReadSkillResourcePresentation,
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* Build the {@link ToolPresentation} for a tool call: the bespoke presenter
|
|
271
|
+
* for known tools, else the generic first-string-field preview. Error text
|
|
272
|
+
* from the part is folded into `errorLines` when the presenter didn't already
|
|
273
|
+
* produce a more specific excerpt (e.g. bash stderr).
|
|
274
|
+
*/
|
|
275
|
+
export function getToolPresentation({ toolName, state, input, output, errorText, }) {
|
|
276
|
+
const presenter = TOOL_PRESENTERS[toolName];
|
|
277
|
+
const presentation = {
|
|
278
|
+
icon: GENERIC_TOOL_ICON,
|
|
279
|
+
previewText: "",
|
|
280
|
+
detailLines: [],
|
|
281
|
+
errorLines: [],
|
|
282
|
+
isQuiet: false,
|
|
283
|
+
...(presenter
|
|
284
|
+
? presenter({ state, input, output, errorText })
|
|
285
|
+
: { previewText: getGenericToolPreview({ input }) }),
|
|
286
|
+
};
|
|
287
|
+
if (presentation.errorLines.length === 0 && errorText) {
|
|
288
|
+
presentation.errorLines = getClampedLines({
|
|
289
|
+
text: errorText,
|
|
290
|
+
maxLines: ERROR_TEXT_MAX_LINES,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
return presentation;
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=toolPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolPresentation.js","sourceRoot":"","sources":["../../src/pxi/toolPresentation.ts"],"names":[],"mappings":"AA6CA,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,iEAAiE;AACjE,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAC/B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;GAGG;AACH,MAAM,sBAAsB,GAAG;IAC7B,SAAS;IACT,aAAa;IACb,OAAO;IACP,MAAM;IACN,MAAM;IACN,KAAK;IACL,QAAQ;IACR,MAAM;IACN,SAAS;CACV,CAAC;AAEF,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,2EAA2E;AAC3E,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAErD,6EAA6E;AAC7E,MAAM,8BAA8B,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAEtE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,MAAM,EACN,KAAK,GAIN;IACC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC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AO,EAAE,KAAK;QACd,GAAG,CAAC,SAAS;YACX,CAAC,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;YAChD,CAAC,CAAC,EAAE,WAAW,EAAE,qBAAqB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KACvD,CAAC;IACF,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,EAAE,CAAC;QACtD,YAAY,CAAC,UAAU,GAAG,eAAe,CAAC;YACxC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,oBAAoB;SAC/B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UIDataTypes, UIMessagePart, UITools } from "ai";
|
|
2
|
+
import { type ToolPresentation } from "./toolPresentation.js";
|
|
2
3
|
import type { PxiMessage } from "./types.js";
|
|
3
4
|
/**
|
|
4
5
|
* Distills the AI SDK's tool-call message parts into a small, display-ready
|
|
@@ -16,7 +17,7 @@ export type ToolProgress = {
|
|
|
16
17
|
state: ToolProgressState;
|
|
17
18
|
statusText: string;
|
|
18
19
|
errorText?: string;
|
|
19
|
-
};
|
|
20
|
+
} & ToolPresentation;
|
|
20
21
|
/**
|
|
21
22
|
* Collect the progress of every tool call across a list of messages, in order,
|
|
22
23
|
* skipping non-tool parts.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolProgress.d.ts","sourceRoot":"","sources":["../../src/pxi/toolProgress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;GAMG;AAEH,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GACzB,iBAAiB,GACjB,iBAAiB,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AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CAK3E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getToolPresentation } from "./toolPresentation.js";
|
|
1
2
|
/**
|
|
2
3
|
* Type guard recognizing the message parts that represent a tool call — both
|
|
3
4
|
* statically-typed (`tool-*`) and dynamic tools — so non-tool parts (like text)
|
|
@@ -53,12 +54,20 @@ export function getToolProgressFromPart({ part, }) {
|
|
|
53
54
|
}
|
|
54
55
|
const toolName = getToolName(part);
|
|
55
56
|
const state = part.state;
|
|
57
|
+
const errorText = "errorText" in part ? part.errorText : undefined;
|
|
56
58
|
return {
|
|
57
59
|
toolCallId: part.toolCallId,
|
|
58
60
|
toolName,
|
|
59
61
|
state,
|
|
60
62
|
statusText: getStatusText(state),
|
|
61
|
-
errorText
|
|
63
|
+
errorText,
|
|
64
|
+
...getToolPresentation({
|
|
65
|
+
toolName,
|
|
66
|
+
state,
|
|
67
|
+
input: part.input,
|
|
68
|
+
output: part.output,
|
|
69
|
+
errorText,
|
|
70
|
+
}),
|
|
62
71
|
};
|
|
63
72
|
}
|
|
64
73
|
/** Concatenate the text of all text parts in a message, ignoring tool parts. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolProgress.js","sourceRoot":"","sources":["../../src/pxi/toolProgress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolProgress.js","sourceRoot":"","sources":["../../src/pxi/toolProgress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAyB,MAAM,oBAAoB,CAAC;AAuChF;;;;GAIG;AACH,SAAS,aAAa,CACpB,IAAyC;IAEzC,OAAO,CACL,YAAY,IAAI,IAAI;QACpB,OAAO,IAAI,IAAI;QACf,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,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,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,MAAM,SAAS,GAAG,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,OAAO;QACL,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,QAAQ;QACR,KAAK;QACL,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC;QAChC,SAAS;QACT,GAAG,mBAAmB,CAAC;YACrB,QAAQ;YACR,KAAK;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,SAAS;SACV,CAAC;KACH,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAA2B;IACjE,OAAO,OAAO,CAAC,KAAK;SACjB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;SACtC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arizeai/phoenix-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A command-line interface for Phoenix",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arize",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@arizeai/openinference-semantic-conventions": "^2.5.0",
|
|
35
35
|
"@clack/prompts": "^1.6.0",
|
|
36
|
-
"ai": "^6.0.
|
|
36
|
+
"ai": "^6.0.219",
|
|
37
37
|
"commander": "^15.0.0",
|
|
38
38
|
"ink": "^6.8.0",
|
|
39
39
|
"marked": "^12.0.2",
|
|
40
40
|
"marked-terminal": "^7.3.0",
|
|
41
41
|
"react": "19.2.7",
|
|
42
42
|
"zod": "^4.4.3",
|
|
43
|
-
"@arizeai/phoenix-client": "6.
|
|
43
|
+
"@arizeai/phoenix-client": "6.12.0",
|
|
44
44
|
"@arizeai/phoenix-config": "0.1.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"ink-testing-library": "^4.0.0",
|
|
50
50
|
"rimraf": "^6.1.3",
|
|
51
51
|
"tsc-alias": "^1.8.17",
|
|
52
|
-
"tsx": "^4.22.
|
|
52
|
+
"tsx": "^4.22.5",
|
|
53
53
|
"vitest": "^4.1.9"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|