@arizeai/phoenix-cli 1.5.3 → 1.6.1

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 (45) hide show
  1. package/build/pxi/App.d.ts +22 -0
  2. package/build/pxi/App.d.ts.map +1 -0
  3. package/build/pxi/App.js +328 -0
  4. package/build/pxi/App.js.map +1 -0
  5. package/build/pxi/client.d.ts +77 -0
  6. package/build/pxi/client.d.ts.map +1 -0
  7. package/build/pxi/client.js +170 -0
  8. package/build/pxi/client.js.map +1 -0
  9. package/build/pxi/commands.d.ts +37 -0
  10. package/build/pxi/commands.d.ts.map +1 -0
  11. package/build/pxi/commands.js +61 -0
  12. package/build/pxi/commands.js.map +1 -0
  13. package/build/pxi/index.d.ts +14 -0
  14. package/build/pxi/index.d.ts.map +1 -0
  15. package/build/pxi/index.js +36 -0
  16. package/build/pxi/index.js.map +1 -0
  17. package/build/pxi/inkMarkdown.d.ts +17 -0
  18. package/build/pxi/inkMarkdown.d.ts.map +1 -0
  19. package/build/pxi/inkMarkdown.js +22 -0
  20. package/build/pxi/inkMarkdown.js.map +1 -0
  21. package/build/pxi/markdown.d.ts +24 -0
  22. package/build/pxi/markdown.d.ts.map +1 -0
  23. package/build/pxi/markdown.js +115 -0
  24. package/build/pxi/markdown.js.map +1 -0
  25. package/build/pxi/options.d.ts +64 -0
  26. package/build/pxi/options.d.ts.map +1 -0
  27. package/build/pxi/options.js +148 -0
  28. package/build/pxi/options.js.map +1 -0
  29. package/build/pxi/preflight.d.ts +88 -0
  30. package/build/pxi/preflight.d.ts.map +1 -0
  31. package/build/pxi/preflight.js +255 -0
  32. package/build/pxi/preflight.js.map +1 -0
  33. package/build/pxi/tokenUsage.d.ts +35 -0
  34. package/build/pxi/tokenUsage.d.ts.map +1 -0
  35. package/build/pxi/tokenUsage.js +62 -0
  36. package/build/pxi/tokenUsage.js.map +1 -0
  37. package/build/pxi/toolProgress.d.ts +37 -0
  38. package/build/pxi/toolProgress.d.ts.map +1 -0
  39. package/build/pxi/toolProgress.js +71 -0
  40. package/build/pxi/toolProgress.js.map +1 -0
  41. package/build/pxi/types.d.ts +123 -0
  42. package/build/pxi/types.d.ts.map +1 -0
  43. package/build/pxi/types.js +2 -0
  44. package/build/pxi/types.js.map +1 -0
  45. package/package.json +14 -5
@@ -0,0 +1,123 @@
1
+ import type { ChatTransport, UIMessage } from "ai";
2
+ import type { PhoenixConfig } from "../config.js";
3
+ /**
4
+ * Shared types for the PXI terminal chat.
5
+ *
6
+ * These mirror the wire contract of the Phoenix server-agent chat endpoint so
7
+ * the CLI and the server stay in lockstep: the CLI sends a {@link PxiChatRequest}
8
+ * and renders the streamed {@link PxiMessage}s it gets back.
9
+ */
10
+ /**
11
+ * Extra metadata the server attaches to each assistant message — the session it
12
+ * belongs to, the Phoenix trace it produced (so the UI can link back to it), and
13
+ * token usage. Fields are nullable because tracing and usage reporting are
14
+ * optional and may be disabled server-side.
15
+ */
16
+ export type AssistantMessageMetadata = {
17
+ sessionId: string;
18
+ trace?: {
19
+ traceId: string;
20
+ rootSpanId: string;
21
+ } | null;
22
+ usage?: {
23
+ tokens: {
24
+ prompt: number;
25
+ completion: number;
26
+ total: number;
27
+ };
28
+ promptDetails?: {
29
+ cacheRead: number;
30
+ cacheWrite: number;
31
+ } | null;
32
+ } | null;
33
+ };
34
+ /** A chat message (user or assistant) carrying PXI-specific metadata. */
35
+ export type PxiMessage = UIMessage<AssistantMessageMetadata>;
36
+ export type BuiltInProvider = "ANTHROPIC" | "AWS" | "AZURE_OPENAI" | "CEREBRAS" | "DEEPSEEK" | "FIREWORKS" | "GOOGLE" | "GROQ" | "MOONSHOT" | "OLLAMA" | "OPENAI" | "PERPLEXITY" | "TOGETHER" | "XAI";
37
+ /**
38
+ * Which model PXI should talk to. Either a built-in provider keyed by name
39
+ * (e.g. `ANTHROPIC` + `claude-opus-4-6`) or a custom provider configured in
40
+ * Phoenix and addressed by its server-side id.
41
+ */
42
+ export type ModelSelection = {
43
+ providerType: "builtin";
44
+ provider: BuiltInProvider;
45
+ modelName: string;
46
+ } | {
47
+ providerType: "custom";
48
+ providerId: string;
49
+ modelName: string;
50
+ };
51
+ /**
52
+ * A capability/environment hint sent alongside the conversation so the server
53
+ * agent knows what it is allowed to do and the world it is operating in — the
54
+ * caller's local clock and time zone, whether GraphQL mutations are permitted,
55
+ * and whether web access and subagents are enabled for this run.
56
+ */
57
+ export type PxiContext = {
58
+ type: "app";
59
+ currentDateTime: string;
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
+ };
71
+ /**
72
+ * How edit-style tool calls are gated: `"manual"` requires the user to approve
73
+ * each one, `"bypass"` lets them run unattended (where the server supports it).
74
+ */
75
+ export type PxiEditPermission = "manual" | "bypass";
76
+ /** The request body POSTed to the Phoenix server-agent chat endpoint. */
77
+ export type PxiChatRequest = {
78
+ id: string;
79
+ messages: PxiMessage[];
80
+ trigger: "submit-message";
81
+ ingestTraces: boolean;
82
+ exportRemoteTraces: boolean;
83
+ attachUserId: boolean;
84
+ editPermission: PxiEditPermission;
85
+ contexts: PxiContext[];
86
+ model: ModelSelection;
87
+ };
88
+ /**
89
+ * The fully-resolved configuration for a single PXI session, produced by
90
+ * merging CLI flags, the active profile, and defaults. Everything the UI and
91
+ * client need to run is captured here, so the rest of the code can treat it as
92
+ * the single source of truth rather than re-reading flags or config.
93
+ */
94
+ export type PxiRuntimeOptions = {
95
+ sessionId: string;
96
+ config: PhoenixConfig;
97
+ modelSelection: ModelSelection;
98
+ skipModelPreflight: boolean;
99
+ enableWebAccess: boolean;
100
+ enableSubagents: boolean;
101
+ enableGraphqlMutations: boolean;
102
+ editPermission: PxiEditPermission;
103
+ ingestTraces: boolean;
104
+ exportRemoteTraces: boolean;
105
+ attachUserId: boolean;
106
+ };
107
+ /**
108
+ * The interface the UI uses to talk to PXI. `sendMessage` streams an assistant
109
+ * reply: `onAssistantMessage` fires on every incremental update so the UI can
110
+ * re-render mid-stream, and the promise resolves with the final message (or
111
+ * `null` if nothing was produced). Defining this as an interface lets tests
112
+ * swap in a fake client without a real network transport.
113
+ */
114
+ export type PxiChatClient = {
115
+ sendMessage: (options: {
116
+ messages: PxiMessage[];
117
+ abortSignal?: AbortSignal;
118
+ onAssistantMessage: (message: PxiMessage) => void;
119
+ }) => Promise<PxiMessage | null>;
120
+ };
121
+ /** The AI SDK chat transport specialized to {@link PxiMessage}. */
122
+ export type PxiTransport = ChatTransport<PxiMessage>;
123
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +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;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,IAAI,CAAC;IACT,KAAK,CAAC,EAAE;QACN,MAAM,EAAE;YACN,MAAM,EAAE,MAAM,CAAC;YACf,UAAU,EAAE,MAAM,CAAC;YACnB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,aAAa,CAAC,EAAE;YACd,SAAS,EAAE,MAAM,CAAC;YAClB,UAAU,EAAE,MAAM,CAAC;SACpB,GAAG,IAAI,CAAC;KACV,GAAG,IAAI,CAAC;CACV,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,wBAAwB,CAAC,CAAC;AAE7D,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,KAAK,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AAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,EAAE,cAAc,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,sBAAsB,EAAE,OAAO,CAAC;IAChC,cAAc,EAAE,iBAAiB,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;CACvB,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;KACnD,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CAClC,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pxi/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arizeai/phoenix-cli",
3
- "version": "1.5.3",
3
+ "version": "1.6.1",
4
4
  "description": "A command-line interface for Phoenix",
5
5
  "keywords": [
6
6
  "arize",
@@ -20,7 +20,8 @@
20
20
  },
21
21
  "bin": {
22
22
  "phoenix-cli": "build/index.js",
23
- "px": "build/index.js"
23
+ "px": "build/index.js",
24
+ "pxi": "build/pxi/index.js"
24
25
  },
25
26
  "files": [
26
27
  "build",
@@ -31,14 +32,21 @@
31
32
  "types": "build/index.d.ts",
32
33
  "dependencies": {
33
34
  "@arizeai/openinference-semantic-conventions": "^2.5.0",
34
- "@clack/prompts": "^1.5.1",
35
+ "@clack/prompts": "^1.6.0",
36
+ "ai": "^6.0.211",
35
37
  "commander": "^15.0.0",
38
+ "ink": "^6.8.0",
39
+ "marked": "^12.0.2",
40
+ "marked-terminal": "^7.3.0",
41
+ "react": "19.2.7",
36
42
  "zod": "^4.4.3",
37
- "@arizeai/phoenix-client": "6.11.1",
43
+ "@arizeai/phoenix-client": "6.11.2",
38
44
  "@arizeai/phoenix-config": "0.1.4"
39
45
  },
40
46
  "devDependencies": {
41
47
  "@types/node": "^25.9.4",
48
+ "@types/react": "19.2.17",
49
+ "ink-testing-library": "^4.0.0",
42
50
  "rimraf": "^6.1.3",
43
51
  "tsc-alias": "^1.8.17",
44
52
  "tsx": "^4.22.4",
@@ -48,10 +56,11 @@
48
56
  "node": ">=20"
49
57
  },
50
58
  "scripts": {
51
- "build": "pnpm run build:schema && tsc && tsc-alias && chmod 755 build/index.js",
59
+ "build": "pnpm run build:schema && tsc && tsc-alias && chmod 755 build/index.js build/pxi/index.js",
52
60
  "build:schema": "tsx scripts/build-schema.ts && cd ../../.. && js/node_modules/.bin/oxfmt --config .oxfmtrc.jsonc schemas/phoenix-cli-settings.json",
53
61
  "clean": "rimraf build",
54
62
  "dev": "tsx src/index.ts",
63
+ "dev:pxi": "tsx src/pxi/index.tsx",
55
64
  "prebuild": "pnpm run clean",
56
65
  "test": "vitest run",
57
66
  "test:watch": "vitest watch",