@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.
Files changed (249) hide show
  1. package/README.md +42 -0
  2. package/build/cli.d.ts.map +1 -1
  3. package/build/cli.js +2 -1
  4. package/build/cli.js.map +1 -1
  5. package/build/client.d.ts +5 -1
  6. package/build/client.d.ts.map +1 -1
  7. package/build/client.js +2 -1
  8. package/build/client.js.map +1 -1
  9. package/build/commands/annotationConfig.d.ts.map +1 -1
  10. package/build/commands/annotationConfig.js.map +1 -1
  11. package/build/commands/{annotationMutationUtils.d.ts → annotationMutations.d.ts} +1 -1
  12. package/build/commands/annotationMutations.d.ts.map +1 -0
  13. package/build/commands/{annotationMutationUtils.js → annotationMutations.js} +1 -1
  14. package/build/commands/annotationMutations.js.map +1 -0
  15. package/build/commands/api.d.ts.map +1 -1
  16. package/build/commands/api.js.map +1 -1
  17. package/build/commands/auth.d.ts +1 -1
  18. package/build/commands/auth.d.ts.map +1 -1
  19. package/build/commands/auth.js +6 -12
  20. package/build/commands/auth.js.map +1 -1
  21. package/build/commands/dataset.d.ts.map +1 -1
  22. package/build/commands/dataset.js.map +1 -1
  23. package/build/commands/docs.d.ts +51 -0
  24. package/build/commands/docs.d.ts.map +1 -1
  25. package/build/commands/docs.js +86 -37
  26. package/build/commands/docs.js.map +1 -1
  27. package/build/commands/experiment.d.ts.map +1 -1
  28. package/build/commands/experiment.js.map +1 -1
  29. package/build/commands/fetchSpanAnnotations.d.ts +14 -0
  30. package/build/commands/fetchSpanAnnotations.d.ts.map +1 -0
  31. package/build/commands/fetchSpanAnnotations.js +57 -0
  32. package/build/commands/fetchSpanAnnotations.js.map +1 -0
  33. package/build/commands/fetchTraceAnnotations.d.ts +14 -0
  34. package/build/commands/fetchTraceAnnotations.d.ts.map +1 -0
  35. package/build/commands/fetchTraceAnnotations.js +57 -0
  36. package/build/commands/fetchTraceAnnotations.js.map +1 -0
  37. package/build/commands/formatAnnotationMutation.d.ts +1 -1
  38. package/build/commands/formatAnnotationMutation.d.ts.map +1 -1
  39. package/build/commands/formatNoteMutation.d.ts +1 -1
  40. package/build/commands/formatNoteMutation.d.ts.map +1 -1
  41. package/build/commands/formatSetup.d.ts +50 -0
  42. package/build/commands/formatSetup.d.ts.map +1 -0
  43. package/build/commands/formatSetup.js +64 -0
  44. package/build/commands/formatSetup.js.map +1 -0
  45. package/build/commands/index.d.ts +4 -3
  46. package/build/commands/index.d.ts.map +1 -1
  47. package/build/commands/index.js +4 -3
  48. package/build/commands/index.js.map +1 -1
  49. package/build/commands/{noteMutationUtils.d.ts → noteMutations.d.ts} +1 -1
  50. package/build/commands/noteMutations.d.ts.map +1 -0
  51. package/build/commands/{noteMutationUtils.js → noteMutations.js} +1 -1
  52. package/build/commands/noteMutations.js.map +1 -0
  53. package/build/commands/options.d.ts +248 -0
  54. package/build/commands/options.d.ts.map +1 -0
  55. package/build/commands/options.js +16 -0
  56. package/build/commands/options.js.map +1 -0
  57. package/build/commands/profile.d.ts.map +1 -1
  58. package/build/commands/profile.js +3 -11
  59. package/build/commands/profile.js.map +1 -1
  60. package/build/commands/project.d.ts.map +1 -1
  61. package/build/commands/project.js +0 -1
  62. package/build/commands/project.js.map +1 -1
  63. package/build/commands/prompt.d.ts.map +1 -1
  64. package/build/commands/prompt.js.map +1 -1
  65. package/build/commands/self.d.ts.map +1 -1
  66. package/build/commands/self.js.map +1 -1
  67. package/build/commands/session.d.ts.map +1 -1
  68. package/build/commands/session.js +4 -4
  69. package/build/commands/session.js.map +1 -1
  70. package/build/commands/{sessionAnnotationsCommand.d.ts → sessionAnnotations.d.ts} +1 -1
  71. package/build/commands/sessionAnnotations.d.ts.map +1 -0
  72. package/build/commands/{sessionAnnotationsCommand.js → sessionAnnotations.js} +1 -1
  73. package/build/commands/sessionAnnotations.js.map +1 -0
  74. package/build/commands/setup.d.ts +19 -0
  75. package/build/commands/setup.d.ts.map +1 -0
  76. package/build/commands/setup.js +245 -0
  77. package/build/commands/setup.js.map +1 -0
  78. package/build/commands/span.d.ts.map +1 -1
  79. package/build/commands/span.js +5 -5
  80. package/build/commands/span.js.map +1 -1
  81. package/build/commands/spanAnnotations.d.ts +6 -13
  82. package/build/commands/spanAnnotations.d.ts.map +1 -1
  83. package/build/commands/spanAnnotations.js +154 -47
  84. package/build/commands/spanAnnotations.js.map +1 -1
  85. package/build/commands/trace.d.ts.map +1 -1
  86. package/build/commands/trace.js +6 -6
  87. package/build/commands/trace.js.map +1 -1
  88. package/build/commands/traceAnnotations.d.ts +6 -13
  89. package/build/commands/traceAnnotations.d.ts.map +1 -1
  90. package/build/commands/traceAnnotations.js +157 -47
  91. package/build/commands/traceAnnotations.js.map +1 -1
  92. package/build/config.d.ts +4 -1
  93. package/build/config.d.ts.map +1 -1
  94. package/build/config.js +67 -11
  95. package/build/config.js.map +1 -1
  96. package/build/curl.d.ts +17 -0
  97. package/build/curl.d.ts.map +1 -1
  98. package/build/curl.js.map +1 -1
  99. package/build/exitCodes.d.ts.map +1 -1
  100. package/build/optionParsers.d.ts +12 -0
  101. package/build/optionParsers.d.ts.map +1 -1
  102. package/build/optionParsers.js +15 -0
  103. package/build/optionParsers.js.map +1 -1
  104. package/build/pxi/App.d.ts.map +1 -1
  105. package/build/pxi/App.js +4 -0
  106. package/build/pxi/App.js.map +1 -1
  107. package/build/pxi/index.js.map +1 -1
  108. package/build/pxi/options.d.ts +98 -0
  109. package/build/pxi/options.d.ts.map +1 -1
  110. package/build/pxi/options.js.map +1 -1
  111. package/build/settings.d.ts.map +1 -1
  112. package/build/settings.js +4 -0
  113. package/build/settings.js.map +1 -1
  114. package/build/setup/agents/registry.d.ts +78 -0
  115. package/build/setup/agents/registry.d.ts.map +1 -0
  116. package/build/setup/agents/registry.js +129 -0
  117. package/build/setup/agents/registry.js.map +1 -0
  118. package/build/setup/copy.d.ts +167 -0
  119. package/build/setup/copy.d.ts.map +1 -0
  120. package/build/setup/copy.js +290 -0
  121. package/build/setup/copy.js.map +1 -0
  122. package/build/setup/deps/buildDefaultDeps.d.ts +13 -0
  123. package/build/setup/deps/buildDefaultDeps.d.ts.map +1 -0
  124. package/build/setup/deps/buildDefaultDeps.js +29 -0
  125. package/build/setup/deps/buildDefaultDeps.js.map +1 -0
  126. package/build/setup/deps/clipboard.d.ts +12 -0
  127. package/build/setup/deps/clipboard.d.ts.map +1 -0
  128. package/build/setup/deps/clipboard.js +30 -0
  129. package/build/setup/deps/clipboard.js.map +1 -0
  130. package/build/setup/deps/clock.d.ts +10 -0
  131. package/build/setup/deps/clock.d.ts.map +1 -0
  132. package/build/setup/deps/clock.js +11 -0
  133. package/build/setup/deps/clock.js.map +1 -0
  134. package/build/setup/deps/context.d.ts +28 -0
  135. package/build/setup/deps/context.d.ts.map +1 -0
  136. package/build/setup/deps/context.js +24 -0
  137. package/build/setup/deps/context.js.map +1 -0
  138. package/build/setup/deps/docs.d.ts +41 -0
  139. package/build/setup/deps/docs.d.ts.map +1 -0
  140. package/build/setup/deps/docs.js +33 -0
  141. package/build/setup/deps/docs.js.map +1 -0
  142. package/build/setup/deps/index.d.ts +42 -0
  143. package/build/setup/deps/index.d.ts.map +1 -0
  144. package/build/setup/deps/index.js +16 -0
  145. package/build/setup/deps/index.js.map +1 -0
  146. package/build/setup/deps/phoenixClient.d.ts +22 -0
  147. package/build/setup/deps/phoenixClient.d.ts.map +1 -0
  148. package/build/setup/deps/phoenixClient.js +17 -0
  149. package/build/setup/deps/phoenixClient.js.map +1 -0
  150. package/build/setup/deps/processes.d.ts +28 -0
  151. package/build/setup/deps/processes.d.ts.map +1 -0
  152. package/build/setup/deps/processes.js +58 -0
  153. package/build/setup/deps/processes.js.map +1 -0
  154. package/build/setup/deps/prompter.d.ts +42 -0
  155. package/build/setup/deps/prompter.d.ts.map +1 -0
  156. package/build/setup/deps/prompter.js +10 -0
  157. package/build/setup/deps/prompter.js.map +1 -0
  158. package/build/setup/errors.d.ts +27 -0
  159. package/build/setup/errors.d.ts.map +1 -0
  160. package/build/setup/errors.js +36 -0
  161. package/build/setup/errors.js.map +1 -0
  162. package/build/setup/options.d.ts +113 -0
  163. package/build/setup/options.d.ts.map +1 -0
  164. package/build/setup/options.js +63 -0
  165. package/build/setup/options.js.map +1 -0
  166. package/build/setup/prompts/instrumentationPrompt.d.ts +42 -0
  167. package/build/setup/prompts/instrumentationPrompt.d.ts.map +1 -0
  168. package/build/setup/prompts/instrumentationPrompt.js +64 -0
  169. package/build/setup/prompts/instrumentationPrompt.js.map +1 -0
  170. package/build/setup/runSetup.d.ts +45 -0
  171. package/build/setup/runSetup.d.ts.map +1 -0
  172. package/build/setup/runSetup.js +212 -0
  173. package/build/setup/runSetup.js.map +1 -0
  174. package/build/setup/steps/chooseEndpoint.d.ts +36 -0
  175. package/build/setup/steps/chooseEndpoint.d.ts.map +1 -0
  176. package/build/setup/steps/chooseEndpoint.js +125 -0
  177. package/build/setup/steps/chooseEndpoint.js.map +1 -0
  178. package/build/setup/steps/confirmGitSafety.d.ts +17 -0
  179. package/build/setup/steps/confirmGitSafety.d.ts.map +1 -0
  180. package/build/setup/steps/confirmGitSafety.js +73 -0
  181. package/build/setup/steps/confirmGitSafety.js.map +1 -0
  182. package/build/setup/steps/establishConnection.d.ts +29 -0
  183. package/build/setup/steps/establishConnection.d.ts.map +1 -0
  184. package/build/setup/steps/establishConnection.js +143 -0
  185. package/build/setup/steps/establishConnection.js.map +1 -0
  186. package/build/setup/steps/installTooling.d.ts +28 -0
  187. package/build/setup/steps/installTooling.d.ts.map +1 -0
  188. package/build/setup/steps/installTooling.js +79 -0
  189. package/build/setup/steps/installTooling.js.map +1 -0
  190. package/build/setup/steps/instrumentApp.d.ts +41 -0
  191. package/build/setup/steps/instrumentApp.d.ts.map +1 -0
  192. package/build/setup/steps/instrumentApp.js +131 -0
  193. package/build/setup/steps/instrumentApp.js.map +1 -0
  194. package/build/setup/steps/offerPxProfile.d.ts +20 -0
  195. package/build/setup/steps/offerPxProfile.d.ts.map +1 -0
  196. package/build/setup/steps/offerPxProfile.js +95 -0
  197. package/build/setup/steps/offerPxProfile.js.map +1 -0
  198. package/build/setup/steps/prefetchDocs.d.ts +24 -0
  199. package/build/setup/steps/prefetchDocs.d.ts.map +1 -0
  200. package/build/setup/steps/prefetchDocs.js +49 -0
  201. package/build/setup/steps/prefetchDocs.js.map +1 -0
  202. package/build/setup/steps/verifyTraces.d.ts +44 -0
  203. package/build/setup/steps/verifyTraces.d.ts.map +1 -0
  204. package/build/setup/steps/verifyTraces.js +119 -0
  205. package/build/setup/steps/verifyTraces.js.map +1 -0
  206. package/build/setup/steps/writeEnvFile.d.ts +19 -0
  207. package/build/setup/steps/writeEnvFile.d.ts.map +1 -0
  208. package/build/setup/steps/writeEnvFile.js +50 -0
  209. package/build/setup/steps/writeEnvFile.js.map +1 -0
  210. package/build/setup/ui/clackPrompter.d.ts +11 -0
  211. package/build/setup/ui/clackPrompter.d.ts.map +1 -0
  212. package/build/setup/ui/clackPrompter.js +107 -0
  213. package/build/setup/ui/clackPrompter.js.map +1 -0
  214. package/build/setup/ui/selectBoolean.d.ts +18 -0
  215. package/build/setup/ui/selectBoolean.d.ts.map +1 -0
  216. package/build/setup/ui/selectBoolean.js +14 -0
  217. package/build/setup/ui/selectBoolean.js.map +1 -0
  218. package/build/setup/util/gitignoreCoverage.d.ts +24 -0
  219. package/build/setup/util/gitignoreCoverage.d.ts.map +1 -0
  220. package/build/setup/util/gitignoreCoverage.js +43 -0
  221. package/build/setup/util/gitignoreCoverage.js.map +1 -0
  222. package/build/setup/util/paths.d.ts +6 -0
  223. package/build/setup/util/paths.d.ts.map +1 -0
  224. package/build/setup/util/paths.js +23 -0
  225. package/build/setup/util/paths.js.map +1 -0
  226. package/build/setup/util/redact.d.ts +12 -0
  227. package/build/setup/util/redact.d.ts.map +1 -0
  228. package/build/setup/util/redact.js +31 -0
  229. package/build/setup/util/redact.js.map +1 -0
  230. package/build/validation/endpoint.d.ts +19 -0
  231. package/build/validation/endpoint.d.ts.map +1 -0
  232. package/build/validation/endpoint.js +39 -0
  233. package/build/validation/endpoint.js.map +1 -0
  234. package/build/version.js.map +1 -1
  235. package/package.json +15 -12
  236. package/build/commands/annotationMutationUtils.d.ts.map +0 -1
  237. package/build/commands/annotationMutationUtils.js.map +0 -1
  238. package/build/commands/noteMutationUtils.d.ts.map +0 -1
  239. package/build/commands/noteMutationUtils.js.map +0 -1
  240. package/build/commands/sessionAnnotationsCommand.d.ts.map +0 -1
  241. package/build/commands/sessionAnnotationsCommand.js.map +0 -1
  242. package/build/commands/spanAnnotationsCommand.d.ts +0 -7
  243. package/build/commands/spanAnnotationsCommand.d.ts.map +0 -1
  244. package/build/commands/spanAnnotationsCommand.js +0 -164
  245. package/build/commands/spanAnnotationsCommand.js.map +0 -1
  246. package/build/commands/traceAnnotationsCommand.d.ts +0 -7
  247. package/build/commands/traceAnnotationsCommand.d.ts.map +0 -1
  248. package/build/commands/traceAnnotationsCommand.js +0 -167
  249. package/build/commands/traceAnnotationsCommand.js.map +0 -1
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Prefetch the Phoenix docs into the repo, so the instrumentation agent reads
3
+ * package names and APIs from disk instead of fetching URLs mid-run.
4
+ *
5
+ * Runs only when instrumentation runs — the docs exist to serve the agent, so
6
+ * a registration-only run has no reason to write them. Never fatal: a docs
7
+ * site that is slow or down degrades to the agent fetching pages itself, which
8
+ * is what it did before this step existed.
9
+ *
10
+ * Must run after the git-safety gate: the download writes untracked files
11
+ * under `.px/`, which a fast headless run could otherwise mistake for
12
+ * pre-existing user changes.
13
+ */
14
+ import * as COPY from "../copy.js";
15
+ import { unknownWorkflowWarning, } from "../deps/index.js";
16
+ import { ensureGitignored } from "../util/gitignoreCoverage.js";
17
+ /** The docs land under `.px/`, so that is what gets gitignored. */
18
+ const DOCS_GITIGNORE_ENTRY = ".px/";
19
+ /**
20
+ * Download the docs and gitignore what they wrote. A failure is reported and
21
+ * dropped: the connection and hand-off files are real work worth keeping, and
22
+ * the agent can still read the docs from the web.
23
+ */
24
+ export async function prefetchDocs(deps, { docs, isGitRepository, }) {
25
+ if (!docs.enabled) {
26
+ return undefined;
27
+ }
28
+ deps.prompter.line(COPY.DOCS_PREFETCH.fetching);
29
+ try {
30
+ const result = await deps.fetchDocs(docs);
31
+ // A typo'd --workflow filters silently, so name it — otherwise the run
32
+ // reports "0 pages" with no hint the workflow value was the problem.
33
+ for (const workflow of result.unknownWorkflows ?? []) {
34
+ deps.prompter.line(unknownWorkflowWarning(workflow));
35
+ }
36
+ const { appended } = ensureGitignored({
37
+ directory: deps.context.cwd,
38
+ filenames: [DOCS_GITIGNORE_ENTRY],
39
+ isGitRepository,
40
+ });
41
+ deps.prompter.line(COPY.DOCS_PREFETCH.wrote(result.written, result.outputDir));
42
+ return { ...result, gitignoreAppended: appended };
43
+ }
44
+ catch (error) {
45
+ deps.prompter.line(COPY.DOCS_PREFETCH.failed(error instanceof Error ? error.message : String(error)));
46
+ return undefined;
47
+ }
48
+ }
49
+ //# sourceMappingURL=prefetchDocs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefetchDocs.js","sourceRoot":"","sources":["../../../src/setup/steps/prefetchDocs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EACL,sBAAsB,GAIvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,mEAAmE;AACnE,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,IAA2D,EAC3D,EACE,IAAI,EACJ,eAAe,GACyC;IAE1D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC1C,uEAAuE;QACvE,qEAAqE;QACrE,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,gBAAgB,IAAI,EAAE,EAAE,CAAC;YACrD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;YACpC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG;YAC3B,SAAS,EAAE,CAAC,oBAAoB,CAAC;YACjC,eAAe;SAChB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAC3D,CAAC;QACF,OAAO,EAAE,GAAG,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IACpD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,IAAI,CAAC,aAAa,CAAC,MAAM,CACvB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CACF,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Wait for the first trace to land.
3
+ *
4
+ * Setup verifies data flow itself: it polls the Phoenix span-search API
5
+ * for a span newer than the start of this run until one arrives. The human is
6
+ * only consulted at the timeout escape hatch ("keep watching / finish
7
+ * anyway") — never asked to eyeball the UI as the definition of done.
8
+ */
9
+ import type { SetupDeps } from "../deps/index.js";
10
+ import type { Connection } from "./establishConnection.js";
11
+ /**
12
+ * The project may not exist until the first trace lands, so link by name via
13
+ * the redirect route rather than by an id we no longer have.
14
+ */
15
+ export declare function tracesUrl(connection: Connection): string;
16
+ /**
17
+ * True when the project already has spans inside the clock-skew window at
18
+ * `sinceMs`. Checked before instrumentation begins: any span visible at that
19
+ * point predates this run, so verification must not credit the skew window.
20
+ */
21
+ export declare function hasSpansInSkewWindow(deps: Pick<SetupDeps, "createClient">, connection: Connection, { sinceMs }: {
22
+ sinceMs: number;
23
+ }): Promise<boolean>;
24
+ /**
25
+ * Watch for the first trace since `sinceMs`. Resolves true when a span is
26
+ * observed via the API, false when the wait ends without one — the user gave
27
+ * up at the timeout prompt, or, in a headless run, the first window elapsed.
28
+ *
29
+ * The "keep watching?" prompt is the only thing that can extend the wait, so a
30
+ * headless run gets exactly one window: there is no terminal to ask on, and
31
+ * looping forever would hang an unattended caller.
32
+ *
33
+ * @param args.sinceMs - instrumentation start; only spans after it count.
34
+ * @param args.allowClockSkew - widen the window by the skew tolerance. Pass
35
+ * false when the project had spans before instrumentation began (see
36
+ * `hasSpansInSkewWindow`), so stale spans cannot satisfy verification.
37
+ * @param args.headless - no prompting; give up after one window.
38
+ */
39
+ export declare function waitForFirstTrace(deps: Pick<SetupDeps, "clock" | "createClient" | "prompter">, connection: Connection, { sinceMs, allowClockSkew, headless, }: {
40
+ sinceMs: number;
41
+ allowClockSkew?: boolean;
42
+ headless?: boolean;
43
+ }): Promise<boolean>;
44
+ //# sourceMappingURL=verifyTraces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyTraces.d.ts","sourceRoot":"","sources":["../../../src/setup/steps/verifyTraces.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAQxD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAIxD;AAOD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,EACrC,UAAU,EAAE,UAAU,EACtB,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC/B,OAAO,CAAC,OAAO,CAAC,CAMlB;AA0DD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC,EAC5D,UAAU,EAAE,UAAU,EACtB,EACE,OAAO,EACP,cAAqB,EACrB,QAAgB,GACjB,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GACnE,OAAO,CAAC,OAAO,CAAC,CAoClB"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Wait for the first trace to land.
3
+ *
4
+ * Setup verifies data flow itself: it polls the Phoenix span-search API
5
+ * for a span newer than the start of this run until one arrives. The human is
6
+ * only consulted at the timeout escape hatch ("keep watching / finish
7
+ * anyway") — never asked to eyeball the UI as the definition of done.
8
+ */
9
+ import * as COPY from "../copy.js";
10
+ const POLL_INTERVAL_MS = 2_000;
11
+ const POLL_WINDOW_MS = 60_000;
12
+ const POLL_REQUEST_TIMEOUT_MS = 5_000;
13
+ /** Tolerance for clock skew between this machine and the span producer. */
14
+ const START_TIME_SKEW_MS = 60_000;
15
+ /**
16
+ * The project may not exist until the first trace lands, so link by name via
17
+ * the redirect route rather than by an id we no longer have.
18
+ */
19
+ export function tracesUrl(connection) {
20
+ return `${connection.endpoint}/redirects/projects/${encodeURIComponent(connection.projectName)}`;
21
+ }
22
+ /** Inclusive lower bound of the span search, as the API's ISO timestamp. */
23
+ function searchStartTime(sinceMs, skewMs) {
24
+ return new Date(sinceMs - skewMs).toISOString();
25
+ }
26
+ /**
27
+ * True when the project already has spans inside the clock-skew window at
28
+ * `sinceMs`. Checked before instrumentation begins: any span visible at that
29
+ * point predates this run, so verification must not credit the skew window.
30
+ */
31
+ export async function hasSpansInSkewWindow(deps, connection, { sinceMs }) {
32
+ return hasNewSpans(spanSearchClient(deps, connection), connection.projectName, searchStartTime(sinceMs, START_TIME_SKEW_MS));
33
+ }
34
+ function spanSearchClient(deps, connection) {
35
+ return deps.createClient({
36
+ endpoint: connection.endpoint,
37
+ apiKey: connection.apiKey,
38
+ });
39
+ }
40
+ /**
41
+ * One span-search request. Any failure is a "not yet": a 404 means the project
42
+ * has no spans to have created it, and a network hiccup mid-poll should keep
43
+ * setup watching rather than abort it.
44
+ */
45
+ async function hasNewSpans(client, projectName, startTime) {
46
+ try {
47
+ const { data } = await client.GET("/v1/projects/{project_identifier}/spans", {
48
+ params: {
49
+ path: { project_identifier: projectName },
50
+ query: { limit: 1, start_time: startTime },
51
+ },
52
+ signal: AbortSignal.timeout(POLL_REQUEST_TIMEOUT_MS),
53
+ });
54
+ return (data?.data.length ?? 0) > 0;
55
+ }
56
+ catch {
57
+ return false;
58
+ }
59
+ }
60
+ /** Poll until a span arrives or the window elapses. */
61
+ async function pollWindow(deps, client, connection, startTime) {
62
+ const deadline = deps.clock.now() + POLL_WINDOW_MS;
63
+ for (;;) {
64
+ if (await hasNewSpans(client, connection.projectName, startTime)) {
65
+ return true;
66
+ }
67
+ if (deps.clock.now() >= deadline) {
68
+ return false;
69
+ }
70
+ await deps.clock.sleep(POLL_INTERVAL_MS);
71
+ }
72
+ }
73
+ /**
74
+ * Watch for the first trace since `sinceMs`. Resolves true when a span is
75
+ * observed via the API, false when the wait ends without one — the user gave
76
+ * up at the timeout prompt, or, in a headless run, the first window elapsed.
77
+ *
78
+ * The "keep watching?" prompt is the only thing that can extend the wait, so a
79
+ * headless run gets exactly one window: there is no terminal to ask on, and
80
+ * looping forever would hang an unattended caller.
81
+ *
82
+ * @param args.sinceMs - instrumentation start; only spans after it count.
83
+ * @param args.allowClockSkew - widen the window by the skew tolerance. Pass
84
+ * false when the project had spans before instrumentation began (see
85
+ * `hasSpansInSkewWindow`), so stale spans cannot satisfy verification.
86
+ * @param args.headless - no prompting; give up after one window.
87
+ */
88
+ export async function waitForFirstTrace(deps, connection, { sinceMs, allowClockSkew = true, headless = false, }) {
89
+ const url = tracesUrl(connection);
90
+ const startTime = searchStartTime(sinceMs, allowClockSkew ? START_TIME_SKEW_MS : 0);
91
+ const client = spanSearchClient(deps, connection);
92
+ deps.prompter.note(COPY.VERIFY.waitingBody(url), COPY.VERIFY.title);
93
+ for (;;) {
94
+ if (await pollWindow(deps, client, connection, startTime)) {
95
+ deps.prompter.line(COPY.VERIFY.received(url));
96
+ return true;
97
+ }
98
+ if (headless) {
99
+ deps.prompter.line(COPY.VERIFY.notVerifiedHeadless(url));
100
+ return false;
101
+ }
102
+ const keepWatching = await deps.prompter.select({
103
+ message: COPY.VERIFY.timeoutMessage,
104
+ options: [
105
+ { value: true, label: COPY.VERIFY.keepWatchingLabel },
106
+ {
107
+ value: false,
108
+ label: COPY.VERIFY.finishLabel,
109
+ hint: COPY.VERIFY.finishHint,
110
+ },
111
+ ],
112
+ });
113
+ if (!keepWatching) {
114
+ deps.prompter.note(COPY.VERIFY.notVerifiedBody(url), COPY.VERIFY.notVerifiedTitle);
115
+ return false;
116
+ }
117
+ }
118
+ }
119
+ //# sourceMappingURL=verifyTraces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyTraces.js","sourceRoot":"","sources":["../../../src/setup/steps/verifyTraces.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAIhC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,uBAAuB,GAAG,KAAK,CAAC;AACtC,2EAA2E;AAC3E,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC;;;GAGG;AACH,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,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAC9C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAU;YACvD,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc;YACnC,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE;gBACrD;oBACE,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW;oBAC9B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU;iBAC7B;aACF;SACF,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,EAChC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAC7B,CAAC;YACF,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Write the hand-off file.
3
+ *
4
+ * Writes `.env.phoenix` into cwd (deliberately not the repo root — bounded
5
+ * blast radius in monorepos), mode 0600, then ensures it is gitignored. The
6
+ * file emits the SDK env var names — it configures the user's app, not px.
7
+ */
8
+ import type { SetupDeps } from "../deps/index.js";
9
+ import type { Connection } from "./establishConnection.js";
10
+ export declare const ENV_FILE_NAME = ".env.phoenix";
11
+ export declare function renderEnvFile(connection: Connection, isoDate: string): string;
12
+ export interface WriteEnvFileResult {
13
+ envFilePath: string;
14
+ gitignoreAppended: string[];
15
+ }
16
+ export declare function writeEnvFile(deps: Pick<SetupDeps, "clock" | "context">, connection: Connection, { isGitRepository }: {
17
+ isGitRepository: boolean;
18
+ }): WriteEnvFileResult;
19
+ //# sourceMappingURL=writeEnvFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeEnvFile.d.ts","sourceRoot":"","sources":["../../../src/setup/steps/writeEnvFile.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,eAAO,MAAM,aAAa,iBAAiB,CAAC;AAY5C,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAU7E;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,EAC1C,UAAU,EAAE,UAAU,EACtB,EAAE,eAAe,EAAE,EAAE;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,GAChD,kBAAkB,CAmBpB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Write the hand-off file.
3
+ *
4
+ * Writes `.env.phoenix` into cwd (deliberately not the repo root — bounded
5
+ * blast radius in monorepos), mode 0600, then ensures it is gitignored. The
6
+ * file emits the SDK env var names — it configures the user's app, not px.
7
+ */
8
+ import * as fs from "node:fs";
9
+ import * as path from "node:path";
10
+ import * as COPY from "../copy.js";
11
+ import { ensureGitignored } from "../util/gitignoreCoverage.js";
12
+ export const ENV_FILE_NAME = ".env.phoenix";
13
+ /**
14
+ * Double-quote a value for a `source`-able env file, escaping the characters
15
+ * the shell still interprets inside double quotes. Project names may contain
16
+ * spaces (the default is the cwd basename), and dotenv-style loaders strip
17
+ * the same quotes.
18
+ */
19
+ function quoteEnvValue(value) {
20
+ return `"${value.replace(/[\\"$`]/g, (char) => `\\${char}`)}"`;
21
+ }
22
+ export function renderEnvFile(connection, isoDate) {
23
+ const lines = [
24
+ COPY.ENV_FILE.fileHeaderEnv(isoDate),
25
+ `PHOENIX_COLLECTOR_ENDPOINT=${quoteEnvValue(connection.endpoint)}`,
26
+ `PHOENIX_PROJECT_NAME=${quoteEnvValue(connection.projectName)}`,
27
+ ];
28
+ if (connection.apiKey) {
29
+ lines.push(`PHOENIX_API_KEY=${quoteEnvValue(connection.apiKey)}`);
30
+ }
31
+ return `${lines.join("\n")}\n`;
32
+ }
33
+ export function writeEnvFile(deps, connection, { isGitRepository }) {
34
+ const isoDate = new Date(deps.clock.now()).toISOString();
35
+ const envFilePath = path.join(deps.context.cwd, ENV_FILE_NAME);
36
+ fs.writeFileSync(envFilePath, renderEnvFile(connection, isoDate), {
37
+ encoding: "utf-8",
38
+ mode: 0o600,
39
+ });
40
+ // Rewrites of an existing file keep its old mode — enforce 0600 anyway.
41
+ fs.chmodSync(envFilePath, 0o600);
42
+ // Applied in the auth-off case too: the file may later gain a key.
43
+ const { appended } = ensureGitignored({
44
+ directory: deps.context.cwd,
45
+ filenames: [ENV_FILE_NAME],
46
+ isGitRepository,
47
+ });
48
+ return { envFilePath, gitignoreAppended: appended };
49
+ }
50
+ //# sourceMappingURL=writeEnvFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeEnvFile.js","sourceRoot":"","sources":["../../../src/setup/steps/writeEnvFile.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MA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,CAAC;IAEjC,mEAAmE;IACnE,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;QACpC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG;QAC3B,SAAS,EAAE,CAAC,aAAa,CAAC;QAC1B,eAAe;KAChB,CAAC,CAAC;IAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Clack-backed implementation of setup's `Prompter` seam.
3
+ *
4
+ * House rules: setup has no confirm primitive — every
5
+ * choice, including booleans, is a select. Cancellation (Ctrl-C / Escape)
6
+ * maps to `SetupCancelledError`, unwinding to the single catch site in the
7
+ * command handler.
8
+ */
9
+ import type { Prompter } from "../deps/index.js";
10
+ export declare function createClackPrompter(): Prompter;
11
+ //# sourceMappingURL=clackPrompter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clackPrompter.d.ts","sourceRoot":"","sources":["../../../src/setup/ui/clackPrompter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,SAAS,CAAC;AAWtD,wBAAgB,mBAAmB,IAAI,QAAQ,CAyG9C"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Clack-backed implementation of setup's `Prompter` seam.
3
+ *
4
+ * House rules: setup has no confirm primitive — every
5
+ * choice, including booleans, is a select. Cancellation (Ctrl-C / Escape)
6
+ * maps to `SetupCancelledError`, unwinding to the single catch site in the
7
+ * command handler.
8
+ */
9
+ import { intro, isCancel, log, outro, password, select, text, } from "@clack/prompts";
10
+ import { SetupCancelledError } from "../errors.js";
11
+ // Nothing this seam writes belongs on stdout: under `--format raw|json` stdout
12
+ // carries the machine-readable report and nothing else, and a banner, a prompt,
13
+ // or a narration line mixed into it is a parse error for whoever is reading.
14
+ // Every clack primitive defaults to stdout and takes an `output`, so every call
15
+ // below passes this — including the prompts, which an interactive `--format
16
+ // json` run would otherwise render into the report.
17
+ const TO_STDERR = { output: process.stderr };
18
+ export function createClackPrompter() {
19
+ return {
20
+ async select(args) {
21
+ // Loop so picking a disabled option explains itself and re-asks
22
+ // instead of proceeding.
23
+ for (;;) {
24
+ // Clack's Option<T> type only resolves for primitive T; the shape
25
+ // we build is valid for both branches, so the cast is safe.
26
+ const answer = await select({
27
+ ...TO_STDERR,
28
+ message: args.message,
29
+ options: args.options.map((option) => ({
30
+ value: option.value,
31
+ label: option.disabled ? `✗ ${option.label}` : option.label,
32
+ hint: option.hint,
33
+ })),
34
+ });
35
+ if (isCancel(answer)) {
36
+ throw new SetupCancelledError();
37
+ }
38
+ const picked = args.options.find((option) => option.value === answer);
39
+ if (picked?.disabled) {
40
+ log.warn(picked.hint ?? "That option is not available.", TO_STDERR);
41
+ continue;
42
+ }
43
+ return answer;
44
+ }
45
+ },
46
+ async textInput(args) {
47
+ const answer = await text({
48
+ ...TO_STDERR,
49
+ message: args.message,
50
+ defaultValue: args.defaultValue,
51
+ placeholder: args.defaultValue,
52
+ validate: args.validate
53
+ ? (value) => {
54
+ // Clack substitutes defaultValue for an empty submission, but
55
+ // runs validate on the raw (empty) input — validate what will
56
+ // actually be returned.
57
+ const effective = !value && args.defaultValue !== undefined
58
+ ? args.defaultValue
59
+ : (value ?? "");
60
+ return args.validate?.(effective);
61
+ }
62
+ : undefined,
63
+ });
64
+ if (isCancel(answer)) {
65
+ throw new SetupCancelledError();
66
+ }
67
+ return answer;
68
+ },
69
+ async passwordInput(args) {
70
+ const answer = await password({
71
+ ...TO_STDERR,
72
+ message: args.message,
73
+ validate: args.validate
74
+ ? (value) => args.validate?.(value ?? "")
75
+ : undefined,
76
+ });
77
+ if (isCancel(answer)) {
78
+ throw new SetupCancelledError();
79
+ }
80
+ return answer;
81
+ },
82
+ note(message, title) {
83
+ // A heading over an indented body, not clack's boxed `note`: clack's guide
84
+ // rail already sets the block apart, and the box adds a border that has to
85
+ // reflow on every resize. Untitled, there is no heading to indent under.
86
+ if (title === undefined) {
87
+ log.message(message, TO_STDERR);
88
+ return;
89
+ }
90
+ const body = message
91
+ .split("\n")
92
+ .map((line) => ` ${line}`)
93
+ .join("\n");
94
+ log.message(`${title}\n${body}`, TO_STDERR);
95
+ },
96
+ line(message) {
97
+ log.message(message, TO_STDERR);
98
+ },
99
+ intro(message) {
100
+ intro(message, TO_STDERR);
101
+ },
102
+ outro(message) {
103
+ outro(message, TO_STDERR);
104
+ },
105
+ };
106
+ }
107
+ //# sourceMappingURL=clackPrompter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clackPrompter.js","sourceRoot":"","sources":["../../../src/setup/ui/clackPrompter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,QAAQ,EACR,MAAM,EACN,IAAI,GACL,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,+EAA+E;AAC/E,gFAAgF;AAChF,6EAA6E;AAC7E,gFAAgF;AAChF,4EAA4E;AAC5E,oDAAoD;AACpD,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAE7C,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,KAAK,CAAC,MAAM,CAAI,IAGf;YACC,gEAAgE;YAChE,yBAAyB;YACzB,SAAS,CAAC;gBACR,kEAAkE;gBAClE,4DAA4D;gBAC5D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAI;oBAC7B,GAAG,SAAS;oBACZ,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;wBACrC,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,M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Ae;YACnB,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Boolean choice rendered as a labeled select — setup has no bare
3
+ * confirm. For dangerous choices the "No" option is listed first
4
+ * so the default cursor position is the safe one.
5
+ */
6
+ import type { Prompter } from "../deps/index.js";
7
+ export interface SelectBooleanArgs {
8
+ prompter: Prompter;
9
+ message: string;
10
+ yesLabel: string;
11
+ noLabel: string;
12
+ yesHint?: string;
13
+ noHint?: string;
14
+ /** When true, "No" is listed first (safe default for dangerous choices). */
15
+ noFirst?: boolean;
16
+ }
17
+ export declare function selectBoolean({ prompter, message, yesLabel, noLabel, yesHint, noHint, noFirst, }: SelectBooleanArgs): Promise<boolean>;
18
+ //# sourceMappingURL=selectBoolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectBoolean.d.ts","sourceRoot":"","sources":["../../../src/setup/ui/selectBoolean.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,OAAO,GACR,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAOtC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Boolean choice rendered as a labeled select — setup has no bare
3
+ * confirm. For dangerous choices the "No" option is listed first
4
+ * so the default cursor position is the safe one.
5
+ */
6
+ export async function selectBoolean({ prompter, message, yesLabel, noLabel, yesHint, noHint, noFirst, }) {
7
+ const yes = { value: true, label: yesLabel, hint: yesHint };
8
+ const no = { value: false, label: noLabel, hint: noHint };
9
+ return prompter.select({
10
+ message,
11
+ options: noFirst ? [no, yes] : [yes, no],
12
+ });
13
+ }
14
+ //# sourceMappingURL=selectBoolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectBoolean.js","sourceRoot":"","sources":["../../../src/setup/ui/selectBoolean.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,OAAO,GACW;IAClB,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC5D,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1D,OAAO,QAAQ,CAAC,MAAM,CAAU;QAC9B,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;KACzC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Gitignore coverage check + banner append for setup's hand-off files.
3
+ *
4
+ * Coverage is evaluated with the `ignore` package against the existing
5
+ * patterns — never a naive substring search — so a pattern like `.env*`
6
+ * already covers `.env.phoenix` and nothing is appended.
7
+ */
8
+ export declare const GITIGNORE_BANNER = "# Added by px setup \u2014 local Phoenix credentials";
9
+ export interface EnsureGitignoredArgs {
10
+ /** Directory containing (or to contain) the .gitignore file. */
11
+ directory: string;
12
+ /** Bare filenames (relative to `directory`) that must be ignored. */
13
+ filenames: string[];
14
+ /** When false (not a git repo), no .gitignore is created or modified. */
15
+ isGitRepository: boolean;
16
+ }
17
+ export interface EnsureGitignoredResult {
18
+ /** Names that were appended (empty when everything was already covered). */
19
+ appended: string[];
20
+ /** Path to the .gitignore that was modified, when a write happened. */
21
+ gitignorePath?: string;
22
+ }
23
+ export declare function ensureGitignored({ directory, filenames, isGitRepository, }: EnsureGitignoredArgs): EnsureGitignoredResult;
24
+ //# sourceMappingURL=gitignoreCoverage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitignoreCoverage.d.ts","sourceRoot":"","sources":["../../../src/setup/util/gitignoreCoverage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,eAAO,MAAM,gBAAgB,yDACsB,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,yEAAyE;IACzE,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,SAAS,EACT,eAAe,GAChB,EAAE,oBAAoB,GAAG,sBAAsB,CAmC/C"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Gitignore coverage check + banner append for setup's hand-off files.
3
+ *
4
+ * Coverage is evaluated with the `ignore` package against the existing
5
+ * patterns — never a naive substring search — so a pattern like `.env*`
6
+ * already covers `.env.phoenix` and nothing is appended.
7
+ */
8
+ import * as fs from "node:fs";
9
+ import * as path from "node:path";
10
+ import ignore from "ignore";
11
+ export const GITIGNORE_BANNER = "# Added by px setup — local Phoenix credentials";
12
+ export function ensureGitignored({ directory, filenames, isGitRepository, }) {
13
+ const gitignorePath = path.join(directory, ".gitignore");
14
+ const exists = fs.existsSync(gitignorePath);
15
+ // No .gitignore and not a repo → skip silently.
16
+ if (!exists && !isGitRepository) {
17
+ return { appended: [] };
18
+ }
19
+ const existingContent = exists ? fs.readFileSync(gitignorePath, "utf-8") : "";
20
+ const matcher = ignore().add(existingContent);
21
+ const uncovered = filenames.filter((name) => !matcher.ignores(name));
22
+ if (uncovered.length === 0) {
23
+ return { appended: [] };
24
+ }
25
+ const banner = [GITIGNORE_BANNER, ...uncovered].join("\n");
26
+ let updated;
27
+ if (existingContent === "") {
28
+ updated = `${banner}\n`;
29
+ }
30
+ else if (existingContent.endsWith("\n")) {
31
+ updated = `${existingContent}\n${banner}\n`;
32
+ }
33
+ else {
34
+ // File didn't end with a newline — terminate the last line, then a
35
+ // blank separator line before the banner.
36
+ updated = `${existingContent}\n\n${banner}\n`;
37
+ }
38
+ // Exactly one trailing newline.
39
+ updated = `${updated.replace(/\n+$/, "")}\n`;
40
+ fs.writeFileSync(gitignorePath, updated, "utf-8");
41
+ return { appended: uncovered, gitignorePath };
42
+ }
43
+ //# sourceMappingURL=gitignoreCoverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitignoreCoverage.js","sourceRoot":"","sources":["../../../src/setup/util/gitignoreCoverage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,gBAAgB,GAC3B,iDAAiD,CAAC;AAkBpD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,SAAS,EACT,eAAe,GACM;IACrB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,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AC;IAClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Path humanization for setup output: cwd-relative if under cwd, else
3
+ * ~/-relative, else basename.
4
+ */
5
+ export declare function humanizePath(target: string, cwd: string): string;
6
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/setup/util/paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAehE"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Path humanization for setup output: cwd-relative if under cwd, else
3
+ * ~/-relative, else basename.
4
+ */
5
+ import * as os from "node:os";
6
+ import * as path from "node:path";
7
+ export function humanizePath(target, cwd) {
8
+ const absolute = path.resolve(cwd, target);
9
+ const cwdRelative = path.relative(cwd, absolute);
10
+ if (cwdRelative && !cwdRelative.startsWith("..")) {
11
+ return cwdRelative;
12
+ }
13
+ if (cwdRelative === "") {
14
+ return ".";
15
+ }
16
+ const home = os.homedir();
17
+ const homeRelative = path.relative(home, absolute);
18
+ if (homeRelative && !homeRelative.startsWith("..")) {
19
+ return `~/${homeRelative}`;
20
+ }
21
+ return path.basename(absolute);
22
+ }
23
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/setup/util/paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,GAAW;IACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACjD,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,WAAW,KAAK,EAAE,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnD,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,OAAO,KAAK,YAAY,EAAE,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Secret scrubbing for all surfaced subprocess / HTTP error text.
3
+ * Applied before anything from an external process or response body reaches
4
+ * the terminal.
5
+ */
6
+ export declare function redact(text: string): string;
7
+ /**
8
+ * Redact then truncate for display. All error text from probes, HTTP
9
+ * responses, and subprocesses goes through this before being shown.
10
+ */
11
+ export declare function redactForDisplay(text: string): string;
12
+ //# sourceMappingURL=redact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../../src/setup/util/redact.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM3C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrD"}