workos 0.19.0 → 0.20.2

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 (681) hide show
  1. package/README.md +4 -646
  2. package/bin/workos.js +44 -0
  3. package/package.json +18 -99
  4. package/LICENSE +0 -47
  5. package/dist/bin.d.ts +0 -2
  6. package/dist/bin.js +0 -1790
  7. package/dist/bin.js.map +0 -1
  8. package/dist/cli.config.d.ts +0 -88
  9. package/dist/cli.config.js +0 -110
  10. package/dist/cli.config.js.map +0 -1
  11. package/dist/commands/api/catalog.d.ts +0 -23
  12. package/dist/commands/api/catalog.js +0 -97
  13. package/dist/commands/api/catalog.js.map +0 -1
  14. package/dist/commands/api/format.d.ts +0 -5
  15. package/dist/commands/api/format.js +0 -46
  16. package/dist/commands/api/format.js.map +0 -1
  17. package/dist/commands/api/index.d.ts +0 -15
  18. package/dist/commands/api/index.js +0 -213
  19. package/dist/commands/api/index.js.map +0 -1
  20. package/dist/commands/api/interactive.d.ts +0 -3
  21. package/dist/commands/api/interactive.js +0 -133
  22. package/dist/commands/api/interactive.js.map +0 -1
  23. package/dist/commands/api/request.d.ts +0 -14
  24. package/dist/commands/api/request.js +0 -38
  25. package/dist/commands/api/request.js.map +0 -1
  26. package/dist/commands/api-key-mgmt.d.ts +0 -16
  27. package/dist/commands/api-key-mgmt.js +0 -96
  28. package/dist/commands/api-key-mgmt.js.map +0 -1
  29. package/dist/commands/audit-log.d.ts +0 -26
  30. package/dist/commands/audit-log.js +0 -155
  31. package/dist/commands/audit-log.js.map +0 -1
  32. package/dist/commands/auth-status.d.ts +0 -1
  33. package/dist/commands/auth-status.js +0 -57
  34. package/dist/commands/auth-status.js.map +0 -1
  35. package/dist/commands/claim.d.ts +0 -11
  36. package/dist/commands/claim.js +0 -143
  37. package/dist/commands/claim.js.map +0 -1
  38. package/dist/commands/config.d.ts +0 -3
  39. package/dist/commands/config.js +0 -54
  40. package/dist/commands/config.js.map +0 -1
  41. package/dist/commands/connection.d.ts +0 -13
  42. package/dist/commands/connection.js +0 -96
  43. package/dist/commands/connection.js.map +0 -1
  44. package/dist/commands/debug-sso.d.ts +0 -1
  45. package/dist/commands/debug-sso.js +0 -78
  46. package/dist/commands/debug-sso.js.map +0 -1
  47. package/dist/commands/debug-sync.d.ts +0 -1
  48. package/dist/commands/debug-sync.js +0 -102
  49. package/dist/commands/debug-sync.js.map +0 -1
  50. package/dist/commands/debug.d.ts +0 -28
  51. package/dist/commands/debug.js +0 -406
  52. package/dist/commands/debug.js.map +0 -1
  53. package/dist/commands/dev.d.ts +0 -22
  54. package/dist/commands/dev.js +0 -145
  55. package/dist/commands/dev.js.map +0 -1
  56. package/dist/commands/directory.d.ts +0 -27
  57. package/dist/commands/directory.js +0 -176
  58. package/dist/commands/directory.js.map +0 -1
  59. package/dist/commands/doctor.d.ts +0 -12
  60. package/dist/commands/doctor.js +0 -41
  61. package/dist/commands/doctor.js.map +0 -1
  62. package/dist/commands/emulate.d.ts +0 -7
  63. package/dist/commands/emulate.js +0 -69
  64. package/dist/commands/emulate.js.map +0 -1
  65. package/dist/commands/env.d.ts +0 -19
  66. package/dist/commands/env.js +0 -303
  67. package/dist/commands/env.js.map +0 -1
  68. package/dist/commands/event.d.ts +0 -9
  69. package/dist/commands/event.js +0 -43
  70. package/dist/commands/event.js.map +0 -1
  71. package/dist/commands/feature-flag.d.ts +0 -12
  72. package/dist/commands/feature-flag.js +0 -96
  73. package/dist/commands/feature-flag.js.map +0 -1
  74. package/dist/commands/install-skill.d.ts +0 -85
  75. package/dist/commands/install-skill.js +0 -332
  76. package/dist/commands/install-skill.js.map +0 -1
  77. package/dist/commands/install.d.ts +0 -6
  78. package/dist/commands/install.js +0 -51
  79. package/dist/commands/install.js.map +0 -1
  80. package/dist/commands/invitation.d.ts +0 -19
  81. package/dist/commands/invitation.js +0 -94
  82. package/dist/commands/invitation.js.map +0 -1
  83. package/dist/commands/list-skills.d.ts +0 -4
  84. package/dist/commands/list-skills.js +0 -52
  85. package/dist/commands/list-skills.js.map +0 -1
  86. package/dist/commands/login.d.ts +0 -32
  87. package/dist/commands/login.js +0 -239
  88. package/dist/commands/login.js.map +0 -1
  89. package/dist/commands/logout.d.ts +0 -1
  90. package/dist/commands/logout.js +0 -17
  91. package/dist/commands/logout.js.map +0 -1
  92. package/dist/commands/mcp.d.ts +0 -14
  93. package/dist/commands/mcp.js +0 -99
  94. package/dist/commands/mcp.js.map +0 -1
  95. package/dist/commands/membership.d.ts +0 -20
  96. package/dist/commands/membership.js +0 -129
  97. package/dist/commands/membership.js.map +0 -1
  98. package/dist/commands/migrations.d.ts +0 -2
  99. package/dist/commands/migrations.js +0 -50
  100. package/dist/commands/migrations.js.map +0 -1
  101. package/dist/commands/onboard-user.d.ts +0 -7
  102. package/dist/commands/onboard-user.js +0 -61
  103. package/dist/commands/onboard-user.js.map +0 -1
  104. package/dist/commands/org-domain.d.ts +0 -4
  105. package/dist/commands/org-domain.js +0 -45
  106. package/dist/commands/org-domain.js.map +0 -1
  107. package/dist/commands/organization.d.ts +0 -14
  108. package/dist/commands/organization.js +0 -103
  109. package/dist/commands/organization.js.map +0 -1
  110. package/dist/commands/permission.d.ts +0 -20
  111. package/dist/commands/permission.js +0 -93
  112. package/dist/commands/permission.js.map +0 -1
  113. package/dist/commands/portal.d.ts +0 -7
  114. package/dist/commands/portal.js +0 -26
  115. package/dist/commands/portal.js.map +0 -1
  116. package/dist/commands/role.d.ts +0 -17
  117. package/dist/commands/role.js +0 -122
  118. package/dist/commands/role.js.map +0 -1
  119. package/dist/commands/seed.d.ts +0 -6
  120. package/dist/commands/seed.js +0 -298
  121. package/dist/commands/seed.js.map +0 -1
  122. package/dist/commands/session.d.ts +0 -8
  123. package/dist/commands/session.js +0 -63
  124. package/dist/commands/session.js.map +0 -1
  125. package/dist/commands/setup-org.d.ts +0 -6
  126. package/dist/commands/setup-org.js +0 -99
  127. package/dist/commands/setup-org.js.map +0 -1
  128. package/dist/commands/setup.d.ts +0 -50
  129. package/dist/commands/setup.js +0 -237
  130. package/dist/commands/setup.js.map +0 -1
  131. package/dist/commands/telemetry.d.ts +0 -3
  132. package/dist/commands/telemetry.js +0 -88
  133. package/dist/commands/telemetry.js.map +0 -1
  134. package/dist/commands/uninstall-skill.d.ts +0 -11
  135. package/dist/commands/uninstall-skill.js +0 -117
  136. package/dist/commands/uninstall-skill.js.map +0 -1
  137. package/dist/commands/user.d.ts +0 -19
  138. package/dist/commands/user.js +0 -92
  139. package/dist/commands/user.js.map +0 -1
  140. package/dist/commands/vault-run.d.ts +0 -13
  141. package/dist/commands/vault-run.js +0 -195
  142. package/dist/commands/vault-run.js.map +0 -1
  143. package/dist/commands/vault.d.ts +0 -25
  144. package/dist/commands/vault.js +0 -153
  145. package/dist/commands/vault.js.map +0 -1
  146. package/dist/commands/verify-login.d.ts +0 -25
  147. package/dist/commands/verify-login.js +0 -158
  148. package/dist/commands/verify-login.js.map +0 -1
  149. package/dist/commands/webhook.d.ts +0 -3
  150. package/dist/commands/webhook.js +0 -92
  151. package/dist/commands/webhook.js.map +0 -1
  152. package/dist/craft-pre-release.sh +0 -10
  153. package/dist/dashboard/components/AnimatedLogo.d.ts +0 -8
  154. package/dist/dashboard/components/AnimatedLogo.js +0 -16
  155. package/dist/dashboard/components/AnimatedLogo.js.map +0 -1
  156. package/dist/dashboard/components/CompletionView.d.ts +0 -13
  157. package/dist/dashboard/components/CompletionView.js +0 -25
  158. package/dist/dashboard/components/CompletionView.js.map +0 -1
  159. package/dist/dashboard/components/ConfirmPrompt.d.ts +0 -9
  160. package/dist/dashboard/components/ConfirmPrompt.js +0 -25
  161. package/dist/dashboard/components/ConfirmPrompt.js.map +0 -1
  162. package/dist/dashboard/components/CredentialsForm.d.ts +0 -10
  163. package/dist/dashboard/components/CredentialsForm.js +0 -47
  164. package/dist/dashboard/components/CredentialsForm.js.map +0 -1
  165. package/dist/dashboard/components/Dashboard.d.ts +0 -3
  166. package/dist/dashboard/components/Dashboard.js +0 -100
  167. package/dist/dashboard/components/Dashboard.js.map +0 -1
  168. package/dist/dashboard/components/DashboardLayout.d.ts +0 -24
  169. package/dist/dashboard/components/DashboardLayout.js +0 -25
  170. package/dist/dashboard/components/DashboardLayout.js.map +0 -1
  171. package/dist/dashboard/components/DiffPanel.d.ts +0 -9
  172. package/dist/dashboard/components/DiffPanel.js +0 -136
  173. package/dist/dashboard/components/DiffPanel.js.map +0 -1
  174. package/dist/dashboard/components/InlinePrompt.d.ts +0 -8
  175. package/dist/dashboard/components/InlinePrompt.js +0 -19
  176. package/dist/dashboard/components/InlinePrompt.js.map +0 -1
  177. package/dist/dashboard/components/OutputPanel.d.ts +0 -10
  178. package/dist/dashboard/components/OutputPanel.js +0 -100
  179. package/dist/dashboard/components/OutputPanel.js.map +0 -1
  180. package/dist/dashboard/components/Panel.d.ts +0 -12
  181. package/dist/dashboard/components/Panel.js +0 -6
  182. package/dist/dashboard/components/Panel.js.map +0 -1
  183. package/dist/dashboard/components/TextInput.d.ts +0 -13
  184. package/dist/dashboard/components/TextInput.js +0 -57
  185. package/dist/dashboard/components/TextInput.js.map +0 -1
  186. package/dist/dashboard/components/WelcomeArt.d.ts +0 -2
  187. package/dist/dashboard/components/WelcomeArt.js +0 -9
  188. package/dist/dashboard/components/WelcomeArt.js.map +0 -1
  189. package/dist/dashboard/hooks/useAnimation.d.ts +0 -7
  190. package/dist/dashboard/hooks/useAnimation.js +0 -24
  191. package/dist/dashboard/hooks/useAnimation.js.map +0 -1
  192. package/dist/dashboard/hooks/useKeyboard.d.ts +0 -8
  193. package/dist/dashboard/hooks/useKeyboard.js +0 -18
  194. package/dist/dashboard/hooks/useKeyboard.js.map +0 -1
  195. package/dist/dashboard/hooks/useTerminalSize.d.ts +0 -8
  196. package/dist/dashboard/hooks/useTerminalSize.js +0 -23
  197. package/dist/dashboard/hooks/useTerminalSize.js.map +0 -1
  198. package/dist/dashboard/index.d.ts +0 -6
  199. package/dist/dashboard/index.js +0 -36
  200. package/dist/dashboard/index.js.map +0 -1
  201. package/dist/dashboard/lib/diff-utils.d.ts +0 -21
  202. package/dist/dashboard/lib/diff-utils.js +0 -271
  203. package/dist/dashboard/lib/diff-utils.js.map +0 -1
  204. package/dist/dashboard/lib/logo-frames.d.ts +0 -20
  205. package/dist/dashboard/lib/logo-frames.js +0 -109
  206. package/dist/dashboard/lib/logo-frames.js.map +0 -1
  207. package/dist/dashboard/lib/welcome-art.d.ts +0 -1
  208. package/dist/dashboard/lib/welcome-art.js +0 -5
  209. package/dist/dashboard/lib/welcome-art.js.map +0 -1
  210. package/dist/dashboard/types.d.ts +0 -5
  211. package/dist/dashboard/types.js +0 -2
  212. package/dist/dashboard/types.js.map +0 -1
  213. package/dist/doctor/agent-prompt.d.ts +0 -10
  214. package/dist/doctor/agent-prompt.js +0 -190
  215. package/dist/doctor/agent-prompt.js.map +0 -1
  216. package/dist/doctor/checks/ai-analysis.d.ts +0 -9
  217. package/dist/doctor/checks/ai-analysis.js +0 -124
  218. package/dist/doctor/checks/ai-analysis.js.map +0 -1
  219. package/dist/doctor/checks/auth-patterns.d.ts +0 -2
  220. package/dist/doctor/checks/auth-patterns.js +0 -569
  221. package/dist/doctor/checks/auth-patterns.js.map +0 -1
  222. package/dist/doctor/checks/connectivity.d.ts +0 -2
  223. package/dist/doctor/checks/connectivity.js +0 -35
  224. package/dist/doctor/checks/connectivity.js.map +0 -1
  225. package/dist/doctor/checks/dashboard.d.ts +0 -3
  226. package/dist/doctor/checks/dashboard.js +0 -123
  227. package/dist/doctor/checks/dashboard.js.map +0 -1
  228. package/dist/doctor/checks/environment.d.ts +0 -2
  229. package/dist/doctor/checks/environment.js +0 -86
  230. package/dist/doctor/checks/environment.js.map +0 -1
  231. package/dist/doctor/checks/framework.d.ts +0 -2
  232. package/dist/doctor/checks/framework.js +0 -94
  233. package/dist/doctor/checks/framework.js.map +0 -1
  234. package/dist/doctor/checks/host-execution.d.ts +0 -2
  235. package/dist/doctor/checks/host-execution.js +0 -21
  236. package/dist/doctor/checks/host-execution.js.map +0 -1
  237. package/dist/doctor/checks/language.d.ts +0 -6
  238. package/dist/doctor/checks/language.js +0 -104
  239. package/dist/doctor/checks/language.js.map +0 -1
  240. package/dist/doctor/checks/mcp.d.ts +0 -15
  241. package/dist/doctor/checks/mcp.js +0 -34
  242. package/dist/doctor/checks/mcp.js.map +0 -1
  243. package/dist/doctor/checks/runtime.d.ts +0 -2
  244. package/dist/doctor/checks/runtime.js +0 -20
  245. package/dist/doctor/checks/runtime.js.map +0 -1
  246. package/dist/doctor/checks/sdk.d.ts +0 -2
  247. package/dist/doctor/checks/sdk.js +0 -192
  248. package/dist/doctor/checks/sdk.js.map +0 -1
  249. package/dist/doctor/checks/skills.d.ts +0 -9
  250. package/dist/doctor/checks/skills.js +0 -84
  251. package/dist/doctor/checks/skills.js.map +0 -1
  252. package/dist/doctor/clipboard.d.ts +0 -1
  253. package/dist/doctor/clipboard.js +0 -43
  254. package/dist/doctor/clipboard.js.map +0 -1
  255. package/dist/doctor/index.d.ts +0 -26
  256. package/dist/doctor/index.js +0 -182
  257. package/dist/doctor/index.js.map +0 -1
  258. package/dist/doctor/issues.d.ts +0 -63
  259. package/dist/doctor/issues.js +0 -199
  260. package/dist/doctor/issues.js.map +0 -1
  261. package/dist/doctor/json-output.d.ts +0 -2
  262. package/dist/doctor/json-output.js +0 -4
  263. package/dist/doctor/json-output.js.map +0 -1
  264. package/dist/doctor/output.d.ts +0 -7
  265. package/dist/doctor/output.js +0 -289
  266. package/dist/doctor/output.js.map +0 -1
  267. package/dist/doctor/types.d.ts +0 -203
  268. package/dist/doctor/types.js +0 -2
  269. package/dist/doctor/types.js.map +0 -1
  270. package/dist/integrations/dotnet/index.d.ts +0 -8
  271. package/dist/integrations/dotnet/index.js +0 -170
  272. package/dist/integrations/dotnet/index.js.map +0 -1
  273. package/dist/integrations/elixir/index.d.ts +0 -8
  274. package/dist/integrations/elixir/index.js +0 -146
  275. package/dist/integrations/elixir/index.js.map +0 -1
  276. package/dist/integrations/go/index.d.ts +0 -11
  277. package/dist/integrations/go/index.js +0 -212
  278. package/dist/integrations/go/index.js.map +0 -1
  279. package/dist/integrations/kotlin/index.d.ts +0 -4
  280. package/dist/integrations/kotlin/index.js +0 -78
  281. package/dist/integrations/kotlin/index.js.map +0 -1
  282. package/dist/integrations/nextjs/index.d.ts +0 -4
  283. package/dist/integrations/nextjs/index.js +0 -93
  284. package/dist/integrations/nextjs/index.js.map +0 -1
  285. package/dist/integrations/nextjs/utils.d.ts +0 -8
  286. package/dist/integrations/nextjs/utils.js +0 -68
  287. package/dist/integrations/nextjs/utils.js.map +0 -1
  288. package/dist/integrations/node/index.d.ts +0 -4
  289. package/dist/integrations/node/index.js +0 -52
  290. package/dist/integrations/node/index.js.map +0 -1
  291. package/dist/integrations/php/index.d.ts +0 -4
  292. package/dist/integrations/php/index.js +0 -51
  293. package/dist/integrations/php/index.js.map +0 -1
  294. package/dist/integrations/php-laravel/index.d.ts +0 -4
  295. package/dist/integrations/php-laravel/index.js +0 -51
  296. package/dist/integrations/php-laravel/index.js.map +0 -1
  297. package/dist/integrations/python/index.d.ts +0 -9
  298. package/dist/integrations/python/index.js +0 -249
  299. package/dist/integrations/python/index.js.map +0 -1
  300. package/dist/integrations/react/index.d.ts +0 -4
  301. package/dist/integrations/react/index.js +0 -49
  302. package/dist/integrations/react/index.js.map +0 -1
  303. package/dist/integrations/react-router/index.d.ts +0 -4
  304. package/dist/integrations/react-router/index.js +0 -94
  305. package/dist/integrations/react-router/index.js.map +0 -1
  306. package/dist/integrations/react-router/utils.d.ts +0 -10
  307. package/dist/integrations/react-router/utils.js +0 -162
  308. package/dist/integrations/react-router/utils.js.map +0 -1
  309. package/dist/integrations/ruby/index.d.ts +0 -8
  310. package/dist/integrations/ruby/index.js +0 -137
  311. package/dist/integrations/ruby/index.js.map +0 -1
  312. package/dist/integrations/sveltekit/index.d.ts +0 -4
  313. package/dist/integrations/sveltekit/index.js +0 -50
  314. package/dist/integrations/sveltekit/index.js.map +0 -1
  315. package/dist/integrations/tanstack-start/index.d.ts +0 -4
  316. package/dist/integrations/tanstack-start/index.js +0 -51
  317. package/dist/integrations/tanstack-start/index.js.map +0 -1
  318. package/dist/integrations/vanilla-js/index.d.ts +0 -4
  319. package/dist/integrations/vanilla-js/index.js +0 -49
  320. package/dist/integrations/vanilla-js/index.js.map +0 -1
  321. package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.d.ts +0 -7
  322. package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js +0 -12
  323. package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js.map +0 -1
  324. package/dist/lib/adapters/cli-adapter.d.ts +0 -113
  325. package/dist/lib/adapters/cli-adapter.js +0 -641
  326. package/dist/lib/adapters/cli-adapter.js.map +0 -1
  327. package/dist/lib/adapters/dashboard-adapter.d.ts +0 -34
  328. package/dist/lib/adapters/dashboard-adapter.js +0 -121
  329. package/dist/lib/adapters/dashboard-adapter.js.map +0 -1
  330. package/dist/lib/adapters/headless-adapter.d.ts +0 -80
  331. package/dist/lib/adapters/headless-adapter.js +0 -347
  332. package/dist/lib/adapters/headless-adapter.js.map +0 -1
  333. package/dist/lib/adapters/index.d.ts +0 -4
  334. package/dist/lib/adapters/index.js +0 -4
  335. package/dist/lib/adapters/index.js.map +0 -1
  336. package/dist/lib/adapters/types.d.ts +0 -41
  337. package/dist/lib/adapters/types.js +0 -2
  338. package/dist/lib/adapters/types.js.map +0 -1
  339. package/dist/lib/agent-interface.d.ts +0 -84
  340. package/dist/lib/agent-interface.js +0 -840
  341. package/dist/lib/agent-interface.js.map +0 -1
  342. package/dist/lib/agent-runner.d.ts +0 -9
  343. package/dist/lib/agent-runner.js +0 -261
  344. package/dist/lib/agent-runner.js.map +0 -1
  345. package/dist/lib/ai-content.d.ts +0 -14
  346. package/dist/lib/ai-content.js +0 -131
  347. package/dist/lib/ai-content.js.map +0 -1
  348. package/dist/lib/api-error-handler.d.ts +0 -18
  349. package/dist/lib/api-error-handler.js +0 -76
  350. package/dist/lib/api-error-handler.js.map +0 -1
  351. package/dist/lib/api-key.d.ts +0 -14
  352. package/dist/lib/api-key.js +0 -37
  353. package/dist/lib/api-key.js.map +0 -1
  354. package/dist/lib/api.d.ts +0 -25
  355. package/dist/lib/api.js +0 -120
  356. package/dist/lib/api.js.map +0 -1
  357. package/dist/lib/background-refresh.d.ts +0 -29
  358. package/dist/lib/background-refresh.js +0 -95
  359. package/dist/lib/background-refresh.js.map +0 -1
  360. package/dist/lib/command-aliases.d.ts +0 -8
  361. package/dist/lib/command-aliases.js +0 -12
  362. package/dist/lib/command-aliases.js.map +0 -1
  363. package/dist/lib/completion-data.d.ts +0 -33
  364. package/dist/lib/completion-data.js +0 -33
  365. package/dist/lib/completion-data.js.map +0 -1
  366. package/dist/lib/config-store.d.ts +0 -63
  367. package/dist/lib/config-store.js +0 -293
  368. package/dist/lib/config-store.js.map +0 -1
  369. package/dist/lib/config.d.ts +0 -34
  370. package/dist/lib/config.js +0 -37
  371. package/dist/lib/config.js.map +0 -1
  372. package/dist/lib/constants.d.ts +0 -51
  373. package/dist/lib/constants.js +0 -50
  374. package/dist/lib/constants.js.map +0 -1
  375. package/dist/lib/credential-discovery.d.ts +0 -42
  376. package/dist/lib/credential-discovery.js +0 -100
  377. package/dist/lib/credential-discovery.js.map +0 -1
  378. package/dist/lib/credential-proxy.d.ts +0 -45
  379. package/dist/lib/credential-proxy.js +0 -364
  380. package/dist/lib/credential-proxy.js.map +0 -1
  381. package/dist/lib/credential-store.d.ts +0 -32
  382. package/dist/lib/credential-store.js +0 -236
  383. package/dist/lib/credential-store.js.map +0 -1
  384. package/dist/lib/credentials.d.ts +0 -13
  385. package/dist/lib/credentials.js +0 -34
  386. package/dist/lib/credentials.js.map +0 -1
  387. package/dist/lib/dev-command.d.ts +0 -26
  388. package/dist/lib/dev-command.js +0 -129
  389. package/dist/lib/dev-command.js.map +0 -1
  390. package/dist/lib/device-auth.d.ts +0 -48
  391. package/dist/lib/device-auth.js +0 -176
  392. package/dist/lib/device-auth.js.map +0 -1
  393. package/dist/lib/device-id.d.ts +0 -25
  394. package/dist/lib/device-id.js +0 -102
  395. package/dist/lib/device-id.js.map +0 -1
  396. package/dist/lib/ensure-auth.d.ts +0 -12
  397. package/dist/lib/ensure-auth.js +0 -111
  398. package/dist/lib/ensure-auth.js.map +0 -1
  399. package/dist/lib/env-writer.d.ts +0 -25
  400. package/dist/lib/env-writer.js +0 -90
  401. package/dist/lib/env-writer.js.map +0 -1
  402. package/dist/lib/events.d.ts +0 -248
  403. package/dist/lib/events.js +0 -19
  404. package/dist/lib/events.js.map +0 -1
  405. package/dist/lib/framework-config.d.ts +0 -133
  406. package/dist/lib/framework-config.js +0 -11
  407. package/dist/lib/framework-config.js.map +0 -1
  408. package/dist/lib/helper-functions.d.ts +0 -1
  409. package/dist/lib/helper-functions.js +0 -2
  410. package/dist/lib/helper-functions.js.map +0 -1
  411. package/dist/lib/host-probe.d.ts +0 -28
  412. package/dist/lib/host-probe.js +0 -154
  413. package/dist/lib/host-probe.js.map +0 -1
  414. package/dist/lib/installer-core.d.ts +0 -569
  415. package/dist/lib/installer-core.js +0 -1134
  416. package/dist/lib/installer-core.js.map +0 -1
  417. package/dist/lib/installer-core.types.d.ts +0 -162
  418. package/dist/lib/installer-core.types.js +0 -2
  419. package/dist/lib/installer-core.types.js.map +0 -1
  420. package/dist/lib/mcp-clients.d.ts +0 -45
  421. package/dist/lib/mcp-clients.js +0 -297
  422. package/dist/lib/mcp-clients.js.map +0 -1
  423. package/dist/lib/port-detection.d.ts +0 -7
  424. package/dist/lib/port-detection.js +0 -244
  425. package/dist/lib/port-detection.js.map +0 -1
  426. package/dist/lib/post-install.d.ts +0 -8
  427. package/dist/lib/post-install.js +0 -51
  428. package/dist/lib/post-install.js.map +0 -1
  429. package/dist/lib/preferences.d.ts +0 -143
  430. package/dist/lib/preferences.js +0 -227
  431. package/dist/lib/preferences.js.map +0 -1
  432. package/dist/lib/progress-tracker.d.ts +0 -22
  433. package/dist/lib/progress-tracker.js +0 -47
  434. package/dist/lib/progress-tracker.js.map +0 -1
  435. package/dist/lib/registry.d.ts +0 -42
  436. package/dist/lib/registry.js +0 -96
  437. package/dist/lib/registry.js.map +0 -1
  438. package/dist/lib/resolve-install-credentials.d.ts +0 -11
  439. package/dist/lib/resolve-install-credentials.js +0 -53
  440. package/dist/lib/resolve-install-credentials.js.map +0 -1
  441. package/dist/lib/run-with-core.d.ts +0 -7
  442. package/dist/lib/run-with-core.js +0 -559
  443. package/dist/lib/run-with-core.js.map +0 -1
  444. package/dist/lib/safe-tools.d.ts +0 -2
  445. package/dist/lib/safe-tools.js +0 -212
  446. package/dist/lib/safe-tools.js.map +0 -1
  447. package/dist/lib/scaffold/index.d.ts +0 -1
  448. package/dist/lib/scaffold/index.js +0 -2
  449. package/dist/lib/scaffold/index.js.map +0 -1
  450. package/dist/lib/scaffold/scaffold.d.ts +0 -66
  451. package/dist/lib/scaffold/scaffold.js +0 -156
  452. package/dist/lib/scaffold/scaffold.js.map +0 -1
  453. package/dist/lib/settings.d.ts +0 -60
  454. package/dist/lib/settings.js +0 -31
  455. package/dist/lib/settings.js.map +0 -1
  456. package/dist/lib/staging-api.d.ts +0 -22
  457. package/dist/lib/staging-api.js +0 -74
  458. package/dist/lib/staging-api.js.map +0 -1
  459. package/dist/lib/startup-notice-gate.d.ts +0 -21
  460. package/dist/lib/startup-notice-gate.js +0 -29
  461. package/dist/lib/startup-notice-gate.js.map +0 -1
  462. package/dist/lib/telemetry-notice.d.ts +0 -25
  463. package/dist/lib/telemetry-notice.js +0 -58
  464. package/dist/lib/telemetry-notice.js.map +0 -1
  465. package/dist/lib/token-refresh-client.d.ts +0 -23
  466. package/dist/lib/token-refresh-client.js +0 -89
  467. package/dist/lib/token-refresh-client.js.map +0 -1
  468. package/dist/lib/token-refresh.d.ts +0 -12
  469. package/dist/lib/token-refresh.js +0 -27
  470. package/dist/lib/token-refresh.js.map +0 -1
  471. package/dist/lib/unclaimed-env-api.d.ts +0 -42
  472. package/dist/lib/unclaimed-env-api.js +0 -139
  473. package/dist/lib/unclaimed-env-api.js.map +0 -1
  474. package/dist/lib/unclaimed-env-provision.d.ts +0 -24
  475. package/dist/lib/unclaimed-env-provision.js +0 -80
  476. package/dist/lib/unclaimed-env-provision.js.map +0 -1
  477. package/dist/lib/unclaimed-warning.d.ts +0 -15
  478. package/dist/lib/unclaimed-warning.js +0 -78
  479. package/dist/lib/unclaimed-warning.js.map +0 -1
  480. package/dist/lib/validation/build-validator.d.ts +0 -21
  481. package/dist/lib/validation/build-validator.js +0 -153
  482. package/dist/lib/validation/build-validator.js.map +0 -1
  483. package/dist/lib/validation/index.d.ts +0 -4
  484. package/dist/lib/validation/index.js +0 -4
  485. package/dist/lib/validation/index.js.map +0 -1
  486. package/dist/lib/validation/quick-checks.d.ts +0 -19
  487. package/dist/lib/validation/quick-checks.js +0 -192
  488. package/dist/lib/validation/quick-checks.js.map +0 -1
  489. package/dist/lib/validation/security-checks.d.ts +0 -35
  490. package/dist/lib/validation/security-checks.js +0 -106
  491. package/dist/lib/validation/security-checks.js.map +0 -1
  492. package/dist/lib/validation/types.d.ts +0 -56
  493. package/dist/lib/validation/types.js +0 -2
  494. package/dist/lib/validation/types.js.map +0 -1
  495. package/dist/lib/validation/validator.d.ts +0 -13
  496. package/dist/lib/validation/validator.js +0 -711
  497. package/dist/lib/validation/validator.js.map +0 -1
  498. package/dist/lib/version-check.d.ts +0 -6
  499. package/dist/lib/version-check.js +0 -46
  500. package/dist/lib/version-check.js.map +0 -1
  501. package/dist/lib/workos-api.d.ts +0 -30
  502. package/dist/lib/workos-api.js +0 -69
  503. package/dist/lib/workos-api.js.map +0 -1
  504. package/dist/lib/workos-client.d.ts +0 -58
  505. package/dist/lib/workos-client.js +0 -140
  506. package/dist/lib/workos-client.js.map +0 -1
  507. package/dist/lib/workos-management.d.ts +0 -32
  508. package/dist/lib/workos-management.js +0 -149
  509. package/dist/lib/workos-management.js.map +0 -1
  510. package/dist/nextjs/nextjs-installer-agent.d.ts +0 -5
  511. package/dist/nextjs/nextjs-installer-agent.js +0 -6
  512. package/dist/nextjs/nextjs-installer-agent.js.map +0 -1
  513. package/dist/nextjs/utils.d.ts +0 -4
  514. package/dist/nextjs/utils.js +0 -5
  515. package/dist/nextjs/utils.js.map +0 -1
  516. package/dist/react/react-installer-agent.d.ts +0 -4
  517. package/dist/react/react-installer-agent.js +0 -5
  518. package/dist/react/react-installer-agent.js.map +0 -1
  519. package/dist/react-router/react-router-installer-agent.d.ts +0 -4
  520. package/dist/react-router/react-router-installer-agent.js +0 -5
  521. package/dist/react-router/react-router-installer-agent.js.map +0 -1
  522. package/dist/react-router/utils.d.ts +0 -4
  523. package/dist/react-router/utils.js +0 -5
  524. package/dist/react-router/utils.js.map +0 -1
  525. package/dist/run.d.ts +0 -33
  526. package/dist/run.js +0 -58
  527. package/dist/run.js.map +0 -1
  528. package/dist/smoke-test.ts +0 -881
  529. package/dist/steps/add-or-update-environment-variables.d.ts +0 -10
  530. package/dist/steps/add-or-update-environment-variables.js +0 -155
  531. package/dist/steps/add-or-update-environment-variables.js.map +0 -1
  532. package/dist/steps/index.d.ts +0 -3
  533. package/dist/steps/index.js +0 -4
  534. package/dist/steps/index.js.map +0 -1
  535. package/dist/steps/run-prettier.d.ts +0 -5
  536. package/dist/steps/run-prettier.js +0 -50
  537. package/dist/steps/run-prettier.js.map +0 -1
  538. package/dist/steps/upload-environment-variables/EnvironmentProvider.d.ts +0 -8
  539. package/dist/steps/upload-environment-variables/EnvironmentProvider.js +0 -7
  540. package/dist/steps/upload-environment-variables/EnvironmentProvider.js.map +0 -1
  541. package/dist/steps/upload-environment-variables/index.d.ts +0 -6
  542. package/dist/steps/upload-environment-variables/index.js +0 -69
  543. package/dist/steps/upload-environment-variables/index.js.map +0 -1
  544. package/dist/steps/upload-environment-variables/providers/vercel.d.ts +0 -14
  545. package/dist/steps/upload-environment-variables/providers/vercel.js +0 -107
  546. package/dist/steps/upload-environment-variables/providers/vercel.js.map +0 -1
  547. package/dist/tanstack-start/tanstack-start-installer-agent.d.ts +0 -4
  548. package/dist/tanstack-start/tanstack-start-installer-agent.js +0 -5
  549. package/dist/tanstack-start/tanstack-start-installer-agent.js.map +0 -1
  550. package/dist/telemetry.d.ts +0 -2
  551. package/dist/telemetry.js +0 -29
  552. package/dist/telemetry.js.map +0 -1
  553. package/dist/test/force-insecure-storage.d.ts +0 -1
  554. package/dist/test/force-insecure-storage.js +0 -9
  555. package/dist/test/force-insecure-storage.js.map +0 -1
  556. package/dist/test/setup.d.ts +0 -1
  557. package/dist/test/setup.js +0 -38
  558. package/dist/test/setup.js.map +0 -1
  559. package/dist/utils/analytics.d.ts +0 -66
  560. package/dist/utils/analytics.js +0 -330
  561. package/dist/utils/analytics.js.map +0 -1
  562. package/dist/utils/bash.d.ts +0 -2
  563. package/dist/utils/bash.js +0 -17
  564. package/dist/utils/bash.js.map +0 -1
  565. package/dist/utils/box.d.ts +0 -9
  566. package/dist/utils/box.js +0 -15
  567. package/dist/utils/box.js.map +0 -1
  568. package/dist/utils/cli-exit.d.ts +0 -15
  569. package/dist/utils/cli-exit.js +0 -11
  570. package/dist/utils/cli-exit.js.map +0 -1
  571. package/dist/utils/cli-symbols.d.ts +0 -44
  572. package/dist/utils/cli-symbols.js +0 -58
  573. package/dist/utils/cli-symbols.js.map +0 -1
  574. package/dist/utils/command-invocation.d.ts +0 -10
  575. package/dist/utils/command-invocation.js +0 -26
  576. package/dist/utils/command-invocation.js.map +0 -1
  577. package/dist/utils/command-telemetry.d.ts +0 -17
  578. package/dist/utils/command-telemetry.js +0 -67
  579. package/dist/utils/command-telemetry.js.map +0 -1
  580. package/dist/utils/crash-reporter.d.ts +0 -13
  581. package/dist/utils/crash-reporter.js +0 -91
  582. package/dist/utils/crash-reporter.js.map +0 -1
  583. package/dist/utils/debug.d.ts +0 -9
  584. package/dist/utils/debug.js +0 -105
  585. package/dist/utils/debug.js.map +0 -1
  586. package/dist/utils/env-parser.d.ts +0 -5
  587. package/dist/utils/env-parser.js +0 -18
  588. package/dist/utils/env-parser.js.map +0 -1
  589. package/dist/utils/environment.d.ts +0 -10
  590. package/dist/utils/environment.js +0 -69
  591. package/dist/utils/environment.js.map +0 -1
  592. package/dist/utils/errors.d.ts +0 -3
  593. package/dist/utils/errors.js +0 -7
  594. package/dist/utils/errors.js.map +0 -1
  595. package/dist/utils/exec-file.d.ts +0 -15
  596. package/dist/utils/exec-file.js +0 -39
  597. package/dist/utils/exec-file.js.map +0 -1
  598. package/dist/utils/exit-codes.d.ts +0 -31
  599. package/dist/utils/exit-codes.js +0 -69
  600. package/dist/utils/exit-codes.js.map +0 -1
  601. package/dist/utils/git-utils.d.ts +0 -23
  602. package/dist/utils/git-utils.js +0 -86
  603. package/dist/utils/git-utils.js.map +0 -1
  604. package/dist/utils/help-json.d.ts +0 -58
  605. package/dist/utils/help-json.js +0 -1577
  606. package/dist/utils/help-json.js.map +0 -1
  607. package/dist/utils/interaction-mode.d.ts +0 -25
  608. package/dist/utils/interaction-mode.js +0 -99
  609. package/dist/utils/interaction-mode.js.map +0 -1
  610. package/dist/utils/lock-art.d.ts +0 -4
  611. package/dist/utils/lock-art.js +0 -73
  612. package/dist/utils/lock-art.js.map +0 -1
  613. package/dist/utils/logging.d.ts +0 -9
  614. package/dist/utils/logging.js +0 -36
  615. package/dist/utils/logging.js.map +0 -1
  616. package/dist/utils/ndjson.d.ts +0 -16
  617. package/dist/utils/ndjson.js +0 -18
  618. package/dist/utils/ndjson.js.map +0 -1
  619. package/dist/utils/output.d.ts +0 -60
  620. package/dist/utils/output.js +0 -124
  621. package/dist/utils/output.js.map +0 -1
  622. package/dist/utils/package-json.d.ts +0 -26
  623. package/dist/utils/package-json.js +0 -32
  624. package/dist/utils/package-json.js.map +0 -1
  625. package/dist/utils/package-manager.d.ts +0 -21
  626. package/dist/utils/package-manager.js +0 -166
  627. package/dist/utils/package-manager.js.map +0 -1
  628. package/dist/utils/paths.d.ts +0 -5
  629. package/dist/utils/paths.js +0 -18
  630. package/dist/utils/paths.js.map +0 -1
  631. package/dist/utils/platform.d.ts +0 -8
  632. package/dist/utils/platform.js +0 -7
  633. package/dist/utils/platform.js.map +0 -1
  634. package/dist/utils/recovery-hints.d.ts +0 -42
  635. package/dist/utils/recovery-hints.js +0 -92
  636. package/dist/utils/recovery-hints.js.map +0 -1
  637. package/dist/utils/redact.d.ts +0 -5
  638. package/dist/utils/redact.js +0 -29
  639. package/dist/utils/redact.js.map +0 -1
  640. package/dist/utils/register-subcommand.d.ts +0 -10
  641. package/dist/utils/register-subcommand.js +0 -33
  642. package/dist/utils/register-subcommand.js.map +0 -1
  643. package/dist/utils/semver.d.ts +0 -10
  644. package/dist/utils/semver.js +0 -43
  645. package/dist/utils/semver.js.map +0 -1
  646. package/dist/utils/string.d.ts +0 -1
  647. package/dist/utils/string.js +0 -6
  648. package/dist/utils/string.js.map +0 -1
  649. package/dist/utils/summary-box.d.ts +0 -25
  650. package/dist/utils/summary-box.js +0 -211
  651. package/dist/utils/summary-box.js.map +0 -1
  652. package/dist/utils/table.d.ts +0 -5
  653. package/dist/utils/table.js +0 -18
  654. package/dist/utils/table.js.map +0 -1
  655. package/dist/utils/telemetry-client.d.ts +0 -43
  656. package/dist/utils/telemetry-client.js +0 -171
  657. package/dist/utils/telemetry-client.js.map +0 -1
  658. package/dist/utils/telemetry-store-forward.d.ts +0 -11
  659. package/dist/utils/telemetry-store-forward.js +0 -94
  660. package/dist/utils/telemetry-store-forward.js.map +0 -1
  661. package/dist/utils/telemetry-types.d.ts +0 -100
  662. package/dist/utils/telemetry-types.js +0 -6
  663. package/dist/utils/telemetry-types.js.map +0 -1
  664. package/dist/utils/types.d.ts +0 -123
  665. package/dist/utils/types.js +0 -2
  666. package/dist/utils/types.js.map +0 -1
  667. package/dist/utils/ui-utils.d.ts +0 -97
  668. package/dist/utils/ui-utils.js +0 -449
  669. package/dist/utils/ui-utils.js.map +0 -1
  670. package/dist/utils/ui.d.ts +0 -148
  671. package/dist/utils/ui.js +0 -368
  672. package/dist/utils/ui.js.map +0 -1
  673. package/dist/utils/urls.d.ts +0 -13
  674. package/dist/utils/urls.js +0 -14
  675. package/dist/utils/urls.js.map +0 -1
  676. package/dist/utils/vendor/is-unicorn-supported.d.ts +0 -1
  677. package/dist/utils/vendor/is-unicorn-supported.js +0 -21
  678. package/dist/utils/vendor/is-unicorn-supported.js.map +0 -1
  679. package/dist/vanilla-js/vanilla-js-installer-agent.d.ts +0 -4
  680. package/dist/vanilla-js/vanilla-js-installer-agent.js +0 -5
  681. package/dist/vanilla-js/vanilla-js-installer-agent.js.map +0 -1
@@ -1,51 +0,0 @@
1
- import { execFileSync } from 'node:child_process';
2
- import { writeFileSync, unlinkSync } from 'node:fs';
3
- import { tmpdir } from 'node:os';
4
- import { join } from 'node:path';
5
- import { getDefaultBranch, getUncommittedFiles } from '../utils/git-utils.js';
6
- export function detectChanges() {
7
- const files = getUncommittedFiles();
8
- return { hasChanges: files.length > 0, files };
9
- }
10
- export function stageAndCommit(message, cwd) {
11
- execFileSync('git', ['add', '-A'], { cwd, stdio: 'ignore' });
12
- execFileSync('git', ['commit', '-m', message], { cwd, stdio: 'ignore' });
13
- }
14
- export function pushBranch(cwd) {
15
- execFileSync('git', ['push', '-u', 'origin', 'HEAD'], { cwd, stdio: 'pipe' });
16
- }
17
- export function createPullRequest(title, body, cwd) {
18
- const baseBranch = getDefaultBranch();
19
- const tmpFile = join(tmpdir(), `pr-body-${Date.now()}.md`);
20
- writeFileSync(tmpFile, body, 'utf-8');
21
- try {
22
- return execFileSync('gh', ['pr', 'create', '--title', title, '--body-file', tmpFile, '--base', baseBranch], {
23
- cwd,
24
- stdio: ['ignore', 'pipe', 'pipe'],
25
- })
26
- .toString()
27
- .trim();
28
- }
29
- finally {
30
- try {
31
- unlinkSync(tmpFile);
32
- }
33
- catch { }
34
- }
35
- }
36
- export function getManualPrInstructions(branch) {
37
- const baseBranch = getDefaultBranch();
38
- return `
39
- To create a PR manually:
40
-
41
- 1. Push your branch:
42
- git push -u origin ${branch}
43
-
44
- 2. Create PR via GitHub:
45
- https://github.com/<owner>/<repo>/compare/${baseBranch}...${branch}
46
-
47
- Or install the GitHub CLI:
48
- https://cli.github.com/
49
- `.trim();
50
- }
51
- //# sourceMappingURL=post-install.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post-install.js","sourceRoot":"","sources":["../../src/lib/post-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,MAAM,UAAU,aAAa;IAC3B,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,GAAW;IACzD,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7D,YAAY,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,IAAY,EAAE,GAAW;IACxE,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,WAAW,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3D,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE;YAC1G,GAAG;YACH,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC;aACC,QAAQ,EAAE;aACV,IAAI,EAAE,CAAC;IACZ,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,UAAU,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;IACtC,OAAO;;;;wBAIe,MAAM;;;+CAGiB,UAAU,MAAM,MAAM;;;;CAIpE,CAAC,IAAI,EAAE,CAAC;AACT,CAAC","sourcesContent":["import { execFileSync } from 'node:child_process';\nimport { writeFileSync, unlinkSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { getDefaultBranch, getUncommittedFiles } from '../utils/git-utils.js';\n\nexport function detectChanges(): { hasChanges: boolean; files: string[] } {\n const files = getUncommittedFiles();\n return { hasChanges: files.length > 0, files };\n}\n\nexport function stageAndCommit(message: string, cwd: string): void {\n execFileSync('git', ['add', '-A'], { cwd, stdio: 'ignore' });\n execFileSync('git', ['commit', '-m', message], { cwd, stdio: 'ignore' });\n}\n\nexport function pushBranch(cwd: string): void {\n execFileSync('git', ['push', '-u', 'origin', 'HEAD'], { cwd, stdio: 'pipe' });\n}\n\nexport function createPullRequest(title: string, body: string, cwd: string): string {\n const baseBranch = getDefaultBranch();\n const tmpFile = join(tmpdir(), `pr-body-${Date.now()}.md`);\n writeFileSync(tmpFile, body, 'utf-8');\n\n try {\n return execFileSync('gh', ['pr', 'create', '--title', title, '--body-file', tmpFile, '--base', baseBranch], {\n cwd,\n stdio: ['ignore', 'pipe', 'pipe'],\n })\n .toString()\n .trim();\n } finally {\n try {\n unlinkSync(tmpFile);\n } catch {}\n }\n}\n\nexport function getManualPrInstructions(branch: string): string {\n const baseBranch = getDefaultBranch();\n return `\nTo create a PR manually:\n\n1. Push your branch:\n git push -u origin ${branch}\n\n2. Create PR via GitHub:\n https://github.com/<owner>/<repo>/compare/${baseBranch}...${branch}\n\nOr install the GitHub CLI:\n https://cli.github.com/\n`.trim();\n}\n"]}
@@ -1,143 +0,0 @@
1
- /**
2
- * Plain CLI preferences store.
3
- *
4
- * Stored at ~/.workos/preferences.json as plain JSON. These are NOT secrets —
5
- * knowing that someone opted out of telemetry leaks nothing — so this
6
- * deliberately avoids the keyring abstraction (config-store.ts) to prevent a
7
- * non-secret write from ever triggering the insecure-fallback security warning.
8
- *
9
- * Mirrors the structural pattern of device-id.ts: a synchronous accessor backed
10
- * by a cache, an async prewarm that populates that cache off the blocking-fs
11
- * path, and a never-throws contract on every read/parse so a corrupt file can
12
- * never break a command.
13
- */
14
- export interface CliPreferences {
15
- telemetry?: {
16
- /** true => the user explicitly opted out of telemetry. */
17
- optedOut?: boolean;
18
- /** ISO timestamp the first-run notice was shown — written in Phase 2 only. */
19
- noticeShownAt?: string;
20
- };
21
- /**
22
- * Legacy MCP-install onboarding state. The MCP offer folded into `setup` (see
23
- * commands/setup.ts); these fields are retained for back-compat so a user who
24
- * declined the old standalone MCP offer is still treated as setup-declined
25
- * (see isSetupDeclined). Kept in this plain-JSON store alongside telemetry.
26
- */
27
- mcp?: {
28
- /**
29
- * true => the user explicitly declined an automatic MCP install offer. The
30
- * decline is absolute: no automatic surface (prompt or banner) asks again;
31
- * `workos mcp install` stays available manually.
32
- */
33
- promptDeclined?: boolean;
34
- /** ISO timestamp the one-time MCP banner was shown. */
35
- bannerShownAt?: string;
36
- };
37
- /**
38
- * Consolidated agent-setup onboarding state (skills + MCP). Owned by
39
- * commands/setup.ts. `declined` is absolute for the automatic surfaces
40
- * (post-login / post-install); `workos setup` stays available manually.
41
- * Legacy `mcp.promptDeclined` is treated as an implicit setup-decline on read
42
- * (see isSetupDeclined) so users who already declined MCP are never re-asked.
43
- */
44
- setup?: {
45
- declined?: boolean;
46
- /** ISO timestamp the user completed a setup run. */
47
- completedAt?: string;
48
- };
49
- }
50
- /** Effective source of the resolved telemetry-enabled decision. */
51
- export type TelemetrySource = 'env' | 'preference' | 'default';
52
- export declare function getPreferencesPath(): string;
53
- /**
54
- * Asynchronously load preferences and warm the cache the synchronous
55
- * getPreferences() reads. Memoized: the first call performs the IO, concurrent
56
- * and later callers await the same promise. Prewarming this at startup keeps
57
- * the synchronous telemetry path off blocking fs IO. Never rejects.
58
- */
59
- export declare function loadPreferences(): Promise<CliPreferences>;
60
- /**
61
- * Synchronous accessor. Returns the prewarmed value when loadPreferences() has
62
- * run; otherwise performs a one-time synchronous read of the same file. On any
63
- * IO/parse failure returns {} (telemetry stays at its default-on state). Never
64
- * throws.
65
- */
66
- export declare function getPreferences(): CliPreferences;
67
- /**
68
- * Read-modify-write the on-disk preferences, merging `next` over the current
69
- * persisted value so future fields are never clobbered, then update the cache.
70
- * Throws on write failure so callers on the command path (opt-out/opt-in) can
71
- * surface a clear error — the read path swallows, the write path does not.
72
- */
73
- export declare function savePreferences(next: CliPreferences): void;
74
- /** Whether the user has explicitly opted out via the saved preference. */
75
- export declare function isTelemetryOptedOut(): boolean;
76
- /** Persist the opt-out flag. Throws on write failure (see savePreferences). */
77
- export declare function setTelemetryOptedOut(value: boolean): void;
78
- /** Whether the first-run telemetry notice has already been shown (ever). */
79
- export declare function isNoticeShown(): boolean;
80
- /**
81
- * Persist the first-run notice as shown, stamping the current time. Uses the
82
- * read-modify-write savePreferences so it never clobbers the optedOut flag.
83
- * Throws on write failure (see savePreferences) — the caller in
84
- * telemetry-notice.ts swallows it so a read-only FS never blocks a command.
85
- */
86
- export declare function markNoticeShown(): void;
87
- /**
88
- * Whether an automatic setup offer should be suppressed. Absolute once the user
89
- * declines. Treats the legacy `mcp.promptDeclined` flag as an implicit decline
90
- * so anyone who declined the old MCP offer is never re-prompted by the new flow.
91
- */
92
- export declare function isSetupDeclined(): boolean;
93
- /** Whether the user has completed a setup run (ever). */
94
- export declare function isSetupCompleted(): boolean;
95
- /** Persist an explicit setup decline. Throws on write failure (see savePreferences). */
96
- export declare function recordSetupDeclined(): void;
97
- /** Persist a completed setup run, stamping the current time. */
98
- export declare function recordSetupCompleted(): void;
99
- /** Clear the setup decline (new + legacy) so automatic offers resume. For `workos setup --reset`. */
100
- export declare function clearSetupDecline(): void;
101
- /**
102
- * Tri-state env override for telemetry.
103
- *
104
- * Only the explicit strings 'true' / 'false' count as an override. Any other
105
- * value — including unset or garbage like '1' — returns undefined and falls
106
- * through to the saved preference.
107
- *
108
- * This is a deliberate, documented change from the old `WORKOS_TELEMETRY !==
109
- * 'false'` behaviour: previously `WORKOS_TELEMETRY=1` forced telemetry on even
110
- * for opted-out users; now an opt-out is respected unless the env var
111
- * explicitly says 'true'.
112
- */
113
- export declare function envTelemetryOverride(): boolean | undefined;
114
- /**
115
- * Effective telemetry-enabled decision.
116
- *
117
- * Resolution order:
118
- * 1. envTelemetryOverride() if defined — env wins in BOTH directions.
119
- * 2. otherwise !isTelemetryOptedOut() — default-on unless explicitly opted out.
120
- */
121
- export declare function isTelemetryEnabled(): boolean;
122
- /**
123
- * Which signal produced the effective telemetry decision. Mirrors the
124
- * precedence in isTelemetryEnabled() so the `telemetry status` command and the
125
- * resolver can never drift.
126
- *
127
- * Note: an explicit opt-in (optedOut === false) reads as 'default', not
128
- * 'preference' — its outcome is identical to a fresh install, and the resolver
129
- * only treats optedOut === true as a non-default signal, so reporting
130
- * 'preference' here would imply a behavioral difference that does not exist.
131
- */
132
- export declare function getTelemetrySource(): TelemetrySource;
133
- /**
134
- * Delete the preferences file, returning telemetry to its fresh-install state
135
- * (opted-in, first-run notice unseen). Used by `debug reset` to wipe stored CLI
136
- * state alongside credentials and config. No-op if the file does not exist;
137
- * throws on a real delete failure (e.g. permission denied) so the caller can
138
- * surface it, mirroring clearConfig/clearCredentials. Resets the in-memory
139
- * cache so subsequent reads in this process reflect the cleared state.
140
- */
141
- export declare function clearPreferences(): void;
142
- /** Test seam — resets the in-memory cache between test cases. */
143
- export declare function __resetPreferencesCache(): void;
@@ -1,227 +0,0 @@
1
- /**
2
- * Plain CLI preferences store.
3
- *
4
- * Stored at ~/.workos/preferences.json as plain JSON. These are NOT secrets —
5
- * knowing that someone opted out of telemetry leaks nothing — so this
6
- * deliberately avoids the keyring abstraction (config-store.ts) to prevent a
7
- * non-secret write from ever triggering the insecure-fallback security warning.
8
- *
9
- * Mirrors the structural pattern of device-id.ts: a synchronous accessor backed
10
- * by a cache, an async prewarm that populates that cache off the blocking-fs
11
- * path, and a never-throws contract on every read/parse so a corrupt file can
12
- * never break a command.
13
- */
14
- import fs from 'node:fs';
15
- import { readFile } from 'node:fs/promises';
16
- import path from 'node:path';
17
- import os from 'node:os';
18
- let cached;
19
- let pending;
20
- export function getPreferencesPath() {
21
- return path.join(os.homedir(), '.workos', 'preferences.json');
22
- }
23
- function parsePreferences(raw) {
24
- try {
25
- const value = JSON.parse(raw);
26
- // Defend against a file that parses to a non-object (e.g. `"true"`, `42`).
27
- if (value && typeof value === 'object' && !Array.isArray(value)) {
28
- return value;
29
- }
30
- }
31
- catch {
32
- // Corrupt JSON — fall through to empty preferences. A later savePreferences
33
- // overwrites it cleanly; we never auto-delete.
34
- }
35
- return {};
36
- }
37
- /**
38
- * Asynchronously load preferences and warm the cache the synchronous
39
- * getPreferences() reads. Memoized: the first call performs the IO, concurrent
40
- * and later callers await the same promise. Prewarming this at startup keeps
41
- * the synchronous telemetry path off blocking fs IO. Never rejects.
42
- */
43
- export function loadPreferences() {
44
- if (cached)
45
- return Promise.resolve(cached);
46
- if (pending)
47
- return pending;
48
- pending = (async () => {
49
- try {
50
- const raw = await readFile(getPreferencesPath(), 'utf8');
51
- cached = parsePreferences(raw);
52
- }
53
- catch {
54
- // Missing/unreadable file — treat as no preferences set.
55
- cached = {};
56
- }
57
- finally {
58
- pending = undefined;
59
- }
60
- return cached;
61
- })();
62
- return pending;
63
- }
64
- /**
65
- * Synchronous accessor. Returns the prewarmed value when loadPreferences() has
66
- * run; otherwise performs a one-time synchronous read of the same file. On any
67
- * IO/parse failure returns {} (telemetry stays at its default-on state). Never
68
- * throws.
69
- */
70
- export function getPreferences() {
71
- if (cached)
72
- return cached;
73
- try {
74
- const raw = fs.readFileSync(getPreferencesPath(), 'utf8');
75
- cached = parsePreferences(raw);
76
- }
77
- catch {
78
- // Missing/unreadable/corrupt — telemetry stays at its default-on state.
79
- cached = {};
80
- }
81
- return cached;
82
- }
83
- /**
84
- * Read-modify-write the on-disk preferences, merging `next` over the current
85
- * persisted value so future fields are never clobbered, then update the cache.
86
- * Throws on write failure so callers on the command path (opt-out/opt-in) can
87
- * surface a clear error — the read path swallows, the write path does not.
88
- */
89
- export function savePreferences(next) {
90
- const filePath = getPreferencesPath();
91
- // Read-modify-write over the CURRENT on-disk value (not the cache) so a field
92
- // written by another process / a future phase is preserved.
93
- let current = {};
94
- try {
95
- current = parsePreferences(fs.readFileSync(filePath, 'utf8'));
96
- }
97
- catch {
98
- // No existing file (or unreadable) — start from empty.
99
- }
100
- // Shallow-merge each known nested group (one level) so writing one field
101
- // (e.g. setup.completedAt) never clobbers a sibling written at a different
102
- // time (e.g. setup.declined). A new nested group is one entry in this list.
103
- const merged = { ...current, ...next };
104
- for (const key of ['telemetry', 'mcp', 'setup']) {
105
- if (current[key] || next[key]) {
106
- Object.assign(merged, { [key]: { ...current[key], ...next[key] } });
107
- }
108
- }
109
- fs.mkdirSync(path.dirname(filePath), { recursive: true, mode: 0o700 });
110
- fs.writeFileSync(filePath, JSON.stringify(merged), { encoding: 'utf8', mode: 0o600 });
111
- cached = merged;
112
- }
113
- /** Whether the user has explicitly opted out via the saved preference. */
114
- export function isTelemetryOptedOut() {
115
- return getPreferences().telemetry?.optedOut === true;
116
- }
117
- /** Persist the opt-out flag. Throws on write failure (see savePreferences). */
118
- export function setTelemetryOptedOut(value) {
119
- savePreferences({ telemetry: { optedOut: value } });
120
- }
121
- /** Whether the first-run telemetry notice has already been shown (ever). */
122
- export function isNoticeShown() {
123
- return !!getPreferences().telemetry?.noticeShownAt;
124
- }
125
- /**
126
- * Persist the first-run notice as shown, stamping the current time. Uses the
127
- * read-modify-write savePreferences so it never clobbers the optedOut flag.
128
- * Throws on write failure (see savePreferences) — the caller in
129
- * telemetry-notice.ts swallows it so a read-only FS never blocks a command.
130
- */
131
- export function markNoticeShown() {
132
- savePreferences({ telemetry: { noticeShownAt: new Date().toISOString() } });
133
- }
134
- /**
135
- * Whether an automatic setup offer should be suppressed. Absolute once the user
136
- * declines. Treats the legacy `mcp.promptDeclined` flag as an implicit decline
137
- * so anyone who declined the old MCP offer is never re-prompted by the new flow.
138
- */
139
- export function isSetupDeclined() {
140
- const prefs = getPreferences();
141
- return prefs.setup?.declined === true || prefs.mcp?.promptDeclined === true;
142
- }
143
- /** Whether the user has completed a setup run (ever). */
144
- export function isSetupCompleted() {
145
- return !!getPreferences().setup?.completedAt;
146
- }
147
- /** Persist an explicit setup decline. Throws on write failure (see savePreferences). */
148
- export function recordSetupDeclined() {
149
- savePreferences({ setup: { declined: true } });
150
- }
151
- /** Persist a completed setup run, stamping the current time. */
152
- export function recordSetupCompleted() {
153
- savePreferences({ setup: { completedAt: new Date().toISOString() } });
154
- }
155
- /** Clear the setup decline (new + legacy) so automatic offers resume. For `workos setup --reset`. */
156
- export function clearSetupDecline() {
157
- savePreferences({ setup: { declined: false }, mcp: { promptDeclined: false } });
158
- }
159
- /**
160
- * Tri-state env override for telemetry.
161
- *
162
- * Only the explicit strings 'true' / 'false' count as an override. Any other
163
- * value — including unset or garbage like '1' — returns undefined and falls
164
- * through to the saved preference.
165
- *
166
- * This is a deliberate, documented change from the old `WORKOS_TELEMETRY !==
167
- * 'false'` behaviour: previously `WORKOS_TELEMETRY=1` forced telemetry on even
168
- * for opted-out users; now an opt-out is respected unless the env var
169
- * explicitly says 'true'.
170
- */
171
- export function envTelemetryOverride() {
172
- const value = process.env.WORKOS_TELEMETRY;
173
- if (value === 'true')
174
- return true;
175
- if (value === 'false')
176
- return false;
177
- return undefined;
178
- }
179
- /**
180
- * Effective telemetry-enabled decision.
181
- *
182
- * Resolution order:
183
- * 1. envTelemetryOverride() if defined — env wins in BOTH directions.
184
- * 2. otherwise !isTelemetryOptedOut() — default-on unless explicitly opted out.
185
- */
186
- export function isTelemetryEnabled() {
187
- const override = envTelemetryOverride();
188
- if (override !== undefined)
189
- return override;
190
- return !isTelemetryOptedOut();
191
- }
192
- /**
193
- * Which signal produced the effective telemetry decision. Mirrors the
194
- * precedence in isTelemetryEnabled() so the `telemetry status` command and the
195
- * resolver can never drift.
196
- *
197
- * Note: an explicit opt-in (optedOut === false) reads as 'default', not
198
- * 'preference' — its outcome is identical to a fresh install, and the resolver
199
- * only treats optedOut === true as a non-default signal, so reporting
200
- * 'preference' here would imply a behavioral difference that does not exist.
201
- */
202
- export function getTelemetrySource() {
203
- if (envTelemetryOverride() !== undefined)
204
- return 'env';
205
- if (isTelemetryOptedOut())
206
- return 'preference';
207
- return 'default';
208
- }
209
- /**
210
- * Delete the preferences file, returning telemetry to its fresh-install state
211
- * (opted-in, first-run notice unseen). Used by `debug reset` to wipe stored CLI
212
- * state alongside credentials and config. No-op if the file does not exist;
213
- * throws on a real delete failure (e.g. permission denied) so the caller can
214
- * surface it, mirroring clearConfig/clearCredentials. Resets the in-memory
215
- * cache so subsequent reads in this process reflect the cleared state.
216
- */
217
- export function clearPreferences() {
218
- fs.rmSync(getPreferencesPath(), { force: true });
219
- cached = {};
220
- pending = undefined;
221
- }
222
- /** Test seam — resets the in-memory cache between test cases. */
223
- export function __resetPreferencesCache() {
224
- cached = undefined;
225
- pending = undefined;
226
- }
227
- //# sourceMappingURL=preferences.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../src/lib/preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AA0CzB,IAAI,MAAkC,CAAC;AACvC,IAAI,OAA4C,CAAC;AAEjD,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,2EAA2E;QAC3E,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChE,OAAO,KAAuB,CAAC;QACjC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;QAC5E,+CAA+C;IACjD,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,MAAM;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAE5B,OAAO,GA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mB,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,oBAAoB,EAAE,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACvD,IAAI,mBAAmB,EAAE;QAAE,OAAO,YAAY,CAAC;IAC/C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB;IAC9B,EAAE,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,MAAM,GAAG,EAAE,CAAC;IACZ,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,uBAAuB;IACrC,MAAM,GAAG,SAAS,CAAC;IACnB,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC","sourcesContent":["/**\n * Plain CLI preferences store.\n *\n * Stored at ~/.workos/preferences.json as plain JSON. These are NOT secrets —\n * knowing that someone opted out of telemetry leaks nothing — so this\n * deliberately avoids the keyring abstraction (config-store.ts) to prevent a\n * non-secret write from ever triggering the insecure-fallback security warning.\n *\n * Mirrors the structural pattern of device-id.ts: a synchronous accessor backed\n * by a cache, an async prewarm that populates that cache off the blocking-fs\n * path, and a never-throws contract on every read/parse so a corrupt file can\n * never break a command.\n */\n\nimport fs from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport os from 'node:os';\n\nexport interface CliPreferences {\n telemetry?: {\n /** true => the user explicitly opted out of telemetry. */\n optedOut?: boolean;\n /** ISO timestamp the first-run notice was shown — written in Phase 2 only. */\n noticeShownAt?: string;\n };\n /**\n * Legacy MCP-install onboarding state. The MCP offer folded into `setup` (see\n * commands/setup.ts); these fields are retained for back-compat so a user who\n * declined the old standalone MCP offer is still treated as setup-declined\n * (see isSetupDeclined). Kept in this plain-JSON store alongside telemetry.\n */\n mcp?: {\n /**\n * true => the user explicitly declined an automatic MCP install offer. The\n * decline is absolute: no automatic surface (prompt or banner) asks again;\n * `workos mcp install` stays available manually.\n */\n promptDeclined?: boolean;\n /** ISO timestamp the one-time MCP banner was shown. */\n bannerShownAt?: string;\n };\n /**\n * Consolidated agent-setup onboarding state (skills + MCP). Owned by\n * commands/setup.ts. `declined` is absolute for the automatic surfaces\n * (post-login / post-install); `workos setup` stays available manually.\n * Legacy `mcp.promptDeclined` is treated as an implicit setup-decline on read\n * (see isSetupDeclined) so users who already declined MCP are never re-asked.\n */\n setup?: {\n declined?: boolean;\n /** ISO timestamp the user completed a setup run. */\n completedAt?: string;\n };\n}\n\n/** Effective source of the resolved telemetry-enabled decision. */\nexport type TelemetrySource = 'env' | 'preference' | 'default';\n\nlet cached: CliPreferences | undefined;\nlet pending: Promise<CliPreferences> | undefined;\n\nexport function getPreferencesPath(): string {\n return path.join(os.homedir(), '.workos', 'preferences.json');\n}\n\nfunction parsePreferences(raw: string): CliPreferences {\n try {\n const value = JSON.parse(raw);\n // Defend against a file that parses to a non-object (e.g. `\"true\"`, `42`).\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n return value as CliPreferences;\n }\n } catch {\n // Corrupt JSON — fall through to empty preferences. A later savePreferences\n // overwrites it cleanly; we never auto-delete.\n }\n return {};\n}\n\n/**\n * Asynchronously load preferences and warm the cache the synchronous\n * getPreferences() reads. Memoized: the first call performs the IO, concurrent\n * and later callers await the same promise. Prewarming this at startup keeps\n * the synchronous telemetry path off blocking fs IO. Never rejects.\n */\nexport function loadPreferences(): Promise<CliPreferences> {\n if (cached) return Promise.resolve(cached);\n if (pending) return pending;\n\n pending = (async () => {\n try {\n const raw = await readFile(getPreferencesPath(), 'utf8');\n cached = parsePreferences(raw);\n } catch {\n // Missing/unreadable file — treat as no preferences set.\n cached = {};\n } finally {\n pending = undefined;\n }\n return cached;\n })();\n\n return pending;\n}\n\n/**\n * Synchronous accessor. Returns the prewarmed value when loadPreferences() has\n * run; otherwise performs a one-time synchronous read of the same file. On any\n * IO/parse failure returns {} (telemetry stays at its default-on state). Never\n * throws.\n */\nexport function getPreferences(): CliPreferences {\n if (cached) return cached;\n\n try {\n const raw = fs.readFileSync(getPreferencesPath(), 'utf8');\n cached = parsePreferences(raw);\n } catch {\n // Missing/unreadable/corrupt — telemetry stays at its default-on state.\n cached = {};\n }\n return cached;\n}\n\n/**\n * Read-modify-write the on-disk preferences, merging `next` over the current\n * persisted value so future fields are never clobbered, then update the cache.\n * Throws on write failure so callers on the command path (opt-out/opt-in) can\n * surface a clear error — the read path swallows, the write path does not.\n */\nexport function savePreferences(next: CliPreferences): void {\n const filePath = getPreferencesPath();\n\n // Read-modify-write over the CURRENT on-disk value (not the cache) so a field\n // written by another process / a future phase is preserved.\n let current: CliPreferences = {};\n try {\n current = parsePreferences(fs.readFileSync(filePath, 'utf8'));\n } catch {\n // No existing file (or unreadable) — start from empty.\n }\n\n // Shallow-merge each known nested group (one level) so writing one field\n // (e.g. setup.completedAt) never clobbers a sibling written at a different\n // time (e.g. setup.declined). A new nested group is one entry in this list.\n const merged: CliPreferences = { ...current, ...next };\n for (const key of ['telemetry', 'mcp', 'setup'] as const) {\n if (current[key] || next[key]) {\n Object.assign(merged, { [key]: { ...current[key], ...next[key] } });\n }\n }\n\n fs.mkdirSync(path.dirname(filePath), { recursive: true, mode: 0o700 });\n fs.writeFileSync(filePath, JSON.stringify(merged), { encoding: 'utf8', mode: 0o600 });\n cached = merged;\n}\n\n/** Whether the user has explicitly opted out via the saved preference. */\nexport function isTelemetryOptedOut(): boolean {\n return getPreferences().telemetry?.optedOut === true;\n}\n\n/** Persist the opt-out flag. Throws on write failure (see savePreferences). */\nexport function setTelemetryOptedOut(value: boolean): void {\n savePreferences({ telemetry: { optedOut: value } });\n}\n\n/** Whether the first-run telemetry notice has already been shown (ever). */\nexport function isNoticeShown(): boolean {\n return !!getPreferences().telemetry?.noticeShownAt;\n}\n\n/**\n * Persist the first-run notice as shown, stamping the current time. Uses the\n * read-modify-write savePreferences so it never clobbers the optedOut flag.\n * Throws on write failure (see savePreferences) — the caller in\n * telemetry-notice.ts swallows it so a read-only FS never blocks a command.\n */\nexport function markNoticeShown(): void {\n savePreferences({ telemetry: { noticeShownAt: new Date().toISOString() } });\n}\n\n/**\n * Whether an automatic setup offer should be suppressed. Absolute once the user\n * declines. Treats the legacy `mcp.promptDeclined` flag as an implicit decline\n * so anyone who declined the old MCP offer is never re-prompted by the new flow.\n */\nexport function isSetupDeclined(): boolean {\n const prefs = getPreferences();\n return prefs.setup?.declined === true || prefs.mcp?.promptDeclined === true;\n}\n\n/** Whether the user has completed a setup run (ever). */\nexport function isSetupCompleted(): boolean {\n return !!getPreferences().setup?.completedAt;\n}\n\n/** Persist an explicit setup decline. Throws on write failure (see savePreferences). */\nexport function recordSetupDeclined(): void {\n savePreferences({ setup: { declined: true } });\n}\n\n/** Persist a completed setup run, stamping the current time. */\nexport function recordSetupCompleted(): void {\n savePreferences({ setup: { completedAt: new Date().toISOString() } });\n}\n\n/** Clear the setup decline (new + legacy) so automatic offers resume. For `workos setup --reset`. */\nexport function clearSetupDecline(): void {\n savePreferences({ setup: { declined: false }, mcp: { promptDeclined: false } });\n}\n\n/**\n * Tri-state env override for telemetry.\n *\n * Only the explicit strings 'true' / 'false' count as an override. Any other\n * value — including unset or garbage like '1' — returns undefined and falls\n * through to the saved preference.\n *\n * This is a deliberate, documented change from the old `WORKOS_TELEMETRY !==\n * 'false'` behaviour: previously `WORKOS_TELEMETRY=1` forced telemetry on even\n * for opted-out users; now an opt-out is respected unless the env var\n * explicitly says 'true'.\n */\nexport function envTelemetryOverride(): boolean | undefined {\n const value = process.env.WORKOS_TELEMETRY;\n if (value === 'true') return true;\n if (value === 'false') return false;\n return undefined;\n}\n\n/**\n * Effective telemetry-enabled decision.\n *\n * Resolution order:\n * 1. envTelemetryOverride() if defined — env wins in BOTH directions.\n * 2. otherwise !isTelemetryOptedOut() — default-on unless explicitly opted out.\n */\nexport function isTelemetryEnabled(): boolean {\n const override = envTelemetryOverride();\n if (override !== undefined) return override;\n return !isTelemetryOptedOut();\n}\n\n/**\n * Which signal produced the effective telemetry decision. Mirrors the\n * precedence in isTelemetryEnabled() so the `telemetry status` command and the\n * resolver can never drift.\n *\n * Note: an explicit opt-in (optedOut === false) reads as 'default', not\n * 'preference' — its outcome is identical to a fresh install, and the resolver\n * only treats optedOut === true as a non-default signal, so reporting\n * 'preference' here would imply a behavioral difference that does not exist.\n */\nexport function getTelemetrySource(): TelemetrySource {\n if (envTelemetryOverride() !== undefined) return 'env';\n if (isTelemetryOptedOut()) return 'preference';\n return 'default';\n}\n\n/**\n * Delete the preferences file, returning telemetry to its fresh-install state\n * (opted-in, first-run notice unseen). Used by `debug reset` to wipe stored CLI\n * state alongside credentials and config. No-op if the file does not exist;\n * throws on a real delete failure (e.g. permission denied) so the caller can\n * surface it, mirroring clearConfig/clearCredentials. Resets the in-memory\n * cache so subsequent reads in this process reflect the cleared state.\n */\nexport function clearPreferences(): void {\n fs.rmSync(getPreferencesPath(), { force: true });\n cached = {};\n pending = undefined;\n}\n\n/** Test seam — resets the in-memory cache between test cases. */\nexport function __resetPreferencesCache(): void {\n cached = undefined;\n pending = undefined;\n}\n"]}
@@ -1,22 +0,0 @@
1
- /**
2
- * Progress tracking for wizard phases.
3
- * Maps xstate machine states to user-friendly phase names.
4
- */
5
- export interface Phase {
6
- id: string;
7
- name: string;
8
- number: number;
9
- }
10
- export declare const PHASES: Phase[];
11
- export declare class ProgressTracker {
12
- private currentPhase;
13
- private completedPhases;
14
- private readonly totalPhases;
15
- enterPhase(stateId: string): void;
16
- exitPhase(stateId: string): void;
17
- getCurrentPhase(): Phase | null;
18
- getCurrentIndicator(): string;
19
- getCompletedSummary(): string[];
20
- isComplete(): boolean;
21
- reset(): void;
22
- }
@@ -1,47 +0,0 @@
1
- /**
2
- * Progress tracking for wizard phases.
3
- * Maps xstate machine states to user-friendly phase names.
4
- */
5
- export const PHASES = [
6
- { id: 'authenticating', name: 'Authentication', number: 1 },
7
- { id: 'preparing', name: 'Detection', number: 2 },
8
- { id: 'gatheringCredentials', name: 'Credentials', number: 3 },
9
- { id: 'configuring', name: 'Configuration', number: 4 },
10
- { id: 'runningAgent', name: 'Installation', number: 5 },
11
- ];
12
- export class ProgressTracker {
13
- currentPhase = null;
14
- completedPhases = [];
15
- totalPhases = PHASES.length;
16
- enterPhase(stateId) {
17
- const phase = PHASES.find((p) => p.id === stateId);
18
- if (phase) {
19
- this.currentPhase = phase;
20
- }
21
- }
22
- exitPhase(stateId) {
23
- const phase = PHASES.find((p) => p.id === stateId);
24
- if (phase && !this.completedPhases.some((p) => p.id === phase.id)) {
25
- this.completedPhases.push(phase);
26
- }
27
- }
28
- getCurrentPhase() {
29
- return this.currentPhase;
30
- }
31
- getCurrentIndicator() {
32
- if (!this.currentPhase)
33
- return '';
34
- return `[${this.currentPhase.number}/${this.totalPhases}] ${this.currentPhase.name}`;
35
- }
36
- getCompletedSummary() {
37
- return this.completedPhases.map((p) => `✓ ${p.name}`);
38
- }
39
- isComplete() {
40
- return this.completedPhases.length === this.totalPhases;
41
- }
42
- reset() {
43
- this.currentPhase = null;
44
- this.completedPhases = [];
45
- }
46
- }
47
- //# sourceMappingURL=progress-tracker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"progress-tracker.js","sourceRoot":"","sources":["../../src/lib/progress-tracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,CAAC,MAAM,MAAM,GAAY;IAC7B,EAAE,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,EAAE;IAC3D,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE;IACjD,EAAE,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,EAAE;IAC9D,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC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I,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC;IAC1D,CAAC;IAED,KAAK;QACH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["/**\n * Progress tracking for wizard phases.\n * Maps xstate machine states to user-friendly phase names.\n */\n\nexport interface Phase {\n id: string;\n name: string;\n number: number;\n}\n\nexport const PHASES: Phase[] = [\n { id: 'authenticating', name: 'Authentication', number: 1 },\n { id: 'preparing', name: 'Detection', number: 2 },\n { id: 'gatheringCredentials', name: 'Credentials', number: 3 },\n { id: 'configuring', name: 'Configuration', number: 4 },\n { id: 'runningAgent', name: 'Installation', number: 5 },\n];\n\nexport class ProgressTracker {\n private currentPhase: Phase | null = null;\n private completedPhases: Phase[] = [];\n private readonly totalPhases = PHASES.length;\n\n enterPhase(stateId: string): void {\n const phase = PHASES.find((p) => p.id === stateId);\n if (phase) {\n this.currentPhase = phase;\n }\n }\n\n exitPhase(stateId: string): void {\n const phase = PHASES.find((p) => p.id === stateId);\n if (phase && !this.completedPhases.some((p) => p.id === phase.id)) {\n this.completedPhases.push(phase);\n }\n }\n\n getCurrentPhase(): Phase | null {\n return this.currentPhase;\n }\n\n getCurrentIndicator(): string {\n if (!this.currentPhase) return '';\n return `[${this.currentPhase.number}/${this.totalPhases}] ${this.currentPhase.name}`;\n }\n\n getCompletedSummary(): string[] {\n return this.completedPhases.map((p) => `✓ ${p.name}`);\n }\n\n isComplete(): boolean {\n return this.completedPhases.length === this.totalPhases;\n }\n\n reset(): void {\n this.currentPhase = null;\n this.completedPhases = [];\n }\n}\n"]}
@@ -1,42 +0,0 @@
1
- import type { FrameworkConfig, Language } from './framework-config.js';
2
- import type { InstallerOptions } from '../utils/types.js';
3
- /**
4
- * Standard exports from an integration module.
5
- * Each `src/integrations/{name}/index.ts` must export these.
6
- */
7
- export interface IntegrationModule {
8
- config: FrameworkConfig;
9
- run: (options: InstallerOptions) => Promise<string>;
10
- }
11
- /**
12
- * Registry that provides lookup, detection, and enumeration of integrations.
13
- */
14
- export interface IntegrationRegistry {
15
- /** All registered integrations */
16
- all(): FrameworkConfig[];
17
- /** Get config by integration name */
18
- get(name: string): IntegrationModule | undefined;
19
- /** Get integrations for a specific language, ordered by priority */
20
- forLanguage(language: Language): FrameworkConfig[];
21
- /** Get integration names for CLI choices */
22
- choices(): Array<{
23
- name: string;
24
- value: string;
25
- }>;
26
- /** Detection order: all integrations sorted by priority (higher = checked first) */
27
- detectionOrder(): FrameworkConfig[];
28
- }
29
- /**
30
- * Build the integration registry by discovering all integration modules.
31
- * Scans `src/integrations/` (or `dist/integrations/` at runtime) for directories
32
- * with an index.js/index.ts file and dynamically imports them.
33
- */
34
- export declare function buildRegistry(): Promise<IntegrationRegistry>;
35
- /**
36
- * Get the integration registry (builds once, caches thereafter).
37
- */
38
- export declare function getRegistry(): Promise<IntegrationRegistry>;
39
- /**
40
- * Reset the registry cache. Used in tests.
41
- */
42
- export declare function resetRegistry(): void;