@arizeai/phoenix-cli 1.3.0 → 1.4.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 +98 -13
- package/build/banner.d.ts.map +1 -1
- package/build/banner.js +11 -2
- package/build/banner.js.map +1 -1
- package/build/cli.d.ts.map +1 -1
- package/build/cli.js +2 -1
- package/build/cli.js.map +1 -1
- package/build/commands/annotationMutationUtils.d.ts +1 -1
- package/build/commands/annotationMutationUtils.d.ts.map +1 -1
- package/build/commands/annotationMutationUtils.js +13 -1
- package/build/commands/annotationMutationUtils.js.map +1 -1
- package/build/commands/auth.d.ts +1 -1
- package/build/commands/auth.d.ts.map +1 -1
- package/build/commands/auth.js +31 -9
- package/build/commands/auth.js.map +1 -1
- package/build/commands/chunkArray.d.ts +5 -0
- package/build/commands/chunkArray.d.ts.map +1 -0
- package/build/commands/chunkArray.js +8 -0
- package/build/commands/chunkArray.js.map +1 -0
- package/build/commands/formatProfiles.d.ts +40 -0
- package/build/commands/formatProfiles.d.ts.map +1 -0
- package/build/commands/formatProfiles.js +53 -0
- package/build/commands/formatProfiles.js.map +1 -0
- package/build/commands/formatSessions.d.ts +17 -5
- package/build/commands/formatSessions.d.ts.map +1 -1
- package/build/commands/formatSessions.js +52 -10
- package/build/commands/formatSessions.js.map +1 -1
- package/build/commands/formatSpans.d.ts +3 -1
- package/build/commands/formatSpans.d.ts.map +1 -1
- package/build/commands/formatSpans.js +8 -7
- package/build/commands/formatSpans.js.map +1 -1
- package/build/commands/index.d.ts +1 -0
- package/build/commands/index.d.ts.map +1 -1
- package/build/commands/index.js +1 -0
- package/build/commands/index.js.map +1 -1
- package/build/commands/noteMutationUtils.d.ts +1 -1
- package/build/commands/noteMutationUtils.d.ts.map +1 -1
- package/build/commands/noteMutationUtils.js +13 -1
- package/build/commands/noteMutationUtils.js.map +1 -1
- package/build/commands/profile.d.ts +14 -0
- package/build/commands/profile.d.ts.map +1 -0
- package/build/commands/profile.js +357 -0
- package/build/commands/profile.js.map +1 -0
- package/build/commands/session.d.ts +2 -0
- package/build/commands/session.d.ts.map +1 -1
- package/build/commands/session.js +304 -9
- package/build/commands/session.js.map +1 -1
- package/build/commands/span.d.ts.map +1 -1
- package/build/commands/span.js +6 -1
- package/build/commands/span.js.map +1 -1
- package/build/commands/spanAnnotations.d.ts.map +1 -1
- package/build/commands/spanAnnotations.js +7 -10
- package/build/commands/spanAnnotations.js.map +1 -1
- package/build/commands/traceAnnotations.d.ts.map +1 -1
- package/build/commands/traceAnnotations.js +7 -10
- package/build/commands/traceAnnotations.js.map +1 -1
- package/build/config.d.ts +39 -4
- package/build/config.d.ts.map +1 -1
- package/build/config.js +73 -5
- package/build/config.js.map +1 -1
- package/build/exitCodes.d.ts +5 -3
- package/build/exitCodes.d.ts.map +1 -1
- package/build/exitCodes.js +5 -3
- package/build/exitCodes.js.map +1 -1
- package/build/settings.d.ts +144 -0
- package/build/settings.d.ts.map +1 -0
- package/build/settings.js +299 -0
- package/build/settings.js.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings storage schema definitions and runtime I/O for the Phoenix CLI.
|
|
3
|
+
*
|
|
4
|
+
* The Zod schemas in this file are the canonical source for
|
|
5
|
+
* `schemas/phoenix-cli-settings.json` (emitted by `scripts/build-schema.ts`).
|
|
6
|
+
* Runtime I/O (path resolution, file read/write, profile lookup) also lives
|
|
7
|
+
* here so the module name matches the on-disk file (`settings.json`).
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from "fs";
|
|
10
|
+
import * as os from "os";
|
|
11
|
+
import * as path from "path";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { InvalidArgumentError } from "./exitCodes.js";
|
|
14
|
+
export const ProfileEntrySchema = z.object({
|
|
15
|
+
endpoint: z
|
|
16
|
+
.string()
|
|
17
|
+
.url("endpoint must be an absolute URL (e.g. https://app.phoenix.arize.com or http://localhost:6006)")
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Phoenix server URL this profile targets (e.g. https://app.phoenix.arize.com or http://localhost:6006)."),
|
|
20
|
+
apiKey: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("API key sent as `Authorization: Bearer <apiKey>` with every request. Accepts both user and system API keys for self-hosted Phoenix and Phoenix Cloud. Treat as a secret — the profiles file should be user-readable only (mode 0600)."),
|
|
24
|
+
project: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Default Phoenix project name used when commands don't pass --project."),
|
|
28
|
+
headers: z
|
|
29
|
+
.record(z.string(), z.string())
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Extra HTTP headers sent with every request from this profile. Useful for custom auth or routing. Values override defaults."),
|
|
32
|
+
});
|
|
33
|
+
export const SettingsFileSchema = z.object({
|
|
34
|
+
$schema: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Optional JSON Schema URL for editor autocomplete. Pin to a GitHub raw URL at a released tag; see README."),
|
|
38
|
+
activeProfile: z
|
|
39
|
+
.union([z.string(), z.null()])
|
|
40
|
+
.describe("Name of the profile to use when no --profile flag is passed. Must match a key in `profiles`."),
|
|
41
|
+
profiles: z
|
|
42
|
+
.record(z.string(), ProfileEntrySchema)
|
|
43
|
+
.describe("Map of profile name to profile entry. Keys are the profile names referenced by `activeProfile` and the --profile flag."),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Typed error thrown by `loadSettings({ strict: true })` when the settings
|
|
47
|
+
* file is malformed or schema-invalid.
|
|
48
|
+
*/
|
|
49
|
+
export class SettingsFileError extends Error {
|
|
50
|
+
constructor(message) {
|
|
51
|
+
super(message);
|
|
52
|
+
this.name = "SettingsFileError";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Typed error thrown when an explicitly requested profile (via `--profile`)
|
|
57
|
+
* does not resolve to an existing entry. Extends `InvalidArgumentError` so
|
|
58
|
+
* `getExitCodeForError` maps it to `ExitCode.INVALID_ARGUMENT` automatically.
|
|
59
|
+
*/
|
|
60
|
+
export class ProfileResolutionError extends InvalidArgumentError {
|
|
61
|
+
constructor(message) {
|
|
62
|
+
super(message);
|
|
63
|
+
this.name = "ProfileResolutionError";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Default `$schema` URL written into newly-created settings files so editors
|
|
68
|
+
* (VS Code, JetBrains, etc.) can validate and autocomplete out of the box.
|
|
69
|
+
*
|
|
70
|
+
* Pinned to `main` for now while the schema is still moving. We'll move it
|
|
71
|
+
* to a SchemaStore entry once registered, and at that point this constant
|
|
72
|
+
* becomes the fallback rather than the canonical pointer.
|
|
73
|
+
*/
|
|
74
|
+
export const DEFAULT_SCHEMA_URL = "https://raw.githubusercontent.com/Arize-ai/phoenix/main/schemas/phoenix-cli-settings.json";
|
|
75
|
+
/**
|
|
76
|
+
* Empty settings state. Used as the forgiving-mode fallback when the file
|
|
77
|
+
* exists but is unreadable or unparseable — see {@link getInitialSettingsFile}
|
|
78
|
+
* for the freshly-created variant that includes `$schema`.
|
|
79
|
+
*/
|
|
80
|
+
export const DEFAULT_SETTINGS_FILE = {
|
|
81
|
+
activeProfile: null,
|
|
82
|
+
profiles: {},
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Settings state used when no file exists yet. Differs from
|
|
86
|
+
* {@link DEFAULT_SETTINGS_FILE} only in that it carries a `$schema` pointer,
|
|
87
|
+
* so the very first `saveSettings` call writes a file editors can validate
|
|
88
|
+
* without users having to add the line themselves. Any subsequent load
|
|
89
|
+
* preserves whatever's already on disk — if a user removes `$schema`, we
|
|
90
|
+
* don't put it back.
|
|
91
|
+
*/
|
|
92
|
+
export function getInitialSettingsFile() {
|
|
93
|
+
return {
|
|
94
|
+
$schema: DEFAULT_SCHEMA_URL,
|
|
95
|
+
activeProfile: null,
|
|
96
|
+
profiles: {},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Format a Zod error path segment for human-readable messages.
|
|
101
|
+
*/
|
|
102
|
+
function formatZodPath(pathSegments) {
|
|
103
|
+
return pathSegments
|
|
104
|
+
.map((segment, i) => {
|
|
105
|
+
if (typeof segment === "number") {
|
|
106
|
+
return `[${segment}]`;
|
|
107
|
+
}
|
|
108
|
+
return i === 0 ? segment : `.${segment}`;
|
|
109
|
+
})
|
|
110
|
+
.join("");
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Parse and validate a raw JSON string as a SettingsFile.
|
|
114
|
+
*
|
|
115
|
+
* Returns `{ ok: false, reason }` rather than throwing on any parse failure
|
|
116
|
+
* so callers can decide whether to warn+continue or throw a typed error.
|
|
117
|
+
*/
|
|
118
|
+
function parseSettingsFile(rawJson) {
|
|
119
|
+
let parsed;
|
|
120
|
+
try {
|
|
121
|
+
parsed = JSON.parse(rawJson);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return { ok: false, reason: "Invalid JSON in settings file" };
|
|
125
|
+
}
|
|
126
|
+
const result = SettingsFileSchema.safeParse(parsed);
|
|
127
|
+
if (result.success) {
|
|
128
|
+
return { ok: true, data: result.data };
|
|
129
|
+
}
|
|
130
|
+
const issue = result.error.issues[0];
|
|
131
|
+
const issuePath = issue.path;
|
|
132
|
+
if (issuePath.length === 0) {
|
|
133
|
+
return { ok: false, reason: "Settings file root must be an object" };
|
|
134
|
+
}
|
|
135
|
+
if (issuePath.length === 2 && issuePath[0] === "profiles") {
|
|
136
|
+
const name = issuePath[1];
|
|
137
|
+
return { ok: false, reason: `Profile "${name}" must be an object` };
|
|
138
|
+
}
|
|
139
|
+
if (issuePath.length === 3 && issuePath[0] === "profiles") {
|
|
140
|
+
const name = issuePath[1];
|
|
141
|
+
const field = issuePath[2];
|
|
142
|
+
if (field === "headers") {
|
|
143
|
+
return {
|
|
144
|
+
ok: false,
|
|
145
|
+
reason: `Profile "${name}".headers must be an object`,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// For string-typed fields the underlying issue is either a type
|
|
149
|
+
// mismatch ("must be a string") or a refinement failure (e.g. URL
|
|
150
|
+
// validation on `endpoint`). Surface Zod's own message for refinement
|
|
151
|
+
// failures so users see what actually went wrong.
|
|
152
|
+
if (issue.code === "invalid_type") {
|
|
153
|
+
return {
|
|
154
|
+
ok: false,
|
|
155
|
+
reason: `Profile "${name}".${field} must be a string`,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
ok: false,
|
|
160
|
+
reason: `Profile "${name}".${field}: ${issue.message}`,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (issuePath.length === 4 &&
|
|
164
|
+
issuePath[0] === "profiles" &&
|
|
165
|
+
issuePath[2] === "headers") {
|
|
166
|
+
const name = issuePath[1];
|
|
167
|
+
const key = issuePath[3];
|
|
168
|
+
return {
|
|
169
|
+
ok: false,
|
|
170
|
+
reason: `Profile "${name}".headers["${key}"] must be a string`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
if (issuePath[0] === "activeProfile") {
|
|
174
|
+
return {
|
|
175
|
+
ok: false,
|
|
176
|
+
reason: "Settings file 'activeProfile' must be a string or null",
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (issuePath[0] === "profiles") {
|
|
180
|
+
return { ok: false, reason: "Settings file 'profiles' must be an object" };
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
ok: false,
|
|
184
|
+
reason: `Invalid settings file at ${formatZodPath(issuePath)}: ${issue.message}`,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Return true if the profile name contains only alphanumeric characters,
|
|
189
|
+
* hyphens, or underscores. Empty strings and names with whitespace or other
|
|
190
|
+
* special characters are rejected.
|
|
191
|
+
*/
|
|
192
|
+
export function validateProfileName(name) {
|
|
193
|
+
if (!name || name.trim() !== name) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
return /^[a-zA-Z0-9_-]+$/.test(name);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Look up a profile entry by name. Returns `undefined` (rather than
|
|
200
|
+
* throwing) when the name does not exist in the profiles record so
|
|
201
|
+
* callers can decide whether a miss is fatal (e.g. an explicit
|
|
202
|
+
* `--profile` flag) or expected (e.g. a stale `activeProfile` pointer).
|
|
203
|
+
*
|
|
204
|
+
* Returns both the name and entry together so callers never need to
|
|
205
|
+
* re-resolve the name separately.
|
|
206
|
+
*/
|
|
207
|
+
export function getProfileByName(file, name) {
|
|
208
|
+
const entry = file.profiles[name];
|
|
209
|
+
return entry !== undefined ? { name, entry } : undefined;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Look up the profile pointed at by `file.activeProfile`. Returns
|
|
213
|
+
* `undefined` when no active profile is set, or when the pointer is
|
|
214
|
+
* stale (the named profile no longer exists). Stale-pointer handling
|
|
215
|
+
* is forgiving by design — callers fall through to env vars / defaults
|
|
216
|
+
* rather than failing.
|
|
217
|
+
*/
|
|
218
|
+
export function getStoredActiveProfile(file) {
|
|
219
|
+
if (file.activeProfile === null) {
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
return getProfileByName(file, file.activeProfile);
|
|
223
|
+
}
|
|
224
|
+
// ---------------------------------------------------------------------------
|
|
225
|
+
// File I/O
|
|
226
|
+
// ---------------------------------------------------------------------------
|
|
227
|
+
/**
|
|
228
|
+
* Return the Phoenix config directory. Respects `XDG_CONFIG_HOME` if set
|
|
229
|
+
* (returns `$XDG_CONFIG_HOME/px`), otherwise falls back to `~/.px`.
|
|
230
|
+
*/
|
|
231
|
+
export function getConfigDir() {
|
|
232
|
+
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
|
|
233
|
+
if (xdgConfigHome) {
|
|
234
|
+
return path.join(xdgConfigHome, "px");
|
|
235
|
+
}
|
|
236
|
+
return path.join(os.homedir(), ".px");
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Return the absolute path to the settings config file.
|
|
240
|
+
*/
|
|
241
|
+
export function getSettingsPath() {
|
|
242
|
+
return path.join(getConfigDir(), "settings.json");
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Load the settings file from disk.
|
|
246
|
+
*
|
|
247
|
+
* - Missing file: returns `getInitialSettingsFile()` — a fresh state that
|
|
248
|
+
* carries `$schema`, so the very first save writes a file editors can
|
|
249
|
+
* validate.
|
|
250
|
+
* - Malformed JSON / schema-invalid, forgiving mode (default): returns
|
|
251
|
+
* `DEFAULT_SETTINGS_FILE` (no `$schema` — we don't want to clobber a user's
|
|
252
|
+
* intentional removal during a forgiving fallback) and writes a warning to
|
|
253
|
+
* stderr.
|
|
254
|
+
* - Malformed JSON / schema-invalid, strict mode: throws `SettingsFileError`.
|
|
255
|
+
*/
|
|
256
|
+
export function loadSettings(options) {
|
|
257
|
+
const strict = options?.strict ?? false;
|
|
258
|
+
const filePath = options?.settingsPath ?? getSettingsPath();
|
|
259
|
+
let rawJson;
|
|
260
|
+
try {
|
|
261
|
+
rawJson = fs.readFileSync(filePath, "utf-8");
|
|
262
|
+
}
|
|
263
|
+
catch (err) {
|
|
264
|
+
if (typeof err === "object" &&
|
|
265
|
+
err !== null &&
|
|
266
|
+
err.code === "ENOENT") {
|
|
267
|
+
return getInitialSettingsFile();
|
|
268
|
+
}
|
|
269
|
+
if (strict) {
|
|
270
|
+
throw err;
|
|
271
|
+
}
|
|
272
|
+
process.stderr.write(`Warning: Could not read settings file (${filePath}): ${String(err)}\n`);
|
|
273
|
+
return { ...DEFAULT_SETTINGS_FILE, profiles: {} };
|
|
274
|
+
}
|
|
275
|
+
const result = parseSettingsFile(rawJson);
|
|
276
|
+
if (result.ok) {
|
|
277
|
+
return result.data;
|
|
278
|
+
}
|
|
279
|
+
if (strict) {
|
|
280
|
+
throw new SettingsFileError(result.reason);
|
|
281
|
+
}
|
|
282
|
+
process.stderr.write(`Warning: ${result.reason}\n`);
|
|
283
|
+
return { ...DEFAULT_SETTINGS_FILE, profiles: {} };
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Persist the settings file to disk.
|
|
287
|
+
*
|
|
288
|
+
* Creates the parent directory (and any ancestors) if it does not exist.
|
|
289
|
+
* Writes human-readable JSON with 2-space indentation.
|
|
290
|
+
*/
|
|
291
|
+
export function saveSettings(data, options) {
|
|
292
|
+
const filePath = options?.settingsPath ?? getSettingsPath();
|
|
293
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true, mode: 0o700 });
|
|
294
|
+
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", {
|
|
295
|
+
encoding: "utf-8",
|
|
296
|
+
mode: 0o600,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CACF,gGAAgG,CACjG;SACA,QAAQ,EAAE;SACV,QAAQ,CACP,wGAAwG,CACzG;IACH,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,uOAAuO,CACxO;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,uEA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EAAE,CAAC;QACd,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACpD,OAAO,EAAE,GAAG,qBAAqB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AACpD,CAAC;AAOD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAkB,EAClB,OAA6B;IAE7B,MAAM,QAAQ,GAAG,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,CAAC;IAC5D,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE;QAC/D,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arizeai/phoenix-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A command-line interface for Phoenix",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arize",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"@arizeai/openinference-semantic-conventions": "^1.1.0",
|
|
34
34
|
"@clack/prompts": "^1.0.1",
|
|
35
35
|
"commander": "^12.1.0",
|
|
36
|
-
"
|
|
36
|
+
"zod": "^4.0.14",
|
|
37
|
+
"@arizeai/phoenix-client": "6.9.0",
|
|
37
38
|
"@arizeai/phoenix-config": "0.1.3"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
@@ -47,7 +48,8 @@
|
|
|
47
48
|
"node": ">=20"
|
|
48
49
|
},
|
|
49
50
|
"scripts": {
|
|
50
|
-
"build": "tsc && tsc-alias && chmod 755 build/index.js",
|
|
51
|
+
"build": "pnpm run build:schema && tsc && tsc-alias && chmod 755 build/index.js",
|
|
52
|
+
"build:schema": "tsx scripts/build-schema.ts && cd ../../.. && js/node_modules/.bin/oxfmt --config .oxfmtrc.jsonc schemas/phoenix-cli-settings.json",
|
|
51
53
|
"clean": "rimraf build",
|
|
52
54
|
"dev": "tsx src/index.ts",
|
|
53
55
|
"prebuild": "pnpm run clean",
|