@arizeai/phoenix-cli 1.15.2 → 1.16.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 +2 -1
- package/build/pxi/App.d.ts +9 -2
- package/build/pxi/App.d.ts.map +1 -1
- package/build/pxi/App.js +931 -34
- package/build/pxi/App.js.map +1 -1
- package/build/pxi/client.d.ts +36 -21
- package/build/pxi/client.d.ts.map +1 -1
- package/build/pxi/client.js +373 -36
- package/build/pxi/client.js.map +1 -1
- package/build/pxi/commands.d.ts +10 -1
- package/build/pxi/commands.d.ts.map +1 -1
- package/build/pxi/commands.js +27 -2
- package/build/pxi/commands.js.map +1 -1
- package/build/pxi/compaction.d.ts +19 -0
- package/build/pxi/compaction.d.ts.map +1 -0
- package/build/pxi/compaction.js +24 -0
- package/build/pxi/compaction.js.map +1 -0
- package/build/pxi/index.d.ts +5 -5
- package/build/pxi/index.d.ts.map +1 -1
- package/build/pxi/index.js +7 -6
- package/build/pxi/index.js.map +1 -1
- package/build/pxi/options.d.ts +1 -1
- package/build/pxi/options.d.ts.map +1 -1
- package/build/pxi/options.js +5 -1
- package/build/pxi/options.js.map +1 -1
- package/build/pxi/preflight.d.ts +51 -4
- package/build/pxi/preflight.d.ts.map +1 -1
- package/build/pxi/preflight.js +99 -4
- package/build/pxi/preflight.js.map +1 -1
- package/build/pxi/tokenUsage.d.ts +3 -3
- package/build/pxi/tokenUsage.d.ts.map +1 -1
- package/build/pxi/tokenUsage.js +2 -1
- package/build/pxi/tokenUsage.js.map +1 -1
- package/build/pxi/toolPresentation.d.ts.map +1 -1
- package/build/pxi/toolPresentation.js +4 -1
- package/build/pxi/toolPresentation.js.map +1 -1
- package/build/pxi/types.d.ts +116 -58
- package/build/pxi/types.d.ts.map +1 -1
- package/package.json +3 -3
package/build/pxi/types.d.ts
CHANGED
|
@@ -1,89 +1,69 @@
|
|
|
1
|
+
import type { componentsV1 } from "@arizeai/phoenix-client";
|
|
1
2
|
import type { ChatTransport, UIMessage } from "ai";
|
|
2
3
|
import type { PhoenixConfig } from "../config.js";
|
|
3
4
|
/**
|
|
4
5
|
* Shared types for the PXI terminal chat.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Wire types are derived from the generated OpenAPI schema so the CLI and the
|
|
8
|
+
* server stay in lockstep at compile time. The exception is the chat message
|
|
9
|
+
* itself: the streaming layer is driven by the Vercel AI SDK, so
|
|
10
|
+
* {@link PxiMessage} is typed by the SDK's `UIMessage` rather than the
|
|
11
|
+
* schema's structural equivalent.
|
|
9
12
|
*/
|
|
13
|
+
type SchemasV1 = componentsV1["schemas"];
|
|
10
14
|
/**
|
|
11
15
|
* Extra metadata the server attaches to each assistant message — the session it
|
|
12
16
|
* belongs to, the Phoenix trace it produced (so the UI can link back to it), and
|
|
13
17
|
* token usage. Fields are nullable because tracing and usage reporting are
|
|
14
18
|
* optional and may be disabled server-side.
|
|
15
19
|
*/
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
total: number;
|
|
27
|
-
};
|
|
28
|
-
promptDetails?: {
|
|
29
|
-
cacheRead: number;
|
|
30
|
-
cacheWrite: number;
|
|
31
|
-
} | null;
|
|
32
|
-
} | null;
|
|
20
|
+
export type PhoenixAssistantMessageMetadata = SchemasV1["PhoenixAssistantMessageMetadata"];
|
|
21
|
+
/**
|
|
22
|
+
* `UIMessage.metadata` as a registry of namespaces: Phoenix's own fields under
|
|
23
|
+
* `phoenix`, pydantic-ai's message-level round-trip channel under `pydantic_ai`.
|
|
24
|
+
*/
|
|
25
|
+
export type PxiMessageMetadata = SchemasV1["MessageMetadata"];
|
|
26
|
+
/** Transient data chunks streamed alongside assistant message content. */
|
|
27
|
+
type PxiDataTypes = {
|
|
28
|
+
"session-summary": SchemasV1["SessionSummaryChunk"]["data"];
|
|
29
|
+
"transcript-persisted": SchemasV1["TranscriptPersistedChunk"]["data"];
|
|
33
30
|
};
|
|
34
31
|
/** A chat message (user or assistant) carrying PXI-specific metadata. */
|
|
35
|
-
export type PxiMessage = UIMessage<
|
|
36
|
-
export type BuiltInProvider = "
|
|
32
|
+
export type PxiMessage = UIMessage<PxiMessageMetadata, PxiDataTypes>;
|
|
33
|
+
export type BuiltInProvider = SchemasV1["ModelProvider"];
|
|
37
34
|
/**
|
|
38
35
|
* Which model PXI should talk to. Either a built-in provider keyed by name
|
|
39
36
|
* (e.g. `ANTHROPIC` + `claude-opus-4-6`) or a custom provider configured in
|
|
40
37
|
* Phoenix and addressed by its server-side id.
|
|
41
38
|
*/
|
|
42
|
-
export type ModelSelection =
|
|
43
|
-
providerType: "builtin";
|
|
44
|
-
provider: BuiltInProvider;
|
|
45
|
-
modelName: string;
|
|
46
|
-
} | {
|
|
47
|
-
providerType: "custom";
|
|
48
|
-
providerId: string;
|
|
49
|
-
modelName: string;
|
|
50
|
-
};
|
|
39
|
+
export type ModelSelection = SchemasV1["AgentModelSelection"];
|
|
51
40
|
/**
|
|
52
41
|
* A capability/environment hint sent alongside the conversation so the server
|
|
53
42
|
* agent knows what it is allowed to do and the world it is operating in — the
|
|
54
43
|
* caller's local clock and time zone, whether GraphQL mutations are permitted,
|
|
55
|
-
* and whether web access and subagents are enabled for this run.
|
|
44
|
+
* and whether web access and subagents are enabled for this run. A subset of
|
|
45
|
+
* the server's full `ChatContext` union: the rest are browser-only surfaces.
|
|
56
46
|
*/
|
|
57
|
-
export type PxiContext = {
|
|
58
|
-
type: "app";
|
|
59
|
-
|
|
60
|
-
timeZone: string;
|
|
61
|
-
} | {
|
|
62
|
-
type: "graphql";
|
|
63
|
-
mutationsEnabled: boolean;
|
|
64
|
-
} | {
|
|
65
|
-
type: "web_access";
|
|
66
|
-
enabled: boolean;
|
|
67
|
-
} | {
|
|
68
|
-
type: "subagents";
|
|
69
|
-
enabled: boolean;
|
|
70
|
-
};
|
|
47
|
+
export type PxiContext = Extract<SchemasV1["ChatContext"], {
|
|
48
|
+
type: "app" | "graphql" | "web_access" | "subagents";
|
|
49
|
+
}>;
|
|
71
50
|
/**
|
|
72
51
|
* How edit-style tool calls are gated: `"manual"` requires the user to approve
|
|
73
52
|
* each one, `"bypass"` lets them run unattended (where the server supports it).
|
|
74
53
|
*/
|
|
75
|
-
export type PxiEditPermission = "
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
54
|
+
export type PxiEditPermission = NonNullable<SchemasV1["ChatRequestBody"]["editPermission"]>;
|
|
55
|
+
/**
|
|
56
|
+
* The request body POSTed to the agent-session chat endpoint. The server owns
|
|
57
|
+
* the session transcript, so each turn carries only its trailing message.
|
|
58
|
+
*
|
|
59
|
+
* Derived from the generated `ChatRequestBody` schema, with every field the CLI
|
|
60
|
+
* sends made required (the schema marks server-defaulted fields optional) and
|
|
61
|
+
* `message` swapped for the SDK-typed {@link PxiMessage}. Fields the CLI never
|
|
62
|
+
* sends (`requestedSkills`, `turnTraceContext`, and `toolOutputs` — the CLI
|
|
63
|
+
* executes no client tools, so it has no tool outputs to submit) are omitted.
|
|
64
|
+
*/
|
|
65
|
+
export type PxiChatRequest = Required<Omit<SchemasV1["ChatRequestBody"], "message" | "requestedSkills" | "turnTraceContext" | "toolOutputs">> & {
|
|
66
|
+
message: PxiMessage;
|
|
87
67
|
};
|
|
88
68
|
/**
|
|
89
69
|
* The fully-resolved configuration for a single PXI session, produced by
|
|
@@ -95,6 +75,12 @@ export type PxiRuntimeOptions = {
|
|
|
95
75
|
sessionId: string;
|
|
96
76
|
config: PhoenixConfig;
|
|
97
77
|
modelSelection: ModelSelection;
|
|
78
|
+
/**
|
|
79
|
+
* Whether `--provider`/`--model`/`--custom-provider-id` were passed. Those
|
|
80
|
+
* flags express an intent to move a restored session onto that model, so
|
|
81
|
+
* restoring writes it rather than shadowing the persisted value locally.
|
|
82
|
+
*/
|
|
83
|
+
hasExplicitModelSelection: boolean;
|
|
98
84
|
skipModelPreflight: boolean;
|
|
99
85
|
enableWebAccess: boolean;
|
|
100
86
|
enableSubagents: boolean;
|
|
@@ -104,6 +90,76 @@ export type PxiRuntimeOptions = {
|
|
|
104
90
|
exportRemoteTraces: boolean;
|
|
105
91
|
attachUserId: boolean;
|
|
106
92
|
};
|
|
93
|
+
/** A persisted server-side chat session shown in the session picker. */
|
|
94
|
+
export type PxiSessionSummary = {
|
|
95
|
+
id: string;
|
|
96
|
+
title: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
isTemporary: boolean;
|
|
99
|
+
};
|
|
100
|
+
/** A session and its canonical persisted transcript. */
|
|
101
|
+
export type PxiSession = PxiSessionSummary & {
|
|
102
|
+
messages: PxiMessage[];
|
|
103
|
+
model: ModelSelection;
|
|
104
|
+
/**
|
|
105
|
+
* Whether another client currently holds the session's server-side lock.
|
|
106
|
+
* Absent means no lock is held.
|
|
107
|
+
*/
|
|
108
|
+
isActive?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* The message ID of the most recently persisted transcript message, or
|
|
111
|
+
* null for an empty transcript.
|
|
112
|
+
*/
|
|
113
|
+
lastMessageId?: string | null;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Cheap synchronization probe for a session: whether another client's turn
|
|
117
|
+
* holds the lock and where the persisted transcript's tail currently is.
|
|
118
|
+
* Polling fetches this instead of the full transcript and only downloads
|
|
119
|
+
* messages when the tail has moved.
|
|
120
|
+
*/
|
|
121
|
+
export type PxiSessionSyncState = {
|
|
122
|
+
isActive: boolean;
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
lastMessageId: string | null;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The outcome of a compaction request. `compacted` is true when a new
|
|
128
|
+
* checkpoint was persisted, and `compactionMessage` is that checkpoint. A
|
|
129
|
+
* no-op — the conversation was already as compact as it can get — yields
|
|
130
|
+
* `compacted: false` with no message.
|
|
131
|
+
*/
|
|
132
|
+
export type PxiCompactionResult = {
|
|
133
|
+
compacted: boolean;
|
|
134
|
+
compactionMessage: PxiMessage | null;
|
|
135
|
+
};
|
|
136
|
+
/** Server-side session operations used by the chat UI. */
|
|
137
|
+
export type PxiSessionClient = {
|
|
138
|
+
createSession: (options: {
|
|
139
|
+
temporary: boolean;
|
|
140
|
+
model: ModelSelection;
|
|
141
|
+
}) => Promise<PxiSession>;
|
|
142
|
+
listSessions: () => Promise<PxiSessionSummary[]>;
|
|
143
|
+
getSession: (options: {
|
|
144
|
+
sessionId: string;
|
|
145
|
+
}) => Promise<PxiSession>;
|
|
146
|
+
getSessionSyncState: (options: {
|
|
147
|
+
sessionId: string;
|
|
148
|
+
}) => Promise<PxiSessionSyncState>;
|
|
149
|
+
/**
|
|
150
|
+
* Change the model a persisted session runs on, returning the selection in
|
|
151
|
+
* effect. Turns assert the model they expect rather than setting it, so this
|
|
152
|
+
* is the only way to move an existing session to a different model.
|
|
153
|
+
*/
|
|
154
|
+
patchSessionModel: (options: {
|
|
155
|
+
sessionId: string;
|
|
156
|
+
model: ModelSelection;
|
|
157
|
+
}) => Promise<ModelSelection>;
|
|
158
|
+
compactSession: (options: {
|
|
159
|
+
sessionId: string;
|
|
160
|
+
model: ModelSelection;
|
|
161
|
+
}) => Promise<PxiCompactionResult>;
|
|
162
|
+
};
|
|
107
163
|
/**
|
|
108
164
|
* The interface the UI uses to talk to PXI. `sendMessage` streams an assistant
|
|
109
165
|
* reply: `onAssistantMessage` fires on every incremental update so the UI can
|
|
@@ -116,8 +172,10 @@ export type PxiChatClient = {
|
|
|
116
172
|
messages: PxiMessage[];
|
|
117
173
|
abortSignal?: AbortSignal;
|
|
118
174
|
onAssistantMessage: (message: PxiMessage) => void;
|
|
175
|
+
onSessionTitle?: (title: string) => void;
|
|
119
176
|
}) => Promise<PxiMessage | null>;
|
|
120
177
|
};
|
|
121
178
|
/** The AI SDK chat transport specialized to {@link PxiMessage}. */
|
|
122
179
|
export type PxiTransport = ChatTransport<PxiMessage>;
|
|
180
|
+
export {};
|
|
123
181
|
//# sourceMappingURL=types.d.ts.map
|
package/build/pxi/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pxi/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pxi/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;;;;GAQG;AAEH,KAAK,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GACzC,SAAS,CAAC,iCAAiC,CAAC,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAE9D,0EAA0E;AAC1E,KAAK,YAAY,GAAG;IAClB,iBAAiB,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5D,sBAAsB,EAAE,SAAS,CAAC,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;CACvE,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG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;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,cAAc,CAAC;KACvB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,CAAC,OAAO,EAAE;QACrB,QAAQ,EAAE,UAAU,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;QAClD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KAC1C,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CAClC,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arizeai/phoenix-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "A command-line interface for Phoenix",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arize",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"marked-terminal": "^7.3.0",
|
|
43
43
|
"react": "19.2.7",
|
|
44
44
|
"zod": "^4.4.3",
|
|
45
|
-
"@arizeai/phoenix-
|
|
46
|
-
"@arizeai/phoenix-
|
|
45
|
+
"@arizeai/phoenix-client": "7.5.0",
|
|
46
|
+
"@arizeai/phoenix-config": "0.5.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/cross-spawn": "^6.0.6",
|