@arizeai/phoenix-cli 1.8.0 → 1.9.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 +42 -0
- package/build/cli.d.ts.map +1 -1
- package/build/cli.js +2 -1
- package/build/cli.js.map +1 -1
- package/build/client.d.ts +5 -1
- package/build/client.d.ts.map +1 -1
- package/build/client.js +2 -1
- package/build/client.js.map +1 -1
- package/build/commands/annotationConfig.d.ts.map +1 -1
- package/build/commands/annotationConfig.js.map +1 -1
- package/build/commands/{annotationMutationUtils.d.ts → annotationMutations.d.ts} +1 -1
- package/build/commands/annotationMutations.d.ts.map +1 -0
- package/build/commands/{annotationMutationUtils.js → annotationMutations.js} +1 -1
- package/build/commands/annotationMutations.js.map +1 -0
- package/build/commands/api.d.ts.map +1 -1
- package/build/commands/api.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 +6 -12
- package/build/commands/auth.js.map +1 -1
- package/build/commands/dataset.d.ts.map +1 -1
- package/build/commands/dataset.js.map +1 -1
- package/build/commands/docs.d.ts +51 -0
- package/build/commands/docs.d.ts.map +1 -1
- package/build/commands/docs.js +86 -37
- package/build/commands/docs.js.map +1 -1
- package/build/commands/experiment.d.ts.map +1 -1
- package/build/commands/experiment.js.map +1 -1
- package/build/commands/fetchSpanAnnotations.d.ts +14 -0
- package/build/commands/fetchSpanAnnotations.d.ts.map +1 -0
- package/build/commands/fetchSpanAnnotations.js +57 -0
- package/build/commands/fetchSpanAnnotations.js.map +1 -0
- package/build/commands/fetchTraceAnnotations.d.ts +14 -0
- package/build/commands/fetchTraceAnnotations.d.ts.map +1 -0
- package/build/commands/fetchTraceAnnotations.js +57 -0
- package/build/commands/fetchTraceAnnotations.js.map +1 -0
- package/build/commands/formatAnnotationMutation.d.ts +1 -1
- package/build/commands/formatAnnotationMutation.d.ts.map +1 -1
- package/build/commands/formatNoteMutation.d.ts +1 -1
- package/build/commands/formatNoteMutation.d.ts.map +1 -1
- package/build/commands/formatSetup.d.ts +50 -0
- package/build/commands/formatSetup.d.ts.map +1 -0
- package/build/commands/formatSetup.js +64 -0
- package/build/commands/formatSetup.js.map +1 -0
- package/build/commands/index.d.ts +4 -3
- package/build/commands/index.d.ts.map +1 -1
- package/build/commands/index.js +4 -3
- package/build/commands/index.js.map +1 -1
- package/build/commands/{noteMutationUtils.d.ts → noteMutations.d.ts} +1 -1
- package/build/commands/noteMutations.d.ts.map +1 -0
- package/build/commands/{noteMutationUtils.js → noteMutations.js} +1 -1
- package/build/commands/noteMutations.js.map +1 -0
- package/build/commands/options.d.ts +248 -0
- package/build/commands/options.d.ts.map +1 -0
- package/build/commands/options.js +16 -0
- package/build/commands/options.js.map +1 -0
- package/build/commands/profile.d.ts.map +1 -1
- package/build/commands/profile.js +3 -11
- package/build/commands/profile.js.map +1 -1
- package/build/commands/project.d.ts.map +1 -1
- package/build/commands/project.js +0 -1
- package/build/commands/project.js.map +1 -1
- package/build/commands/prompt.d.ts.map +1 -1
- package/build/commands/prompt.js.map +1 -1
- package/build/commands/self.d.ts.map +1 -1
- package/build/commands/self.js.map +1 -1
- package/build/commands/session.d.ts.map +1 -1
- package/build/commands/session.js +4 -4
- package/build/commands/session.js.map +1 -1
- package/build/commands/{sessionAnnotationsCommand.d.ts → sessionAnnotations.d.ts} +1 -1
- package/build/commands/sessionAnnotations.d.ts.map +1 -0
- package/build/commands/{sessionAnnotationsCommand.js → sessionAnnotations.js} +1 -1
- package/build/commands/sessionAnnotations.js.map +1 -0
- package/build/commands/setup.d.ts +19 -0
- package/build/commands/setup.d.ts.map +1 -0
- package/build/commands/setup.js +245 -0
- package/build/commands/setup.js.map +1 -0
- package/build/commands/span.d.ts.map +1 -1
- package/build/commands/span.js +5 -5
- package/build/commands/span.js.map +1 -1
- package/build/commands/spanAnnotations.d.ts +6 -13
- package/build/commands/spanAnnotations.d.ts.map +1 -1
- package/build/commands/spanAnnotations.js +154 -47
- package/build/commands/spanAnnotations.js.map +1 -1
- package/build/commands/trace.d.ts.map +1 -1
- package/build/commands/trace.js +6 -6
- package/build/commands/trace.js.map +1 -1
- package/build/commands/traceAnnotations.d.ts +6 -13
- package/build/commands/traceAnnotations.d.ts.map +1 -1
- package/build/commands/traceAnnotations.js +157 -47
- package/build/commands/traceAnnotations.js.map +1 -1
- package/build/config.d.ts +4 -1
- package/build/config.d.ts.map +1 -1
- package/build/config.js +67 -11
- package/build/config.js.map +1 -1
- package/build/curl.d.ts +17 -0
- package/build/curl.d.ts.map +1 -1
- package/build/curl.js.map +1 -1
- package/build/exitCodes.d.ts.map +1 -1
- package/build/optionParsers.d.ts +12 -0
- package/build/optionParsers.d.ts.map +1 -1
- package/build/optionParsers.js +15 -0
- package/build/optionParsers.js.map +1 -1
- package/build/pxi/App.d.ts.map +1 -1
- package/build/pxi/App.js +4 -0
- package/build/pxi/App.js.map +1 -1
- package/build/pxi/index.js.map +1 -1
- package/build/pxi/options.d.ts +98 -0
- package/build/pxi/options.d.ts.map +1 -1
- package/build/pxi/options.js.map +1 -1
- package/build/settings.d.ts.map +1 -1
- package/build/settings.js +4 -0
- package/build/settings.js.map +1 -1
- package/build/setup/agents/registry.d.ts +78 -0
- package/build/setup/agents/registry.d.ts.map +1 -0
- package/build/setup/agents/registry.js +129 -0
- package/build/setup/agents/registry.js.map +1 -0
- package/build/setup/copy.d.ts +167 -0
- package/build/setup/copy.d.ts.map +1 -0
- package/build/setup/copy.js +290 -0
- package/build/setup/copy.js.map +1 -0
- package/build/setup/deps/buildDefaultDeps.d.ts +13 -0
- package/build/setup/deps/buildDefaultDeps.d.ts.map +1 -0
- package/build/setup/deps/buildDefaultDeps.js +29 -0
- package/build/setup/deps/buildDefaultDeps.js.map +1 -0
- package/build/setup/deps/clipboard.d.ts +12 -0
- package/build/setup/deps/clipboard.d.ts.map +1 -0
- package/build/setup/deps/clipboard.js +30 -0
- package/build/setup/deps/clipboard.js.map +1 -0
- package/build/setup/deps/clock.d.ts +10 -0
- package/build/setup/deps/clock.d.ts.map +1 -0
- package/build/setup/deps/clock.js +11 -0
- package/build/setup/deps/clock.js.map +1 -0
- package/build/setup/deps/context.d.ts +28 -0
- package/build/setup/deps/context.d.ts.map +1 -0
- package/build/setup/deps/context.js +24 -0
- package/build/setup/deps/context.js.map +1 -0
- package/build/setup/deps/docs.d.ts +41 -0
- package/build/setup/deps/docs.d.ts.map +1 -0
- package/build/setup/deps/docs.js +33 -0
- package/build/setup/deps/docs.js.map +1 -0
- package/build/setup/deps/index.d.ts +42 -0
- package/build/setup/deps/index.d.ts.map +1 -0
- package/build/setup/deps/index.js +16 -0
- package/build/setup/deps/index.js.map +1 -0
- package/build/setup/deps/phoenixClient.d.ts +22 -0
- package/build/setup/deps/phoenixClient.d.ts.map +1 -0
- package/build/setup/deps/phoenixClient.js +17 -0
- package/build/setup/deps/phoenixClient.js.map +1 -0
- package/build/setup/deps/processes.d.ts +28 -0
- package/build/setup/deps/processes.d.ts.map +1 -0
- package/build/setup/deps/processes.js +58 -0
- package/build/setup/deps/processes.js.map +1 -0
- package/build/setup/deps/prompter.d.ts +42 -0
- package/build/setup/deps/prompter.d.ts.map +1 -0
- package/build/setup/deps/prompter.js +10 -0
- package/build/setup/deps/prompter.js.map +1 -0
- package/build/setup/errors.d.ts +27 -0
- package/build/setup/errors.d.ts.map +1 -0
- package/build/setup/errors.js +36 -0
- package/build/setup/errors.js.map +1 -0
- package/build/setup/options.d.ts +113 -0
- package/build/setup/options.d.ts.map +1 -0
- package/build/setup/options.js +63 -0
- package/build/setup/options.js.map +1 -0
- package/build/setup/prompts/instrumentationPrompt.d.ts +42 -0
- package/build/setup/prompts/instrumentationPrompt.d.ts.map +1 -0
- package/build/setup/prompts/instrumentationPrompt.js +64 -0
- package/build/setup/prompts/instrumentationPrompt.js.map +1 -0
- package/build/setup/runSetup.d.ts +45 -0
- package/build/setup/runSetup.d.ts.map +1 -0
- package/build/setup/runSetup.js +212 -0
- package/build/setup/runSetup.js.map +1 -0
- package/build/setup/steps/chooseEndpoint.d.ts +36 -0
- package/build/setup/steps/chooseEndpoint.d.ts.map +1 -0
- package/build/setup/steps/chooseEndpoint.js +125 -0
- package/build/setup/steps/chooseEndpoint.js.map +1 -0
- package/build/setup/steps/confirmGitSafety.d.ts +17 -0
- package/build/setup/steps/confirmGitSafety.d.ts.map +1 -0
- package/build/setup/steps/confirmGitSafety.js +73 -0
- package/build/setup/steps/confirmGitSafety.js.map +1 -0
- package/build/setup/steps/establishConnection.d.ts +29 -0
- package/build/setup/steps/establishConnection.d.ts.map +1 -0
- package/build/setup/steps/establishConnection.js +143 -0
- package/build/setup/steps/establishConnection.js.map +1 -0
- package/build/setup/steps/installTooling.d.ts +28 -0
- package/build/setup/steps/installTooling.d.ts.map +1 -0
- package/build/setup/steps/installTooling.js +79 -0
- package/build/setup/steps/installTooling.js.map +1 -0
- package/build/setup/steps/instrumentApp.d.ts +41 -0
- package/build/setup/steps/instrumentApp.d.ts.map +1 -0
- package/build/setup/steps/instrumentApp.js +131 -0
- package/build/setup/steps/instrumentApp.js.map +1 -0
- package/build/setup/steps/offerPxProfile.d.ts +20 -0
- package/build/setup/steps/offerPxProfile.d.ts.map +1 -0
- package/build/setup/steps/offerPxProfile.js +95 -0
- package/build/setup/steps/offerPxProfile.js.map +1 -0
- package/build/setup/steps/prefetchDocs.d.ts +24 -0
- package/build/setup/steps/prefetchDocs.d.ts.map +1 -0
- package/build/setup/steps/prefetchDocs.js +49 -0
- package/build/setup/steps/prefetchDocs.js.map +1 -0
- package/build/setup/steps/verifyTraces.d.ts +44 -0
- package/build/setup/steps/verifyTraces.d.ts.map +1 -0
- package/build/setup/steps/verifyTraces.js +119 -0
- package/build/setup/steps/verifyTraces.js.map +1 -0
- package/build/setup/steps/writeEnvFile.d.ts +19 -0
- package/build/setup/steps/writeEnvFile.d.ts.map +1 -0
- package/build/setup/steps/writeEnvFile.js +50 -0
- package/build/setup/steps/writeEnvFile.js.map +1 -0
- package/build/setup/ui/clackPrompter.d.ts +11 -0
- package/build/setup/ui/clackPrompter.d.ts.map +1 -0
- package/build/setup/ui/clackPrompter.js +107 -0
- package/build/setup/ui/clackPrompter.js.map +1 -0
- package/build/setup/ui/selectBoolean.d.ts +18 -0
- package/build/setup/ui/selectBoolean.d.ts.map +1 -0
- package/build/setup/ui/selectBoolean.js +14 -0
- package/build/setup/ui/selectBoolean.js.map +1 -0
- package/build/setup/util/gitignoreCoverage.d.ts +24 -0
- package/build/setup/util/gitignoreCoverage.d.ts.map +1 -0
- package/build/setup/util/gitignoreCoverage.js +43 -0
- package/build/setup/util/gitignoreCoverage.js.map +1 -0
- package/build/setup/util/paths.d.ts +6 -0
- package/build/setup/util/paths.d.ts.map +1 -0
- package/build/setup/util/paths.js +23 -0
- package/build/setup/util/paths.js.map +1 -0
- package/build/setup/util/redact.d.ts +12 -0
- package/build/setup/util/redact.d.ts.map +1 -0
- package/build/setup/util/redact.js +31 -0
- package/build/setup/util/redact.js.map +1 -0
- package/build/validation/endpoint.d.ts +19 -0
- package/build/validation/endpoint.d.ts.map +1 -0
- package/build/validation/endpoint.js +39 -0
- package/build/validation/endpoint.js.map +1 -0
- package/build/version.js.map +1 -1
- package/package.json +15 -12
- package/build/commands/annotationMutationUtils.d.ts.map +0 -1
- package/build/commands/annotationMutationUtils.js.map +0 -1
- package/build/commands/noteMutationUtils.d.ts.map +0 -1
- package/build/commands/noteMutationUtils.js.map +0 -1
- package/build/commands/sessionAnnotationsCommand.d.ts.map +0 -1
- package/build/commands/sessionAnnotationsCommand.js.map +0 -1
- package/build/commands/spanAnnotationsCommand.d.ts +0 -7
- package/build/commands/spanAnnotationsCommand.d.ts.map +0 -1
- package/build/commands/spanAnnotationsCommand.js +0 -164
- package/build/commands/spanAnnotationsCommand.js.map +0 -1
- package/build/commands/traceAnnotationsCommand.d.ts +0 -7
- package/build/commands/traceAnnotationsCommand.d.ts.map +0 -1
- package/build/commands/traceAnnotationsCommand.js +0 -167
- package/build/commands/traceAnnotationsCommand.js.map +0 -1
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ALL user-facing strings for setup, grouped by the step that emits
|
|
3
|
+
* them. Control flow references copy; copy never references control flow.
|
|
4
|
+
* Keep prose here so wording changes never touch step logic.
|
|
5
|
+
*/
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Docs contract — the only doc URLs setup emits.
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
export const DOCS = {
|
|
10
|
+
/** Agent-facing quickstart, Python (arize-phoenix-otel). */
|
|
11
|
+
quickstartPython: "https://arize.com/docs/phoenix/get-started/get-started-tracing",
|
|
12
|
+
/** Agent-facing quickstart, TypeScript (@arizeai/phoenix-otel). */
|
|
13
|
+
quickstartTypeScript: "https://arize.com/docs/phoenix/get-started/ts-get-started-tracing",
|
|
14
|
+
/** phoenix.otel register() reference for custom setups. */
|
|
15
|
+
phoenixOtelSetup: "https://arize.com/docs/phoenix/tracing/how-to-tracing/setup-tracing/setup-using-phoenix-otel",
|
|
16
|
+
/** Per-framework/provider auto-instrumentation guides. */
|
|
17
|
+
integrationsIndex: "https://arize.com/docs/phoenix/integrations",
|
|
18
|
+
/** Linked from the verification step. */
|
|
19
|
+
troubleshooting: "https://arize.com/docs/phoenix/tracing/concepts-tracing/faqs-tracing",
|
|
20
|
+
/** Linked from the manual lane and headless output. */
|
|
21
|
+
instrumentationIndex: "https://arize.com/docs/phoenix/quickstart",
|
|
22
|
+
};
|
|
23
|
+
export const SUPPORT_LINKS = [
|
|
24
|
+
`Docs: ${DOCS.instrumentationIndex}`,
|
|
25
|
+
`Troubleshooting: ${DOCS.troubleshooting}`,
|
|
26
|
+
"Issues: https://github.com/Arize-ai/phoenix/issues",
|
|
27
|
+
"Community: https://arize-ai.slack.com",
|
|
28
|
+
].join("\n");
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Shell / lifecycle
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
export const INTRO = "Phoenix tracing setup";
|
|
33
|
+
export const INTRO_INSTRUMENT = "Phoenix setup — instrument this app and verify traces arrive.";
|
|
34
|
+
export const INTRO_SKILLS = "Install agent skills";
|
|
35
|
+
export const CANCEL_OUTRO = [
|
|
36
|
+
"Setup cancelled. Nothing else was changed.",
|
|
37
|
+
"",
|
|
38
|
+
SUPPORT_LINKS,
|
|
39
|
+
].join("\n");
|
|
40
|
+
export const OUTRO_TITLE = "You're set up.";
|
|
41
|
+
export const OUTRO_BODY = SUPPORT_LINKS;
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Confirm git safety
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
export const GIT = {
|
|
46
|
+
notARepoMessage: "This directory is not a git repository. Continue anyway?",
|
|
47
|
+
notARepoYes: "Yes, continue without git",
|
|
48
|
+
notARepoNo: "No, stop here (recommended)",
|
|
49
|
+
notARepoNoHint: "Setup may edit files via a coding agent — git is the undo button.",
|
|
50
|
+
notARepoYesHint: "You will have no easy way to review or revert changes.",
|
|
51
|
+
dirtyMessage: (fileCount) => `You have ${fileCount} uncommitted change${fileCount === 1 ? "" : "s"}. Continue anyway?`,
|
|
52
|
+
dirtyYes: "Yes, continue with a dirty tree",
|
|
53
|
+
dirtyNo: "No, stop here so I can commit first (recommended)",
|
|
54
|
+
dirtyNoHint: "A clean tree keeps agent edits separate from your own edits.",
|
|
55
|
+
dirtyYesHint: "Agent edits will be tangled with your uncommitted work.",
|
|
56
|
+
dirtyFileListTitle: "Uncommitted changes",
|
|
57
|
+
andMore: (count) => `…and ${count} more`,
|
|
58
|
+
headlessDirty: "Refusing to run headless in a dirty git tree. Commit or stash your changes and re-run.",
|
|
59
|
+
headlessNotARepo: "Refusing to run headless outside a git repository. Run `git init` (or run setup interactively) and re-run.",
|
|
60
|
+
stopped: "Stopped. Commit your work, then re-run `px setup`.",
|
|
61
|
+
};
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
// Choose endpoint
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
export const ENDPOINT = {
|
|
66
|
+
selectMessage: "Where is your Phoenix instance running?",
|
|
67
|
+
localLabel: "Local — http://localhost:6006",
|
|
68
|
+
localHint: "recommended if you just ran `phoenix serve`",
|
|
69
|
+
remoteLabel: "Remote — paste your instance URL",
|
|
70
|
+
remoteHint: "any Phoenix instance reachable by URL",
|
|
71
|
+
remoteUrlMessage: "Phoenix instance URL",
|
|
72
|
+
remoteUrlInvalid: "Enter a full http:// or https:// URL, e.g. https://phoenix.example.com",
|
|
73
|
+
probing: (endpoint) => `Checking ${endpoint}…`,
|
|
74
|
+
unexpectedBody: "unexpected response body",
|
|
75
|
+
unreachable: (endpoint) => [
|
|
76
|
+
`Could not reach a Phoenix instance at ${endpoint}.`,
|
|
77
|
+
"If it's local, is `phoenix serve` running? If it's remote, check the",
|
|
78
|
+
"URL and that you can reach it from this machine (VPN?).",
|
|
79
|
+
].join("\n"),
|
|
80
|
+
notPhoenix: (endpoint, detail) => [
|
|
81
|
+
`${endpoint} responded, but not like a Phoenix instance (${detail}).`,
|
|
82
|
+
"Double-check the URL — it should be the Phoenix root URL, without",
|
|
83
|
+
"a path like /projects.",
|
|
84
|
+
].join("\n"),
|
|
85
|
+
retryMessage: "Try a different URL?",
|
|
86
|
+
retryYes: "Yes, enter a URL again",
|
|
87
|
+
retryNo: "No, exit setup",
|
|
88
|
+
gaveUp: [
|
|
89
|
+
"Couldn't establish a connection after several attempts.",
|
|
90
|
+
`Setup docs: ${DOCS.instrumentationIndex}`,
|
|
91
|
+
].join("\n"),
|
|
92
|
+
authOn: "Authentication is enabled on this instance.",
|
|
93
|
+
authOff: "Authentication is off — no API key needed.",
|
|
94
|
+
headlessUnreachable: (endpoint) => `Could not reach Phoenix at ${endpoint}. Is it running and reachable from this machine?`,
|
|
95
|
+
headlessNeedsEndpoint: [
|
|
96
|
+
"Missing endpoint. Provide one of:",
|
|
97
|
+
" --endpoint <url>",
|
|
98
|
+
" PHOENIX_HOST=<url> (or PHOENIX_COLLECTOR_ENDPOINT=<url>)",
|
|
99
|
+
].join("\n"),
|
|
100
|
+
};
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// Connection
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
export const CONNECT = {
|
|
105
|
+
projectNameMessage: "Phoenix project name for this app's traces",
|
|
106
|
+
projectNameInvalid: "Project names can't contain '/', '?', or '#' and can't be empty.",
|
|
107
|
+
usingProject: (name) => `Using project "${name}" — Phoenix creates it when the first trace arrives.`,
|
|
108
|
+
connectFailed: (detail) => `Couldn't connect to Phoenix (${detail}).`,
|
|
109
|
+
headlessNeedsProject: [
|
|
110
|
+
"Missing project. Provide one of:",
|
|
111
|
+
" --project <name>",
|
|
112
|
+
" PHOENIX_PROJECT=<name> (or PHOENIX_PROJECT_NAME=<name>)",
|
|
113
|
+
].join("\n"),
|
|
114
|
+
headlessNeedsApiKey: [
|
|
115
|
+
"This Phoenix instance has authentication enabled. Headless setup needs an API key. Provide:",
|
|
116
|
+
" PHOENIX_API_KEY=<key>",
|
|
117
|
+
"and a project via --project or PHOENIX_PROJECT.",
|
|
118
|
+
].join("\n"),
|
|
119
|
+
headlessAuthRejected: "The API key was rejected. Check PHOENIX_API_KEY.",
|
|
120
|
+
};
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
// Auth-on credential entry
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
export const API_KEY = {
|
|
125
|
+
instructionsTitle: "Phoenix API key",
|
|
126
|
+
instructions: [
|
|
127
|
+
"Create or copy an API key in Phoenix under Settings, then paste it here.",
|
|
128
|
+
"The key is masked while you type and is only written to local credential files.",
|
|
129
|
+
].join("\n"),
|
|
130
|
+
pasteKeyMessage: "Phoenix API key",
|
|
131
|
+
pasteKeyInvalid: "API key can't be empty.",
|
|
132
|
+
pasteKeyRejected: "That API key was rejected by the instance. Try again.",
|
|
133
|
+
};
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
// Env file
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
export const ENV_FILE = {
|
|
138
|
+
wrote: (names) => `Wrote ${names.join(" and ")} into this directory (readable only by you).`,
|
|
139
|
+
gitignored: (names) => `Added ${names.join(", ")} to .gitignore.`,
|
|
140
|
+
fileHeaderEnv: (isoDate) => [
|
|
141
|
+
`# Generated by \`px setup\` on ${isoDate}.`,
|
|
142
|
+
"# Contains a Phoenix API key — do NOT commit this file.",
|
|
143
|
+
"# Safe to delete once tracing is verified and production is configured.",
|
|
144
|
+
].join("\n"),
|
|
145
|
+
};
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
// Instrumentation
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
export const INSTRUMENTATION = {
|
|
150
|
+
modeMessage: "How do you want to instrument this app?",
|
|
151
|
+
launchLabel: (agentLabel) => `Hand off to ${agentLabel}`,
|
|
152
|
+
launchHint: "launches here with the setup prompt pre-loaded",
|
|
153
|
+
unknownAgent: (agent) => `Unknown agent "${agent}".`,
|
|
154
|
+
agentNotFound: (agentLabel, binary) => `${agentLabel} isn't on your PATH (looked for \`${binary}\`). Install it, or pick another agent with --agent.`,
|
|
155
|
+
launchingBackground: (agentLabel) => `Running ${agentLabel} in the background — it will add tracing and emit a test trace.`,
|
|
156
|
+
backgroundNeedsYolo: (agentLabel) => `${agentLabel} runs without a terminal here, so it cannot ask you to approve its edits. Pass --yolo to let it proceed, or it will likely stall until verification times out.`,
|
|
157
|
+
launching: (agentLabel) => [
|
|
158
|
+
`Handing off to ${agentLabel} — it will add tracing and emit a test trace.`,
|
|
159
|
+
"When you exit the agent, setup resumes and verifies traces arrived.",
|
|
160
|
+
].join("\n"),
|
|
161
|
+
agentExitWarning: (agentLabel) => `${agentLabel} exited with an error — continuing to verification anyway.`,
|
|
162
|
+
clipboardLabel: "Copy a prompt for my own coding agent",
|
|
163
|
+
clipboardHint: "paste it into Claude Code, Codex, Cursor — any agent you run yourself",
|
|
164
|
+
manualLabel: "I'll do it manually",
|
|
165
|
+
manualHint: "follow the quickstart docs yourself",
|
|
166
|
+
promptCopied: "Instrumentation prompt copied to your clipboard. Paste it into your agent in this directory.",
|
|
167
|
+
promptCopyFailed: "Couldn't write to the clipboard — here is the prompt to copy:",
|
|
168
|
+
clipboardDoneMessage: "When your agent has finished:",
|
|
169
|
+
clipboardDoneLabel: "I've run the prompt",
|
|
170
|
+
manualDocs: (url) => `Follow the tracing quickstart: ${url}`,
|
|
171
|
+
manualDoneMessage: "When you've added instrumentation:",
|
|
172
|
+
manualDoneLabel: "I've finished instrumenting",
|
|
173
|
+
};
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
// Verification + production hand-off
|
|
176
|
+
// ---------------------------------------------------------------------------
|
|
177
|
+
export const VERIFY = {
|
|
178
|
+
title: "Verifying traces",
|
|
179
|
+
waitingBody: (tracesUrl) => [
|
|
180
|
+
"Watching Phoenix for your first trace…",
|
|
181
|
+
"",
|
|
182
|
+
"If nothing has sent a trace yet, in another terminal:",
|
|
183
|
+
" 1. Export the vars: set -a; source .env.phoenix; set +a",
|
|
184
|
+
" 2. Run your app and make one LLM call.",
|
|
185
|
+
"",
|
|
186
|
+
`Traces appear at ${tracesUrl}`,
|
|
187
|
+
].join("\n"),
|
|
188
|
+
received: (tracesUrl) => `✓ Traces are flowing. View them: ${tracesUrl}`,
|
|
189
|
+
timeoutMessage: "No traces have arrived yet. Keep watching?",
|
|
190
|
+
keepWatchingLabel: "Keep watching",
|
|
191
|
+
finishLabel: "Finish setup — I'll verify later",
|
|
192
|
+
finishHint: "everything else is already configured",
|
|
193
|
+
notVerifiedHeadless: (tracesUrl) => `No trace arrived within the wait window. The connection and hand-off files are in place; check ${tracesUrl} once your app sends one.`,
|
|
194
|
+
notVerifiedTitle: "Traces not verified yet",
|
|
195
|
+
notVerifiedBody: (tracesUrl) => [
|
|
196
|
+
`Your first trace will appear at ${tracesUrl}`,
|
|
197
|
+
`Not seeing traces? ${DOCS.troubleshooting}`,
|
|
198
|
+
].join("\n"),
|
|
199
|
+
};
|
|
200
|
+
export const PRODUCTION = {
|
|
201
|
+
title: "Production hand-off",
|
|
202
|
+
bodyAuthOn: [
|
|
203
|
+
"Set these in your production environment:",
|
|
204
|
+
"",
|
|
205
|
+
" PHOENIX_COLLECTOR_ENDPOINT — same value as in .env.phoenix",
|
|
206
|
+
" PHOENIX_API_KEY — copy from .env.phoenix into your secret store",
|
|
207
|
+
"",
|
|
208
|
+
"The project name is set in code, so no extra env var is needed for it.",
|
|
209
|
+
].join("\n"),
|
|
210
|
+
bodyAuthOff: [
|
|
211
|
+
"This instance has no auth, so your app only needs:",
|
|
212
|
+
"",
|
|
213
|
+
" PHOENIX_COLLECTOR_ENDPOINT — your Phoenix URL",
|
|
214
|
+
"",
|
|
215
|
+
"When you deploy Phoenix for real (with auth), also set PHOENIX_API_KEY.",
|
|
216
|
+
].join("\n"),
|
|
217
|
+
};
|
|
218
|
+
// ---------------------------------------------------------------------------
|
|
219
|
+
// Offer px profile
|
|
220
|
+
// ---------------------------------------------------------------------------
|
|
221
|
+
export const PX_PROFILE = {
|
|
222
|
+
optInMessage: "Also point the px CLI at this project? (lets you query traces from your terminal)",
|
|
223
|
+
optInYes: "Yes, create a px profile",
|
|
224
|
+
optInNo: "No thanks",
|
|
225
|
+
conflictMessage: (profileName, endpoint) => `px is currently using profile "${profileName}" → ${endpoint}. Switch to this project?`,
|
|
226
|
+
conflictYes: "Yes, switch px to this project",
|
|
227
|
+
conflictNo: "No, leave px as-is",
|
|
228
|
+
created: (profileName) => `px profile "${profileName}" created and activated. Try: px trace list`,
|
|
229
|
+
failed: (detail) => `Couldn't write the px profile (${detail}). You can create one later with \`px profile create\`.`,
|
|
230
|
+
// Distinct from `failed`: nothing was written, the settings file could not be
|
|
231
|
+
// *read*, and `px profile create` reads it the same strict way — so pointing
|
|
232
|
+
// there would hand back a remedy that fails identically. Name the file
|
|
233
|
+
// instead; repairing or removing it is the only way forward.
|
|
234
|
+
unreadableSettings: (settingsPath, detail) => `Couldn't read ${settingsPath} (${detail}), so px was left alone. Fix or delete that file, then run \`px profile create\`.`,
|
|
235
|
+
};
|
|
236
|
+
// ---------------------------------------------------------------------------
|
|
237
|
+
// Install tooling (CLI + skills)
|
|
238
|
+
// ---------------------------------------------------------------------------
|
|
239
|
+
/**
|
|
240
|
+
* The skills repo, named once: the command we spawn and the commands the copy
|
|
241
|
+
* below tells the user to run by hand have to point at the same place.
|
|
242
|
+
*/
|
|
243
|
+
export const SKILLS_SOURCE = "Arize-ai/phoenix";
|
|
244
|
+
/** One copy group per install offer; both share the shape `ToolingOfferCopy`. */
|
|
245
|
+
export const TOOLING = {
|
|
246
|
+
cli: {
|
|
247
|
+
message: "Install the px CLI globally? (`px` isn't on your PATH — it lets you query traces from any terminal)",
|
|
248
|
+
yes: "Yes, npm install -g @arizeai/phoenix-cli",
|
|
249
|
+
no: "No thanks",
|
|
250
|
+
installed: "px CLI installed. Try `px --help` in a new shell.",
|
|
251
|
+
failed: "CLI install failed — install later with `npm install -g @arizeai/phoenix-cli`.",
|
|
252
|
+
},
|
|
253
|
+
skills: {
|
|
254
|
+
message: "Install agent skills? (opens a skill picker — query traces, debug failures)",
|
|
255
|
+
yes: `Yes, run npx skills add ${SKILLS_SOURCE}`,
|
|
256
|
+
no: "No thanks",
|
|
257
|
+
installed: "Phoenix skills installed. Your coding agent can now query and debug traces.",
|
|
258
|
+
failed: `Skills install failed — install later with \`npx skills add ${SKILLS_SOURCE}\`.`,
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
// ---------------------------------------------------------------------------
|
|
262
|
+
// Docs prefetch
|
|
263
|
+
// ---------------------------------------------------------------------------
|
|
264
|
+
export const DOCS_PREFETCH = {
|
|
265
|
+
fetching: "Downloading the Phoenix docs so the agent reads them locally...",
|
|
266
|
+
// The unknown-workflow warning is not here: it is worded once in
|
|
267
|
+
// `commands/docs`, next to the list of workflows it has to stay true to, and
|
|
268
|
+
// reaches this step through the docs seam.
|
|
269
|
+
wrote: (pages, outputDir) => `Downloaded ${pages} doc page(s) to ${outputDir}.`,
|
|
270
|
+
failed: (reason) => `Couldn't download the docs (${reason}) — the agent will read them from the web instead.`,
|
|
271
|
+
};
|
|
272
|
+
// ---------------------------------------------------------------------------
|
|
273
|
+
// Headless output
|
|
274
|
+
// ---------------------------------------------------------------------------
|
|
275
|
+
export const HEADLESS = {
|
|
276
|
+
agentRequired: (agentIds) => [
|
|
277
|
+
"Missing required flag --agent.",
|
|
278
|
+
" Headless setup has no prompt to pick an instrumentation lane from, so it must be told which agent to run.",
|
|
279
|
+
` px setup --no-input --instrument --agent <${agentIds.join("|")}> --yolo`,
|
|
280
|
+
" To register only — endpoint, project, .env.phoenix, no source changes:",
|
|
281
|
+
" px setup --no-input",
|
|
282
|
+
].join("\n"),
|
|
283
|
+
nextSteps: (tracesUrl) => [
|
|
284
|
+
"Next steps:",
|
|
285
|
+
" 1. Export the vars: set -a; source .env.phoenix; set +a",
|
|
286
|
+
` 2. Instrument your app: ${DOCS.instrumentationIndex}`,
|
|
287
|
+
` 3. Watch for traces: ${tracesUrl}`,
|
|
288
|
+
].join("\n"),
|
|
289
|
+
};
|
|
290
|
+
//# sourceMappingURL=copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/setup/copy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8EAA8E;AAC9E,iDAAiD;AACjD,8EAA8E;AAE9E,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,4DAA4D;IAC5D,gBAAgB,EACd,gEAAgE;IAClE,mEAAmE;IACnE,oBAAoB,EAClB,mEAAmE;IACrE,2DAA2D;IAC3D,gBAAgB,EACd,8FAA8F;IAChG,0DAA0D;IAC1D,iBAAiB,EAAE,6CAA6C;IAChE,yCAAyC;IACzC,eAAe,EACb,sEAAsE;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AE,CAAC,QAA2B,EAAE,EAAE,CAC7C;QACE,gCAAgC;QAChC,6GAA6G;QAC7G,+CAA+C,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;QAC3E,0EAA0E;QAC1E,uBAAuB;KACxB,CAAC,IAAI,CAAC,IAAI,CAAC;IACd,SAAS,EAAE,CAAC,SAAiB,EAAE,EAAE,CAC/B;QACE,aAAa;QACb,6DAA6D;QAC7D,6BAA6B,IAAI,CAAC,oBAAoB,EAAE;QACxD,2BAA2B,SAAS,EAAE;KACvC,CAAC,IAAI,CAAC,IAAI,CAAC;CACN,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The composition root: the one place the capability contracts meet their
|
|
3
|
+
* real, system-backed implementations. Kept separate from the contract
|
|
4
|
+
* barrel (`index.ts`) so modules the wiring depends on — like the clack
|
|
5
|
+
* prompter — can themselves import contracts from `../deps` without forming
|
|
6
|
+
* a cycle.
|
|
7
|
+
*/
|
|
8
|
+
import type { SetupDeps } from "./index.js";
|
|
9
|
+
export declare function buildDefaultDeps({ apiUrl, }?: {
|
|
10
|
+
/** Hidden --api-url dev override — see {@link createPhoenixClientFactory}. */
|
|
11
|
+
apiUrl?: string;
|
|
12
|
+
}): SetupDeps;
|
|
13
|
+
//# sourceMappingURL=buildDefaultDeps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDefaultDeps.d.ts","sourceRoot":"","sources":["../../../src/setup/deps/buildDefaultDeps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,GACP,GAAE;IACD,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GAAG,SAAS,CAajB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The composition root: the one place the capability contracts meet their
|
|
3
|
+
* real, system-backed implementations. Kept separate from the contract
|
|
4
|
+
* barrel (`index.ts`) so modules the wiring depends on — like the clack
|
|
5
|
+
* prompter — can themselves import contracts from `../deps` without forming
|
|
6
|
+
* a cycle.
|
|
7
|
+
*/
|
|
8
|
+
import { createClackPrompter } from "../ui/clackPrompter.js";
|
|
9
|
+
import { createSystemClipboardWriter } from "./clipboard.js";
|
|
10
|
+
import { createSystemClock } from "./clock.js";
|
|
11
|
+
import { captureRunContext } from "./context.js";
|
|
12
|
+
import { fetchDocs } from "./docs.js";
|
|
13
|
+
import { createPhoenixClientFactory } from "./phoenixClient.js";
|
|
14
|
+
import { createSystemProcessRunner } from "./processes.js";
|
|
15
|
+
export function buildDefaultDeps({ apiUrl, } = {}) {
|
|
16
|
+
const processes = createSystemProcessRunner();
|
|
17
|
+
return {
|
|
18
|
+
context: captureRunContext(),
|
|
19
|
+
prompter: createClackPrompter(),
|
|
20
|
+
processes,
|
|
21
|
+
clock: createSystemClock(),
|
|
22
|
+
// The clipboard is itself composed from the process runner: pbcopy & co
|
|
23
|
+
// are subprocesses.
|
|
24
|
+
writeClipboard: createSystemClipboardWriter(processes.exec),
|
|
25
|
+
createClient: createPhoenixClientFactory({ apiUrl }),
|
|
26
|
+
fetchDocs,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=buildDefaultDeps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDefaultDeps.js","sourceRoot":"","sources":["../../../src/setup/deps/buildDefaultDeps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGxD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,MAAM,GACP,GAGG,EAAE;IACJ,MAAM,SAAS,GAAG,yBAAyB,EAAE,CAAC;IAC9C,OAAO;QACL,OAAO,EAAE,iBAAiB,EAAE;QAC5B,QAAQ,EAAE,mBAAmB,EAAE;QAC/B,SAAS;QACT,KAAK,EAAE,iBAAiB,EAAE;QAC1B,wEAAwE;QACxE,oBAAoB;QACpB,cAAc,EAAE,2BAA2B,CAAC,SAAS,CAAC,IAAI,CAAC;QAC3D,YAAY,EAAE,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;QACpD,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The clipboard capability. The system implementation is composed from the
|
|
3
|
+
* process runner — pbcopy & co are subprocesses, not a second effect channel.
|
|
4
|
+
*/
|
|
5
|
+
import type { ProcessRunner } from "./processes.js";
|
|
6
|
+
/**
|
|
7
|
+
* Write text to the system clipboard. Resolves false on failure — callers
|
|
8
|
+
* fall back to printing the text.
|
|
9
|
+
*/
|
|
10
|
+
export type ClipboardWriter = (text: string) => Promise<boolean>;
|
|
11
|
+
export declare function createSystemClipboardWriter(exec: ProcessRunner["exec"]): ClipboardWriter;
|
|
12
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../src/setup/deps/clipboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEjE,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAC1B,eAAe,CAwBjB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The clipboard capability. The system implementation is composed from the
|
|
3
|
+
* process runner — pbcopy & co are subprocesses, not a second effect channel.
|
|
4
|
+
*/
|
|
5
|
+
import * as process from "node:process";
|
|
6
|
+
export function createSystemClipboardWriter(exec) {
|
|
7
|
+
return async (text) => {
|
|
8
|
+
const platform = process.platform;
|
|
9
|
+
const candidates = platform === "darwin"
|
|
10
|
+
? [{ command: "pbcopy", args: [], stdin: text }]
|
|
11
|
+
: platform === "win32"
|
|
12
|
+
? [{ command: "clip", args: [], stdin: text }]
|
|
13
|
+
: [
|
|
14
|
+
{ command: "wl-copy", args: [], stdin: text },
|
|
15
|
+
{
|
|
16
|
+
command: "xclip",
|
|
17
|
+
args: ["-selection", "clipboard"],
|
|
18
|
+
stdin: text,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
for (const candidate of candidates) {
|
|
22
|
+
const result = await exec(candidate);
|
|
23
|
+
if (result.exitCode === 0) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../src/setup/deps/clipboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAUxC,MAAM,UAAU,2BAA2B,CACzC,IAA2B;IAE3B,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,MAAM,UAAU,GACd,QAAQ,KAAK,QAAQ;YACnB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YAChD,CAAC,CAAC,QAAQ,KAAK,OAAO;gBACpB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;gBAC9C,CAAC,CAAC;oBACE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;oBAC7C;wBACE,OAAO,EAAE,OAAO;wBAChB,IAAI,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;wBACjC,KAAK,EAAE,IAAI;qBACZ;iBACF,CAAC;QACV,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC;YACrC,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The time capability: reading the clock and waiting on it. Injectable so
|
|
3
|
+
* trace-verification polling tests run instantly against a scripted clock.
|
|
4
|
+
*/
|
|
5
|
+
export interface Clock {
|
|
6
|
+
now(): number;
|
|
7
|
+
sleep(ms: number): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createSystemClock(): Clock;
|
|
10
|
+
//# sourceMappingURL=clock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../../src/setup/deps/clock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,KAAK;IACpB,GAAG,IAAI,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED,wBAAgB,iBAAiB,IAAI,KAAK,CAKzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The time capability: reading the clock and waiting on it. Injectable so
|
|
3
|
+
* trace-verification polling tests run instantly against a scripted clock.
|
|
4
|
+
*/
|
|
5
|
+
export function createSystemClock() {
|
|
6
|
+
return {
|
|
7
|
+
now: () => Date.now(),
|
|
8
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../../../src/setup/deps/clock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QACrB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;KACjE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ambient facts of a run, captured once at startup.
|
|
3
|
+
*
|
|
4
|
+
* Plain data, not behavior: steps read these values, they never call through
|
|
5
|
+
* them. Keeping the snapshot in one place is what stops `process.env` and
|
|
6
|
+
* `process.cwd()` reads from leaking into steps.
|
|
7
|
+
*/
|
|
8
|
+
export interface RunContext {
|
|
9
|
+
cwd: string;
|
|
10
|
+
env: Record<string, string | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* How PATH is spelled in {@link env}. `process.env` resolves names
|
|
13
|
+
* case-insensitively on Windows, where the variable is conventionally
|
|
14
|
+
* "Path"; the plain copy below is an ordinary object and does not, so the
|
|
15
|
+
* spelling is resolved once here rather than by each reader. Read PATH as
|
|
16
|
+
* `env[pathKey]`, and when overriding it for a child process use this key —
|
|
17
|
+
* spawning with "PATH" while the inherited environment carries "Path" hands
|
|
18
|
+
* the child two of them.
|
|
19
|
+
*/
|
|
20
|
+
pathKey: string;
|
|
21
|
+
stdinIsTTY: boolean;
|
|
22
|
+
/** Override the px settings file location (tests only). */
|
|
23
|
+
settingsPath?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The key PATH is spelled under, or "PATH" when the env carries none. */
|
|
26
|
+
export declare function resolvePathKey(env: Record<string, string | undefined>): string;
|
|
27
|
+
export declare function captureRunContext(): RunContext;
|
|
28
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/setup/deps/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACtC,MAAM,CAER;AAED,wBAAgB,iBAAiB,IAAI,UAAU,CAU9C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ambient facts of a run, captured once at startup.
|
|
3
|
+
*
|
|
4
|
+
* Plain data, not behavior: steps read these values, they never call through
|
|
5
|
+
* them. Keeping the snapshot in one place is what stops `process.env` and
|
|
6
|
+
* `process.cwd()` reads from leaking into steps.
|
|
7
|
+
*/
|
|
8
|
+
import * as process from "node:process";
|
|
9
|
+
/** The key PATH is spelled under, or "PATH" when the env carries none. */
|
|
10
|
+
export function resolvePathKey(env) {
|
|
11
|
+
return Object.keys(env).find((key) => key.toUpperCase() === "PATH") ?? "PATH";
|
|
12
|
+
}
|
|
13
|
+
export function captureRunContext() {
|
|
14
|
+
// Copied, not aliased — a mid-run mutation of process.env (a spawned
|
|
15
|
+
// tool, a late dotenv load) must not change what this run resolved.
|
|
16
|
+
const env = { ...process.env };
|
|
17
|
+
return {
|
|
18
|
+
cwd: process.cwd(),
|
|
19
|
+
env,
|
|
20
|
+
pathKey: resolvePathKey(env),
|
|
21
|
+
stdinIsTTY: Boolean(process.stdin.isTTY),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/setup/deps/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAoBxC,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAC5B,GAAuC;IAEvC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,qEAAqE;IACrE,oEAAoE;IACpE,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC/B,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,GAAG;QACH,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC;QAC5B,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The docs-prefetch capability: the network+fs seam for the docs step.
|
|
3
|
+
*/
|
|
4
|
+
export { unknownWorkflowWarning } from "../../commands/docs.js";
|
|
5
|
+
export interface DocsPrefetchOptions {
|
|
6
|
+
/** --no-docs turns the prefetch off; it is on by default. */
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
/** --workflow: repeatable workflow filter; defaults to the docs defaults. */
|
|
9
|
+
workflows?: string[];
|
|
10
|
+
/** --refresh-docs: clear the output directory before downloading. */
|
|
11
|
+
refresh?: boolean;
|
|
12
|
+
/** --workers: concurrent downloads. */
|
|
13
|
+
workers?: number;
|
|
14
|
+
}
|
|
15
|
+
/** What the docs prefetch actually wrote — reported in the setup summary. */
|
|
16
|
+
export interface DocsPrefetchResult {
|
|
17
|
+
outputDir: string;
|
|
18
|
+
workflows: string[];
|
|
19
|
+
written: number;
|
|
20
|
+
/** Pages the docs site did not serve; the agent falls back to the web for these. */
|
|
21
|
+
failed: number;
|
|
22
|
+
/** Paths the step appended to a .gitignore, folded into the setup report. */
|
|
23
|
+
gitignoreAppended?: string[];
|
|
24
|
+
/** `--workflow` names that aren't recognized — surfaced as a warning. */
|
|
25
|
+
unknownWorkflows?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Whether the docs directory holds pages the agent can read — which is not
|
|
28
|
+
* the same as `written > 0`. A re-run whose downloads all fail still leaves
|
|
29
|
+
* the previous run's tree in place, and the agent should be pointed at that
|
|
30
|
+
* rather than back at a docs site that has just failed us.
|
|
31
|
+
*/
|
|
32
|
+
hasPagesOnDisk: boolean;
|
|
33
|
+
}
|
|
34
|
+
export type DocsFetcher = (options: DocsPrefetchOptions) => Promise<DocsPrefetchResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Download the docs the same way `px docs fetch` does, into the same
|
|
37
|
+
* `.px/docs` directory, so a user who later runs the command by hand refreshes
|
|
38
|
+
* the tree setup already laid down.
|
|
39
|
+
*/
|
|
40
|
+
export declare function fetchDocs(options: DocsPrefetchOptions): Promise<DocsPrefetchResult>;
|
|
41
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/setup/deps/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,WAAW,GAAG,CACxB,OAAO,EAAE,mBAAmB,KACzB,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC;;;;GAIG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAiB7B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The docs-prefetch capability: the network+fs seam for the docs step.
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
5
|
+
import { DEFAULT_OUTPUT_DIR, DEFAULT_WORKERS, downloadDocs, fetchDocsIndex, filterByWorkflows, resolveWorkflows, } from "../../commands/docs.js";
|
|
6
|
+
// This module is setup's only door onto the docs command, so the warning the
|
|
7
|
+
// prefetch step prints for a bad `--workflow` comes through here rather than
|
|
8
|
+
// the step reaching into `commands/` for it.
|
|
9
|
+
export { unknownWorkflowWarning } from "../../commands/docs.js";
|
|
10
|
+
/**
|
|
11
|
+
* Download the docs the same way `px docs fetch` does, into the same
|
|
12
|
+
* `.px/docs` directory, so a user who later runs the command by hand refreshes
|
|
13
|
+
* the tree setup already laid down.
|
|
14
|
+
*/
|
|
15
|
+
export async function fetchDocs(options) {
|
|
16
|
+
const { workflows, unknown } = resolveWorkflows(options.workflows);
|
|
17
|
+
const entries = filterByWorkflows(await fetchDocsIndex(), workflows);
|
|
18
|
+
const outputDir = DEFAULT_OUTPUT_DIR;
|
|
19
|
+
const { succeeded, failed } = await downloadDocs(entries, {
|
|
20
|
+
outputDir,
|
|
21
|
+
workers: options.workers ?? DEFAULT_WORKERS,
|
|
22
|
+
refresh: options.refresh,
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
outputDir,
|
|
26
|
+
workflows,
|
|
27
|
+
written: succeeded.length,
|
|
28
|
+
failed: failed.length,
|
|
29
|
+
unknownWorkflows: unknown,
|
|
30
|
+
hasPagesOnDisk: existsSync(outputDir) && readdirSync(outputDir).length > 0,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../../src/setup/deps/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,6EAA6E;AAC7E,6EAA6E;AAC7E,6CAA6C;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAqC7D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,OAA4B;IAE5B,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnE,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAM,cAAc,EAAE,EAAE,SAAS,CAAC,CAAC;IACrE,MAAM,SAAS,GAAG,kBAAkB,CAAC;IACrC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE;QACxD,SAAS;QACT,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,eAAe;QAC3C,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC,CAAC;IACH,OAAO;QACL,SAAS;QACT,SAAS;QACT,OAAO,EAAE,SAAS,CAAC,MAAM;QACzB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,gBAAgB,EAAE,OAAO;QACzB,cAAc,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;KAC3E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency seam for setup.
|
|
3
|
+
*
|
|
4
|
+
* Every side effect setup performs — env access, network, subprocesses,
|
|
5
|
+
* clipboard, time — goes through `SetupDeps`. No other module under `setup/`
|
|
6
|
+
* may touch `process.env`, `fetch`, `child_process`, or the clipboard
|
|
7
|
+
* directly. This is what makes setup unit-testable with fakes.
|
|
8
|
+
*
|
|
9
|
+
* Each capability's contract (and, where it is a few lines of system glue,
|
|
10
|
+
* its real implementation) lives in its own module in this directory. This
|
|
11
|
+
* barrel re-exports the contracts so consumers address the seam as one
|
|
12
|
+
* module; it exports types only, so importing it can never form a runtime
|
|
13
|
+
* cycle. The wiring lives in `buildDefaultDeps.ts`.
|
|
14
|
+
*/
|
|
15
|
+
import type { ClipboardWriter } from "./clipboard.js";
|
|
16
|
+
import type { Clock } from "./clock.js";
|
|
17
|
+
import type { RunContext } from "./context.js";
|
|
18
|
+
import type { DocsFetcher } from "./docs.js";
|
|
19
|
+
import type { PhoenixClientFactory } from "./phoenixClient.js";
|
|
20
|
+
import type { ProcessRunner } from "./processes.js";
|
|
21
|
+
import type { Prompter } from "./prompter.js";
|
|
22
|
+
export interface SetupDeps {
|
|
23
|
+
/** Ambient facts of the run — data steps read, never call. */
|
|
24
|
+
context: RunContext;
|
|
25
|
+
/** Real: clack-backed ui/clackPrompter.ts; tests: scripted answers. */
|
|
26
|
+
prompter: Prompter;
|
|
27
|
+
processes: ProcessRunner;
|
|
28
|
+
clock: Clock;
|
|
29
|
+
writeClipboard: ClipboardWriter;
|
|
30
|
+
/** Typed Phoenix client; tests inject a fake transport beneath it. */
|
|
31
|
+
createClient: PhoenixClientFactory;
|
|
32
|
+
fetchDocs: DocsFetcher;
|
|
33
|
+
}
|
|
34
|
+
export type { ClipboardWriter } from "./clipboard.js";
|
|
35
|
+
export type { Clock } from "./clock.js";
|
|
36
|
+
export type { RunContext } from "./context.js";
|
|
37
|
+
export { unknownWorkflowWarning } from "./docs.js";
|
|
38
|
+
export type { DocsFetcher, DocsPrefetchOptions, DocsPrefetchResult, } from "./docs.js";
|
|
39
|
+
export type { PhoenixClientArgs, PhoenixClientFactory } from "./phoenixClient.js";
|
|
40
|
+
export type { CommandSpec, ExecResult, ProcessRunner } from "./processes.js";
|
|
41
|
+
export type { Prompter, SelectOption } from "./prompter.js";
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|