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.
- package/README.md +4 -646
- package/bin/workos.js +44 -0
- package/package.json +18 -99
- package/LICENSE +0 -47
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -1790
- package/dist/bin.js.map +0 -1
- package/dist/cli.config.d.ts +0 -88
- package/dist/cli.config.js +0 -110
- package/dist/cli.config.js.map +0 -1
- package/dist/commands/api/catalog.d.ts +0 -23
- package/dist/commands/api/catalog.js +0 -97
- package/dist/commands/api/catalog.js.map +0 -1
- package/dist/commands/api/format.d.ts +0 -5
- package/dist/commands/api/format.js +0 -46
- package/dist/commands/api/format.js.map +0 -1
- package/dist/commands/api/index.d.ts +0 -15
- package/dist/commands/api/index.js +0 -213
- package/dist/commands/api/index.js.map +0 -1
- package/dist/commands/api/interactive.d.ts +0 -3
- package/dist/commands/api/interactive.js +0 -133
- package/dist/commands/api/interactive.js.map +0 -1
- package/dist/commands/api/request.d.ts +0 -14
- package/dist/commands/api/request.js +0 -38
- package/dist/commands/api/request.js.map +0 -1
- package/dist/commands/api-key-mgmt.d.ts +0 -16
- package/dist/commands/api-key-mgmt.js +0 -96
- package/dist/commands/api-key-mgmt.js.map +0 -1
- package/dist/commands/audit-log.d.ts +0 -26
- package/dist/commands/audit-log.js +0 -155
- package/dist/commands/audit-log.js.map +0 -1
- package/dist/commands/auth-status.d.ts +0 -1
- package/dist/commands/auth-status.js +0 -57
- package/dist/commands/auth-status.js.map +0 -1
- package/dist/commands/claim.d.ts +0 -11
- package/dist/commands/claim.js +0 -143
- package/dist/commands/claim.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.js +0 -54
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/connection.d.ts +0 -13
- package/dist/commands/connection.js +0 -96
- package/dist/commands/connection.js.map +0 -1
- package/dist/commands/debug-sso.d.ts +0 -1
- package/dist/commands/debug-sso.js +0 -78
- package/dist/commands/debug-sso.js.map +0 -1
- package/dist/commands/debug-sync.d.ts +0 -1
- package/dist/commands/debug-sync.js +0 -102
- package/dist/commands/debug-sync.js.map +0 -1
- package/dist/commands/debug.d.ts +0 -28
- package/dist/commands/debug.js +0 -406
- package/dist/commands/debug.js.map +0 -1
- package/dist/commands/dev.d.ts +0 -22
- package/dist/commands/dev.js +0 -145
- package/dist/commands/dev.js.map +0 -1
- package/dist/commands/directory.d.ts +0 -27
- package/dist/commands/directory.js +0 -176
- package/dist/commands/directory.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -12
- package/dist/commands/doctor.js +0 -41
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/emulate.d.ts +0 -7
- package/dist/commands/emulate.js +0 -69
- package/dist/commands/emulate.js.map +0 -1
- package/dist/commands/env.d.ts +0 -19
- package/dist/commands/env.js +0 -303
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/event.d.ts +0 -9
- package/dist/commands/event.js +0 -43
- package/dist/commands/event.js.map +0 -1
- package/dist/commands/feature-flag.d.ts +0 -12
- package/dist/commands/feature-flag.js +0 -96
- package/dist/commands/feature-flag.js.map +0 -1
- package/dist/commands/install-skill.d.ts +0 -85
- package/dist/commands/install-skill.js +0 -332
- package/dist/commands/install-skill.js.map +0 -1
- package/dist/commands/install.d.ts +0 -6
- package/dist/commands/install.js +0 -51
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/invitation.d.ts +0 -19
- package/dist/commands/invitation.js +0 -94
- package/dist/commands/invitation.js.map +0 -1
- package/dist/commands/list-skills.d.ts +0 -4
- package/dist/commands/list-skills.js +0 -52
- package/dist/commands/list-skills.js.map +0 -1
- package/dist/commands/login.d.ts +0 -32
- package/dist/commands/login.js +0 -239
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -1
- package/dist/commands/logout.js +0 -17
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -14
- package/dist/commands/mcp.js +0 -99
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/membership.d.ts +0 -20
- package/dist/commands/membership.js +0 -129
- package/dist/commands/membership.js.map +0 -1
- package/dist/commands/migrations.d.ts +0 -2
- package/dist/commands/migrations.js +0 -50
- package/dist/commands/migrations.js.map +0 -1
- package/dist/commands/onboard-user.d.ts +0 -7
- package/dist/commands/onboard-user.js +0 -61
- package/dist/commands/onboard-user.js.map +0 -1
- package/dist/commands/org-domain.d.ts +0 -4
- package/dist/commands/org-domain.js +0 -45
- package/dist/commands/org-domain.js.map +0 -1
- package/dist/commands/organization.d.ts +0 -14
- package/dist/commands/organization.js +0 -103
- package/dist/commands/organization.js.map +0 -1
- package/dist/commands/permission.d.ts +0 -20
- package/dist/commands/permission.js +0 -93
- package/dist/commands/permission.js.map +0 -1
- package/dist/commands/portal.d.ts +0 -7
- package/dist/commands/portal.js +0 -26
- package/dist/commands/portal.js.map +0 -1
- package/dist/commands/role.d.ts +0 -17
- package/dist/commands/role.js +0 -122
- package/dist/commands/role.js.map +0 -1
- package/dist/commands/seed.d.ts +0 -6
- package/dist/commands/seed.js +0 -298
- package/dist/commands/seed.js.map +0 -1
- package/dist/commands/session.d.ts +0 -8
- package/dist/commands/session.js +0 -63
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup-org.d.ts +0 -6
- package/dist/commands/setup-org.js +0 -99
- package/dist/commands/setup-org.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -50
- package/dist/commands/setup.js +0 -237
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/telemetry.d.ts +0 -3
- package/dist/commands/telemetry.js +0 -88
- package/dist/commands/telemetry.js.map +0 -1
- package/dist/commands/uninstall-skill.d.ts +0 -11
- package/dist/commands/uninstall-skill.js +0 -117
- package/dist/commands/uninstall-skill.js.map +0 -1
- package/dist/commands/user.d.ts +0 -19
- package/dist/commands/user.js +0 -92
- package/dist/commands/user.js.map +0 -1
- package/dist/commands/vault-run.d.ts +0 -13
- package/dist/commands/vault-run.js +0 -195
- package/dist/commands/vault-run.js.map +0 -1
- package/dist/commands/vault.d.ts +0 -25
- package/dist/commands/vault.js +0 -153
- package/dist/commands/vault.js.map +0 -1
- package/dist/commands/verify-login.d.ts +0 -25
- package/dist/commands/verify-login.js +0 -158
- package/dist/commands/verify-login.js.map +0 -1
- package/dist/commands/webhook.d.ts +0 -3
- package/dist/commands/webhook.js +0 -92
- package/dist/commands/webhook.js.map +0 -1
- package/dist/craft-pre-release.sh +0 -10
- package/dist/dashboard/components/AnimatedLogo.d.ts +0 -8
- package/dist/dashboard/components/AnimatedLogo.js +0 -16
- package/dist/dashboard/components/AnimatedLogo.js.map +0 -1
- package/dist/dashboard/components/CompletionView.d.ts +0 -13
- package/dist/dashboard/components/CompletionView.js +0 -25
- package/dist/dashboard/components/CompletionView.js.map +0 -1
- package/dist/dashboard/components/ConfirmPrompt.d.ts +0 -9
- package/dist/dashboard/components/ConfirmPrompt.js +0 -25
- package/dist/dashboard/components/ConfirmPrompt.js.map +0 -1
- package/dist/dashboard/components/CredentialsForm.d.ts +0 -10
- package/dist/dashboard/components/CredentialsForm.js +0 -47
- package/dist/dashboard/components/CredentialsForm.js.map +0 -1
- package/dist/dashboard/components/Dashboard.d.ts +0 -3
- package/dist/dashboard/components/Dashboard.js +0 -100
- package/dist/dashboard/components/Dashboard.js.map +0 -1
- package/dist/dashboard/components/DashboardLayout.d.ts +0 -24
- package/dist/dashboard/components/DashboardLayout.js +0 -25
- package/dist/dashboard/components/DashboardLayout.js.map +0 -1
- package/dist/dashboard/components/DiffPanel.d.ts +0 -9
- package/dist/dashboard/components/DiffPanel.js +0 -136
- package/dist/dashboard/components/DiffPanel.js.map +0 -1
- package/dist/dashboard/components/InlinePrompt.d.ts +0 -8
- package/dist/dashboard/components/InlinePrompt.js +0 -19
- package/dist/dashboard/components/InlinePrompt.js.map +0 -1
- package/dist/dashboard/components/OutputPanel.d.ts +0 -10
- package/dist/dashboard/components/OutputPanel.js +0 -100
- package/dist/dashboard/components/OutputPanel.js.map +0 -1
- package/dist/dashboard/components/Panel.d.ts +0 -12
- package/dist/dashboard/components/Panel.js +0 -6
- package/dist/dashboard/components/Panel.js.map +0 -1
- package/dist/dashboard/components/TextInput.d.ts +0 -13
- package/dist/dashboard/components/TextInput.js +0 -57
- package/dist/dashboard/components/TextInput.js.map +0 -1
- package/dist/dashboard/components/WelcomeArt.d.ts +0 -2
- package/dist/dashboard/components/WelcomeArt.js +0 -9
- package/dist/dashboard/components/WelcomeArt.js.map +0 -1
- package/dist/dashboard/hooks/useAnimation.d.ts +0 -7
- package/dist/dashboard/hooks/useAnimation.js +0 -24
- package/dist/dashboard/hooks/useAnimation.js.map +0 -1
- package/dist/dashboard/hooks/useKeyboard.d.ts +0 -8
- package/dist/dashboard/hooks/useKeyboard.js +0 -18
- package/dist/dashboard/hooks/useKeyboard.js.map +0 -1
- package/dist/dashboard/hooks/useTerminalSize.d.ts +0 -8
- package/dist/dashboard/hooks/useTerminalSize.js +0 -23
- package/dist/dashboard/hooks/useTerminalSize.js.map +0 -1
- package/dist/dashboard/index.d.ts +0 -6
- package/dist/dashboard/index.js +0 -36
- package/dist/dashboard/index.js.map +0 -1
- package/dist/dashboard/lib/diff-utils.d.ts +0 -21
- package/dist/dashboard/lib/diff-utils.js +0 -271
- package/dist/dashboard/lib/diff-utils.js.map +0 -1
- package/dist/dashboard/lib/logo-frames.d.ts +0 -20
- package/dist/dashboard/lib/logo-frames.js +0 -109
- package/dist/dashboard/lib/logo-frames.js.map +0 -1
- package/dist/dashboard/lib/welcome-art.d.ts +0 -1
- package/dist/dashboard/lib/welcome-art.js +0 -5
- package/dist/dashboard/lib/welcome-art.js.map +0 -1
- package/dist/dashboard/types.d.ts +0 -5
- package/dist/dashboard/types.js +0 -2
- package/dist/dashboard/types.js.map +0 -1
- package/dist/doctor/agent-prompt.d.ts +0 -10
- package/dist/doctor/agent-prompt.js +0 -190
- package/dist/doctor/agent-prompt.js.map +0 -1
- package/dist/doctor/checks/ai-analysis.d.ts +0 -9
- package/dist/doctor/checks/ai-analysis.js +0 -124
- package/dist/doctor/checks/ai-analysis.js.map +0 -1
- package/dist/doctor/checks/auth-patterns.d.ts +0 -2
- package/dist/doctor/checks/auth-patterns.js +0 -569
- package/dist/doctor/checks/auth-patterns.js.map +0 -1
- package/dist/doctor/checks/connectivity.d.ts +0 -2
- package/dist/doctor/checks/connectivity.js +0 -35
- package/dist/doctor/checks/connectivity.js.map +0 -1
- package/dist/doctor/checks/dashboard.d.ts +0 -3
- package/dist/doctor/checks/dashboard.js +0 -123
- package/dist/doctor/checks/dashboard.js.map +0 -1
- package/dist/doctor/checks/environment.d.ts +0 -2
- package/dist/doctor/checks/environment.js +0 -86
- package/dist/doctor/checks/environment.js.map +0 -1
- package/dist/doctor/checks/framework.d.ts +0 -2
- package/dist/doctor/checks/framework.js +0 -94
- package/dist/doctor/checks/framework.js.map +0 -1
- package/dist/doctor/checks/host-execution.d.ts +0 -2
- package/dist/doctor/checks/host-execution.js +0 -21
- package/dist/doctor/checks/host-execution.js.map +0 -1
- package/dist/doctor/checks/language.d.ts +0 -6
- package/dist/doctor/checks/language.js +0 -104
- package/dist/doctor/checks/language.js.map +0 -1
- package/dist/doctor/checks/mcp.d.ts +0 -15
- package/dist/doctor/checks/mcp.js +0 -34
- package/dist/doctor/checks/mcp.js.map +0 -1
- package/dist/doctor/checks/runtime.d.ts +0 -2
- package/dist/doctor/checks/runtime.js +0 -20
- package/dist/doctor/checks/runtime.js.map +0 -1
- package/dist/doctor/checks/sdk.d.ts +0 -2
- package/dist/doctor/checks/sdk.js +0 -192
- package/dist/doctor/checks/sdk.js.map +0 -1
- package/dist/doctor/checks/skills.d.ts +0 -9
- package/dist/doctor/checks/skills.js +0 -84
- package/dist/doctor/checks/skills.js.map +0 -1
- package/dist/doctor/clipboard.d.ts +0 -1
- package/dist/doctor/clipboard.js +0 -43
- package/dist/doctor/clipboard.js.map +0 -1
- package/dist/doctor/index.d.ts +0 -26
- package/dist/doctor/index.js +0 -182
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/issues.d.ts +0 -63
- package/dist/doctor/issues.js +0 -199
- package/dist/doctor/issues.js.map +0 -1
- package/dist/doctor/json-output.d.ts +0 -2
- package/dist/doctor/json-output.js +0 -4
- package/dist/doctor/json-output.js.map +0 -1
- package/dist/doctor/output.d.ts +0 -7
- package/dist/doctor/output.js +0 -289
- package/dist/doctor/output.js.map +0 -1
- package/dist/doctor/types.d.ts +0 -203
- package/dist/doctor/types.js +0 -2
- package/dist/doctor/types.js.map +0 -1
- package/dist/integrations/dotnet/index.d.ts +0 -8
- package/dist/integrations/dotnet/index.js +0 -170
- package/dist/integrations/dotnet/index.js.map +0 -1
- package/dist/integrations/elixir/index.d.ts +0 -8
- package/dist/integrations/elixir/index.js +0 -146
- package/dist/integrations/elixir/index.js.map +0 -1
- package/dist/integrations/go/index.d.ts +0 -11
- package/dist/integrations/go/index.js +0 -212
- package/dist/integrations/go/index.js.map +0 -1
- package/dist/integrations/kotlin/index.d.ts +0 -4
- package/dist/integrations/kotlin/index.js +0 -78
- package/dist/integrations/kotlin/index.js.map +0 -1
- package/dist/integrations/nextjs/index.d.ts +0 -4
- package/dist/integrations/nextjs/index.js +0 -93
- package/dist/integrations/nextjs/index.js.map +0 -1
- package/dist/integrations/nextjs/utils.d.ts +0 -8
- package/dist/integrations/nextjs/utils.js +0 -68
- package/dist/integrations/nextjs/utils.js.map +0 -1
- package/dist/integrations/node/index.d.ts +0 -4
- package/dist/integrations/node/index.js +0 -52
- package/dist/integrations/node/index.js.map +0 -1
- package/dist/integrations/php/index.d.ts +0 -4
- package/dist/integrations/php/index.js +0 -51
- package/dist/integrations/php/index.js.map +0 -1
- package/dist/integrations/php-laravel/index.d.ts +0 -4
- package/dist/integrations/php-laravel/index.js +0 -51
- package/dist/integrations/php-laravel/index.js.map +0 -1
- package/dist/integrations/python/index.d.ts +0 -9
- package/dist/integrations/python/index.js +0 -249
- package/dist/integrations/python/index.js.map +0 -1
- package/dist/integrations/react/index.d.ts +0 -4
- package/dist/integrations/react/index.js +0 -49
- package/dist/integrations/react/index.js.map +0 -1
- package/dist/integrations/react-router/index.d.ts +0 -4
- package/dist/integrations/react-router/index.js +0 -94
- package/dist/integrations/react-router/index.js.map +0 -1
- package/dist/integrations/react-router/utils.d.ts +0 -10
- package/dist/integrations/react-router/utils.js +0 -162
- package/dist/integrations/react-router/utils.js.map +0 -1
- package/dist/integrations/ruby/index.d.ts +0 -8
- package/dist/integrations/ruby/index.js +0 -137
- package/dist/integrations/ruby/index.js.map +0 -1
- package/dist/integrations/sveltekit/index.d.ts +0 -4
- package/dist/integrations/sveltekit/index.js +0 -50
- package/dist/integrations/sveltekit/index.js.map +0 -1
- package/dist/integrations/tanstack-start/index.d.ts +0 -4
- package/dist/integrations/tanstack-start/index.js +0 -51
- package/dist/integrations/tanstack-start/index.js.map +0 -1
- package/dist/integrations/vanilla-js/index.d.ts +0 -4
- package/dist/integrations/vanilla-js/index.js +0 -49
- package/dist/integrations/vanilla-js/index.js.map +0 -1
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.d.ts +0 -7
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js +0 -12
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js.map +0 -1
- package/dist/lib/adapters/cli-adapter.d.ts +0 -113
- package/dist/lib/adapters/cli-adapter.js +0 -641
- package/dist/lib/adapters/cli-adapter.js.map +0 -1
- package/dist/lib/adapters/dashboard-adapter.d.ts +0 -34
- package/dist/lib/adapters/dashboard-adapter.js +0 -121
- package/dist/lib/adapters/dashboard-adapter.js.map +0 -1
- package/dist/lib/adapters/headless-adapter.d.ts +0 -80
- package/dist/lib/adapters/headless-adapter.js +0 -347
- package/dist/lib/adapters/headless-adapter.js.map +0 -1
- package/dist/lib/adapters/index.d.ts +0 -4
- package/dist/lib/adapters/index.js +0 -4
- package/dist/lib/adapters/index.js.map +0 -1
- package/dist/lib/adapters/types.d.ts +0 -41
- package/dist/lib/adapters/types.js +0 -2
- package/dist/lib/adapters/types.js.map +0 -1
- package/dist/lib/agent-interface.d.ts +0 -84
- package/dist/lib/agent-interface.js +0 -840
- package/dist/lib/agent-interface.js.map +0 -1
- package/dist/lib/agent-runner.d.ts +0 -9
- package/dist/lib/agent-runner.js +0 -261
- package/dist/lib/agent-runner.js.map +0 -1
- package/dist/lib/ai-content.d.ts +0 -14
- package/dist/lib/ai-content.js +0 -131
- package/dist/lib/ai-content.js.map +0 -1
- package/dist/lib/api-error-handler.d.ts +0 -18
- package/dist/lib/api-error-handler.js +0 -76
- package/dist/lib/api-error-handler.js.map +0 -1
- package/dist/lib/api-key.d.ts +0 -14
- package/dist/lib/api-key.js +0 -37
- package/dist/lib/api-key.js.map +0 -1
- package/dist/lib/api.d.ts +0 -25
- package/dist/lib/api.js +0 -120
- package/dist/lib/api.js.map +0 -1
- package/dist/lib/background-refresh.d.ts +0 -29
- package/dist/lib/background-refresh.js +0 -95
- package/dist/lib/background-refresh.js.map +0 -1
- package/dist/lib/command-aliases.d.ts +0 -8
- package/dist/lib/command-aliases.js +0 -12
- package/dist/lib/command-aliases.js.map +0 -1
- package/dist/lib/completion-data.d.ts +0 -33
- package/dist/lib/completion-data.js +0 -33
- package/dist/lib/completion-data.js.map +0 -1
- package/dist/lib/config-store.d.ts +0 -63
- package/dist/lib/config-store.js +0 -293
- package/dist/lib/config-store.js.map +0 -1
- package/dist/lib/config.d.ts +0 -34
- package/dist/lib/config.js +0 -37
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/constants.d.ts +0 -51
- package/dist/lib/constants.js +0 -50
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/credential-discovery.d.ts +0 -42
- package/dist/lib/credential-discovery.js +0 -100
- package/dist/lib/credential-discovery.js.map +0 -1
- package/dist/lib/credential-proxy.d.ts +0 -45
- package/dist/lib/credential-proxy.js +0 -364
- package/dist/lib/credential-proxy.js.map +0 -1
- package/dist/lib/credential-store.d.ts +0 -32
- package/dist/lib/credential-store.js +0 -236
- package/dist/lib/credential-store.js.map +0 -1
- package/dist/lib/credentials.d.ts +0 -13
- package/dist/lib/credentials.js +0 -34
- package/dist/lib/credentials.js.map +0 -1
- package/dist/lib/dev-command.d.ts +0 -26
- package/dist/lib/dev-command.js +0 -129
- package/dist/lib/dev-command.js.map +0 -1
- package/dist/lib/device-auth.d.ts +0 -48
- package/dist/lib/device-auth.js +0 -176
- package/dist/lib/device-auth.js.map +0 -1
- package/dist/lib/device-id.d.ts +0 -25
- package/dist/lib/device-id.js +0 -102
- package/dist/lib/device-id.js.map +0 -1
- package/dist/lib/ensure-auth.d.ts +0 -12
- package/dist/lib/ensure-auth.js +0 -111
- package/dist/lib/ensure-auth.js.map +0 -1
- package/dist/lib/env-writer.d.ts +0 -25
- package/dist/lib/env-writer.js +0 -90
- package/dist/lib/env-writer.js.map +0 -1
- package/dist/lib/events.d.ts +0 -248
- package/dist/lib/events.js +0 -19
- package/dist/lib/events.js.map +0 -1
- package/dist/lib/framework-config.d.ts +0 -133
- package/dist/lib/framework-config.js +0 -11
- package/dist/lib/framework-config.js.map +0 -1
- package/dist/lib/helper-functions.d.ts +0 -1
- package/dist/lib/helper-functions.js +0 -2
- package/dist/lib/helper-functions.js.map +0 -1
- package/dist/lib/host-probe.d.ts +0 -28
- package/dist/lib/host-probe.js +0 -154
- package/dist/lib/host-probe.js.map +0 -1
- package/dist/lib/installer-core.d.ts +0 -569
- package/dist/lib/installer-core.js +0 -1134
- package/dist/lib/installer-core.js.map +0 -1
- package/dist/lib/installer-core.types.d.ts +0 -162
- package/dist/lib/installer-core.types.js +0 -2
- package/dist/lib/installer-core.types.js.map +0 -1
- package/dist/lib/mcp-clients.d.ts +0 -45
- package/dist/lib/mcp-clients.js +0 -297
- package/dist/lib/mcp-clients.js.map +0 -1
- package/dist/lib/port-detection.d.ts +0 -7
- package/dist/lib/port-detection.js +0 -244
- package/dist/lib/port-detection.js.map +0 -1
- package/dist/lib/post-install.d.ts +0 -8
- package/dist/lib/post-install.js +0 -51
- package/dist/lib/post-install.js.map +0 -1
- package/dist/lib/preferences.d.ts +0 -143
- package/dist/lib/preferences.js +0 -227
- package/dist/lib/preferences.js.map +0 -1
- package/dist/lib/progress-tracker.d.ts +0 -22
- package/dist/lib/progress-tracker.js +0 -47
- package/dist/lib/progress-tracker.js.map +0 -1
- package/dist/lib/registry.d.ts +0 -42
- package/dist/lib/registry.js +0 -96
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/resolve-install-credentials.d.ts +0 -11
- package/dist/lib/resolve-install-credentials.js +0 -53
- package/dist/lib/resolve-install-credentials.js.map +0 -1
- package/dist/lib/run-with-core.d.ts +0 -7
- package/dist/lib/run-with-core.js +0 -559
- package/dist/lib/run-with-core.js.map +0 -1
- package/dist/lib/safe-tools.d.ts +0 -2
- package/dist/lib/safe-tools.js +0 -212
- package/dist/lib/safe-tools.js.map +0 -1
- package/dist/lib/scaffold/index.d.ts +0 -1
- package/dist/lib/scaffold/index.js +0 -2
- package/dist/lib/scaffold/index.js.map +0 -1
- package/dist/lib/scaffold/scaffold.d.ts +0 -66
- package/dist/lib/scaffold/scaffold.js +0 -156
- package/dist/lib/scaffold/scaffold.js.map +0 -1
- package/dist/lib/settings.d.ts +0 -60
- package/dist/lib/settings.js +0 -31
- package/dist/lib/settings.js.map +0 -1
- package/dist/lib/staging-api.d.ts +0 -22
- package/dist/lib/staging-api.js +0 -74
- package/dist/lib/staging-api.js.map +0 -1
- package/dist/lib/startup-notice-gate.d.ts +0 -21
- package/dist/lib/startup-notice-gate.js +0 -29
- package/dist/lib/startup-notice-gate.js.map +0 -1
- package/dist/lib/telemetry-notice.d.ts +0 -25
- package/dist/lib/telemetry-notice.js +0 -58
- package/dist/lib/telemetry-notice.js.map +0 -1
- package/dist/lib/token-refresh-client.d.ts +0 -23
- package/dist/lib/token-refresh-client.js +0 -89
- package/dist/lib/token-refresh-client.js.map +0 -1
- package/dist/lib/token-refresh.d.ts +0 -12
- package/dist/lib/token-refresh.js +0 -27
- package/dist/lib/token-refresh.js.map +0 -1
- package/dist/lib/unclaimed-env-api.d.ts +0 -42
- package/dist/lib/unclaimed-env-api.js +0 -139
- package/dist/lib/unclaimed-env-api.js.map +0 -1
- package/dist/lib/unclaimed-env-provision.d.ts +0 -24
- package/dist/lib/unclaimed-env-provision.js +0 -80
- package/dist/lib/unclaimed-env-provision.js.map +0 -1
- package/dist/lib/unclaimed-warning.d.ts +0 -15
- package/dist/lib/unclaimed-warning.js +0 -78
- package/dist/lib/unclaimed-warning.js.map +0 -1
- package/dist/lib/validation/build-validator.d.ts +0 -21
- package/dist/lib/validation/build-validator.js +0 -153
- package/dist/lib/validation/build-validator.js.map +0 -1
- package/dist/lib/validation/index.d.ts +0 -4
- package/dist/lib/validation/index.js +0 -4
- package/dist/lib/validation/index.js.map +0 -1
- package/dist/lib/validation/quick-checks.d.ts +0 -19
- package/dist/lib/validation/quick-checks.js +0 -192
- package/dist/lib/validation/quick-checks.js.map +0 -1
- package/dist/lib/validation/security-checks.d.ts +0 -35
- package/dist/lib/validation/security-checks.js +0 -106
- package/dist/lib/validation/security-checks.js.map +0 -1
- package/dist/lib/validation/types.d.ts +0 -56
- package/dist/lib/validation/types.js +0 -2
- package/dist/lib/validation/types.js.map +0 -1
- package/dist/lib/validation/validator.d.ts +0 -13
- package/dist/lib/validation/validator.js +0 -711
- package/dist/lib/validation/validator.js.map +0 -1
- package/dist/lib/version-check.d.ts +0 -6
- package/dist/lib/version-check.js +0 -46
- package/dist/lib/version-check.js.map +0 -1
- package/dist/lib/workos-api.d.ts +0 -30
- package/dist/lib/workos-api.js +0 -69
- package/dist/lib/workos-api.js.map +0 -1
- package/dist/lib/workos-client.d.ts +0 -58
- package/dist/lib/workos-client.js +0 -140
- package/dist/lib/workos-client.js.map +0 -1
- package/dist/lib/workos-management.d.ts +0 -32
- package/dist/lib/workos-management.js +0 -149
- package/dist/lib/workos-management.js.map +0 -1
- package/dist/nextjs/nextjs-installer-agent.d.ts +0 -5
- package/dist/nextjs/nextjs-installer-agent.js +0 -6
- package/dist/nextjs/nextjs-installer-agent.js.map +0 -1
- package/dist/nextjs/utils.d.ts +0 -4
- package/dist/nextjs/utils.js +0 -5
- package/dist/nextjs/utils.js.map +0 -1
- package/dist/react/react-installer-agent.d.ts +0 -4
- package/dist/react/react-installer-agent.js +0 -5
- package/dist/react/react-installer-agent.js.map +0 -1
- package/dist/react-router/react-router-installer-agent.d.ts +0 -4
- package/dist/react-router/react-router-installer-agent.js +0 -5
- package/dist/react-router/react-router-installer-agent.js.map +0 -1
- package/dist/react-router/utils.d.ts +0 -4
- package/dist/react-router/utils.js +0 -5
- package/dist/react-router/utils.js.map +0 -1
- package/dist/run.d.ts +0 -33
- package/dist/run.js +0 -58
- package/dist/run.js.map +0 -1
- package/dist/smoke-test.ts +0 -881
- package/dist/steps/add-or-update-environment-variables.d.ts +0 -10
- package/dist/steps/add-or-update-environment-variables.js +0 -155
- package/dist/steps/add-or-update-environment-variables.js.map +0 -1
- package/dist/steps/index.d.ts +0 -3
- package/dist/steps/index.js +0 -4
- package/dist/steps/index.js.map +0 -1
- package/dist/steps/run-prettier.d.ts +0 -5
- package/dist/steps/run-prettier.js +0 -50
- package/dist/steps/run-prettier.js.map +0 -1
- package/dist/steps/upload-environment-variables/EnvironmentProvider.d.ts +0 -8
- package/dist/steps/upload-environment-variables/EnvironmentProvider.js +0 -7
- package/dist/steps/upload-environment-variables/EnvironmentProvider.js.map +0 -1
- package/dist/steps/upload-environment-variables/index.d.ts +0 -6
- package/dist/steps/upload-environment-variables/index.js +0 -69
- package/dist/steps/upload-environment-variables/index.js.map +0 -1
- package/dist/steps/upload-environment-variables/providers/vercel.d.ts +0 -14
- package/dist/steps/upload-environment-variables/providers/vercel.js +0 -107
- package/dist/steps/upload-environment-variables/providers/vercel.js.map +0 -1
- package/dist/tanstack-start/tanstack-start-installer-agent.d.ts +0 -4
- package/dist/tanstack-start/tanstack-start-installer-agent.js +0 -5
- package/dist/tanstack-start/tanstack-start-installer-agent.js.map +0 -1
- package/dist/telemetry.d.ts +0 -2
- package/dist/telemetry.js +0 -29
- package/dist/telemetry.js.map +0 -1
- package/dist/test/force-insecure-storage.d.ts +0 -1
- package/dist/test/force-insecure-storage.js +0 -9
- package/dist/test/force-insecure-storage.js.map +0 -1
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -38
- package/dist/test/setup.js.map +0 -1
- package/dist/utils/analytics.d.ts +0 -66
- package/dist/utils/analytics.js +0 -330
- package/dist/utils/analytics.js.map +0 -1
- package/dist/utils/bash.d.ts +0 -2
- package/dist/utils/bash.js +0 -17
- package/dist/utils/bash.js.map +0 -1
- package/dist/utils/box.d.ts +0 -9
- package/dist/utils/box.js +0 -15
- package/dist/utils/box.js.map +0 -1
- package/dist/utils/cli-exit.d.ts +0 -15
- package/dist/utils/cli-exit.js +0 -11
- package/dist/utils/cli-exit.js.map +0 -1
- package/dist/utils/cli-symbols.d.ts +0 -44
- package/dist/utils/cli-symbols.js +0 -58
- package/dist/utils/cli-symbols.js.map +0 -1
- package/dist/utils/command-invocation.d.ts +0 -10
- package/dist/utils/command-invocation.js +0 -26
- package/dist/utils/command-invocation.js.map +0 -1
- package/dist/utils/command-telemetry.d.ts +0 -17
- package/dist/utils/command-telemetry.js +0 -67
- package/dist/utils/command-telemetry.js.map +0 -1
- package/dist/utils/crash-reporter.d.ts +0 -13
- package/dist/utils/crash-reporter.js +0 -91
- package/dist/utils/crash-reporter.js.map +0 -1
- package/dist/utils/debug.d.ts +0 -9
- package/dist/utils/debug.js +0 -105
- package/dist/utils/debug.js.map +0 -1
- package/dist/utils/env-parser.d.ts +0 -5
- package/dist/utils/env-parser.js +0 -18
- package/dist/utils/env-parser.js.map +0 -1
- package/dist/utils/environment.d.ts +0 -10
- package/dist/utils/environment.js +0 -69
- package/dist/utils/environment.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -3
- package/dist/utils/errors.js +0 -7
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/exec-file.d.ts +0 -15
- package/dist/utils/exec-file.js +0 -39
- package/dist/utils/exec-file.js.map +0 -1
- package/dist/utils/exit-codes.d.ts +0 -31
- package/dist/utils/exit-codes.js +0 -69
- package/dist/utils/exit-codes.js.map +0 -1
- package/dist/utils/git-utils.d.ts +0 -23
- package/dist/utils/git-utils.js +0 -86
- package/dist/utils/git-utils.js.map +0 -1
- package/dist/utils/help-json.d.ts +0 -58
- package/dist/utils/help-json.js +0 -1577
- package/dist/utils/help-json.js.map +0 -1
- package/dist/utils/interaction-mode.d.ts +0 -25
- package/dist/utils/interaction-mode.js +0 -99
- package/dist/utils/interaction-mode.js.map +0 -1
- package/dist/utils/lock-art.d.ts +0 -4
- package/dist/utils/lock-art.js +0 -73
- package/dist/utils/lock-art.js.map +0 -1
- package/dist/utils/logging.d.ts +0 -9
- package/dist/utils/logging.js +0 -36
- package/dist/utils/logging.js.map +0 -1
- package/dist/utils/ndjson.d.ts +0 -16
- package/dist/utils/ndjson.js +0 -18
- package/dist/utils/ndjson.js.map +0 -1
- package/dist/utils/output.d.ts +0 -60
- package/dist/utils/output.js +0 -124
- package/dist/utils/output.js.map +0 -1
- package/dist/utils/package-json.d.ts +0 -26
- package/dist/utils/package-json.js +0 -32
- package/dist/utils/package-json.js.map +0 -1
- package/dist/utils/package-manager.d.ts +0 -21
- package/dist/utils/package-manager.js +0 -166
- package/dist/utils/package-manager.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -5
- package/dist/utils/paths.js +0 -18
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/platform.d.ts +0 -8
- package/dist/utils/platform.js +0 -7
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/recovery-hints.d.ts +0 -42
- package/dist/utils/recovery-hints.js +0 -92
- package/dist/utils/recovery-hints.js.map +0 -1
- package/dist/utils/redact.d.ts +0 -5
- package/dist/utils/redact.js +0 -29
- package/dist/utils/redact.js.map +0 -1
- package/dist/utils/register-subcommand.d.ts +0 -10
- package/dist/utils/register-subcommand.js +0 -33
- package/dist/utils/register-subcommand.js.map +0 -1
- package/dist/utils/semver.d.ts +0 -10
- package/dist/utils/semver.js +0 -43
- package/dist/utils/semver.js.map +0 -1
- package/dist/utils/string.d.ts +0 -1
- package/dist/utils/string.js +0 -6
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/summary-box.d.ts +0 -25
- package/dist/utils/summary-box.js +0 -211
- package/dist/utils/summary-box.js.map +0 -1
- package/dist/utils/table.d.ts +0 -5
- package/dist/utils/table.js +0 -18
- package/dist/utils/table.js.map +0 -1
- package/dist/utils/telemetry-client.d.ts +0 -43
- package/dist/utils/telemetry-client.js +0 -171
- package/dist/utils/telemetry-client.js.map +0 -1
- package/dist/utils/telemetry-store-forward.d.ts +0 -11
- package/dist/utils/telemetry-store-forward.js +0 -94
- package/dist/utils/telemetry-store-forward.js.map +0 -1
- package/dist/utils/telemetry-types.d.ts +0 -100
- package/dist/utils/telemetry-types.js +0 -6
- package/dist/utils/telemetry-types.js.map +0 -1
- package/dist/utils/types.d.ts +0 -123
- package/dist/utils/types.js +0 -2
- package/dist/utils/types.js.map +0 -1
- package/dist/utils/ui-utils.d.ts +0 -97
- package/dist/utils/ui-utils.js +0 -449
- package/dist/utils/ui-utils.js.map +0 -1
- package/dist/utils/ui.d.ts +0 -148
- package/dist/utils/ui.js +0 -368
- package/dist/utils/ui.js.map +0 -1
- package/dist/utils/urls.d.ts +0 -13
- package/dist/utils/urls.js +0 -14
- package/dist/utils/urls.js.map +0 -1
- package/dist/utils/vendor/is-unicorn-supported.d.ts +0 -1
- package/dist/utils/vendor/is-unicorn-supported.js +0 -21
- package/dist/utils/vendor/is-unicorn-supported.js.map +0 -1
- package/dist/vanilla-js/vanilla-js-installer-agent.d.ts +0 -4
- package/dist/vanilla-js/vanilla-js-installer-agent.js +0 -5
- package/dist/vanilla-js/vanilla-js-installer-agent.js.map +0 -1
|
@@ -1,559 +0,0 @@
|
|
|
1
|
-
import { createActor, fromPromise } from 'xstate';
|
|
2
|
-
import open from 'open';
|
|
3
|
-
import { existsSync, readFileSync } from 'fs';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { installerMachine } from './installer-core.js';
|
|
6
|
-
import { createInstallerEventEmitter } from './events.js';
|
|
7
|
-
import { buildCompletionData } from './completion-data.js';
|
|
8
|
-
import { resolveDevCommand } from './dev-command.js';
|
|
9
|
-
import { getConfig as getInstallerSettings } from './settings.js';
|
|
10
|
-
import { CLIAdapter } from './adapters/cli-adapter.js';
|
|
11
|
-
import { DashboardAdapter } from './adapters/dashboard-adapter.js';
|
|
12
|
-
import { getInteractionMode, isAgentMode, isCiMode } from '../utils/interaction-mode.js';
|
|
13
|
-
import { getOutputMode, isJsonMode, resolveEffectiveOutputMode, setOutputMode } from '../utils/output.js';
|
|
14
|
-
import { isScaffoldableEmptyDir, resolvePackageManager, runCreateNextApp } from './scaffold/index.js';
|
|
15
|
-
import { parseEnvFile } from '../utils/env-parser.js';
|
|
16
|
-
import { enableDebugLogs, initLogFile, logInfo, logError } from '../utils/debug.js';
|
|
17
|
-
import { getAccessToken, saveCredentials, getStagingCredentials, saveStagingCredentials } from './credentials.js';
|
|
18
|
-
import { getConfig, saveConfig, getActiveEnvironment, isUnclaimedEnvironment } from './config-store.js';
|
|
19
|
-
import { checkForEnvFiles, discoverCredentials } from './credential-discovery.js';
|
|
20
|
-
import { requestDeviceCode, pollForToken } from './device-auth.js';
|
|
21
|
-
import { fetchStagingCredentials as fetchStagingCredentialsApi } from './staging-api.js';
|
|
22
|
-
import { getCliAuthClientId, getAuthkitDomain } from './settings.js';
|
|
23
|
-
import { getTelemetryUrl } from '../utils/urls.js';
|
|
24
|
-
import { analytics } from '../utils/analytics.js';
|
|
25
|
-
import { getVersion } from './settings.js';
|
|
26
|
-
import { isInGitRepo, getUncommittedOrUntrackedFiles } from '../utils/ui-utils.js';
|
|
27
|
-
import { getCurrentBranch, isProtectedBranch, createBranch as createGitBranch, branchExists, } from '../utils/git-utils.js';
|
|
28
|
-
import { detectChanges, stageAndCommit, pushBranch as pushGitBranch, createPullRequest } from './post-install.js';
|
|
29
|
-
import { generateCommitMessage as generateCommitMessageAi, generatePrDescription as generatePrDescriptionAi, } from './ai-content.js';
|
|
30
|
-
import { autoConfigureWorkOSEnvironment } from './workos-management.js';
|
|
31
|
-
import { detectPort, getCallbackPath } from './port-detection.js';
|
|
32
|
-
import { writeEnvLocal } from './env-writer.js';
|
|
33
|
-
import { getRegistry } from './registry.js';
|
|
34
|
-
import { observeHostFailure } from './host-probe.js';
|
|
35
|
-
import { formatWorkOSCommand } from '../utils/command-invocation.js';
|
|
36
|
-
async function runIntegrationInstallerFn(integration, options) {
|
|
37
|
-
const registry = await getRegistry();
|
|
38
|
-
const mod = registry.get(integration);
|
|
39
|
-
if (!mod) {
|
|
40
|
-
throw new Error(`Unknown integration: ${integration}`);
|
|
41
|
-
}
|
|
42
|
-
return mod.run(options);
|
|
43
|
-
}
|
|
44
|
-
function readExistingCredentials(installDir) {
|
|
45
|
-
const envPath = join(installDir, '.env.local');
|
|
46
|
-
if (!existsSync(envPath)) {
|
|
47
|
-
return {};
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
const content = readFileSync(envPath, 'utf-8');
|
|
51
|
-
const envVars = parseEnvFile(content);
|
|
52
|
-
return {
|
|
53
|
-
apiKey: envVars.WORKOS_API_KEY || undefined,
|
|
54
|
-
clientId: envVars.WORKOS_CLIENT_ID || undefined,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
return {};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async function detectIntegrationFn(options) {
|
|
62
|
-
const registry = await getRegistry();
|
|
63
|
-
const configs = registry.detectionOrder();
|
|
64
|
-
for (const config of configs) {
|
|
65
|
-
// Use the detect function from INTEGRATION_CONFIG in config.ts for JS integrations,
|
|
66
|
-
// or fall back to checking if the framework package is installed
|
|
67
|
-
const detected = await detectSingleIntegration(config.metadata.integration, options);
|
|
68
|
-
if (detected) {
|
|
69
|
-
return config.metadata.integration;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Detect if a single integration matches the project.
|
|
76
|
-
* Uses package.json detection for JS integrations, manifest files for others.
|
|
77
|
-
*/
|
|
78
|
-
export async function detectSingleIntegration(integration, options) {
|
|
79
|
-
const { getPackageDotJson } = await import('../utils/ui-utils.js');
|
|
80
|
-
const { hasPackageInstalled } = await import('../utils/package-json.js');
|
|
81
|
-
const { existsSync } = await import('node:fs');
|
|
82
|
-
const { join } = await import('node:path');
|
|
83
|
-
const registry = await getRegistry();
|
|
84
|
-
const mod = registry.get(integration);
|
|
85
|
-
if (!mod)
|
|
86
|
-
return false;
|
|
87
|
-
const config = mod.config;
|
|
88
|
-
// For JS integrations, check package.json
|
|
89
|
-
if (config.metadata.language === 'javascript') {
|
|
90
|
-
// Without a package.json, no JS integration can match. Skip silently so
|
|
91
|
-
// non-JS integrations (Python/Django, Ruby, Go, ...) still get a chance —
|
|
92
|
-
// getPackageDotJson would otherwise call process.exit(1).
|
|
93
|
-
if (!existsSync(join(options.installDir, 'package.json'))) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
const packageJson = await getPackageDotJson(options);
|
|
97
|
-
switch (integration) {
|
|
98
|
-
case 'nextjs':
|
|
99
|
-
return hasPackageInstalled('next', packageJson);
|
|
100
|
-
case 'tanstack-start':
|
|
101
|
-
return hasPackageInstalled('@tanstack/react-start', packageJson);
|
|
102
|
-
case 'react-router':
|
|
103
|
-
return hasPackageInstalled('react-router', packageJson);
|
|
104
|
-
case 'react': {
|
|
105
|
-
const hasReact = hasPackageInstalled('react', packageJson);
|
|
106
|
-
const hasNext = hasPackageInstalled('next', packageJson);
|
|
107
|
-
const hasReactRouter = hasPackageInstalled('react-router', packageJson);
|
|
108
|
-
const hasTanstack = hasPackageInstalled('@tanstack/react-start', packageJson);
|
|
109
|
-
const hasSvelteKit = hasPackageInstalled('@sveltejs/kit', packageJson);
|
|
110
|
-
return hasReact && !hasNext && !hasReactRouter && !hasTanstack && !hasSvelteKit;
|
|
111
|
-
}
|
|
112
|
-
case 'sveltekit':
|
|
113
|
-
return hasPackageInstalled('@sveltejs/kit', packageJson);
|
|
114
|
-
case 'node': {
|
|
115
|
-
const hasExpress = hasPackageInstalled('express', packageJson);
|
|
116
|
-
const hasFrontend = hasPackageInstalled('next', packageJson) ||
|
|
117
|
-
hasPackageInstalled('@sveltejs/kit', packageJson) ||
|
|
118
|
-
hasPackageInstalled('react', packageJson) ||
|
|
119
|
-
hasPackageInstalled('@tanstack/react-start', packageJson);
|
|
120
|
-
return hasExpress && !hasFrontend;
|
|
121
|
-
}
|
|
122
|
-
case 'vanilla-js':
|
|
123
|
-
return true; // Fallback
|
|
124
|
-
default:
|
|
125
|
-
// Unknown JS integration — try package name detection
|
|
126
|
-
return hasPackageInstalled(config.detection.packageName, packageJson);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// For non-JS integrations, prefer a custom detect() if provided
|
|
130
|
-
// (e.g., Django matches manage.py | pyproject.toml | requirements.txt),
|
|
131
|
-
// otherwise fall back to manifest file existence.
|
|
132
|
-
if (config.metadata.detect) {
|
|
133
|
-
return await config.metadata.detect(options);
|
|
134
|
-
}
|
|
135
|
-
if (config.metadata.manifestFile) {
|
|
136
|
-
return existsSync(join(options.installDir, config.metadata.manifestFile));
|
|
137
|
-
}
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
export async function runWithCore(options) {
|
|
141
|
-
// Initialize debug/logging early so we capture all failures
|
|
142
|
-
initLogFile();
|
|
143
|
-
if (options.debug) {
|
|
144
|
-
enableDebugLogs();
|
|
145
|
-
}
|
|
146
|
-
logInfo('Wizard starting with options:', {
|
|
147
|
-
debug: options.debug,
|
|
148
|
-
dashboard: options.dashboard,
|
|
149
|
-
local: options.local,
|
|
150
|
-
ci: options.ci,
|
|
151
|
-
skipAuth: options.skipAuth,
|
|
152
|
-
installDir: options.installDir,
|
|
153
|
-
});
|
|
154
|
-
// Configure telemetry endpoint separately from the LLM gateway proxy.
|
|
155
|
-
const gatewayUrl = getTelemetryUrl();
|
|
156
|
-
analytics.setGatewayUrl(gatewayUrl);
|
|
157
|
-
const existingCreds = readExistingCredentials(options.installDir);
|
|
158
|
-
const augmentedOptions = {
|
|
159
|
-
...options,
|
|
160
|
-
apiKey: options.apiKey || existingCreds.apiKey,
|
|
161
|
-
clientId: options.clientId || existingCreds.clientId,
|
|
162
|
-
};
|
|
163
|
-
const emitter = createInstallerEventEmitter();
|
|
164
|
-
let actor = null;
|
|
165
|
-
const sendEvent = (event) => {
|
|
166
|
-
if (actor) {
|
|
167
|
-
actor.send(event);
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
const nonHumanMode = isAgentMode() || isCiMode();
|
|
171
|
-
if (nonHumanMode && !isJsonMode()) {
|
|
172
|
-
setOutputMode(resolveEffectiveOutputMode(getOutputMode(), getInteractionMode()));
|
|
173
|
-
}
|
|
174
|
-
// Headless (no prompts, structured output) is for MACHINE output only: JSON.
|
|
175
|
-
// A prompt cannot render into a JSON stream, so any JSON run must be headless.
|
|
176
|
-
// We deliberately do NOT route a human session with non-TTY stdin here:
|
|
177
|
-
// headless auto-approves branch/commit/scaffold, and applying those unattended
|
|
178
|
-
// to a session the user never opted into would violate the "nothing is written
|
|
179
|
-
// until you confirm" contract. Those sessions keep the CLIAdapter, which now
|
|
180
|
-
// fails fast with a clear `prompt_unavailable` error on the first prompt
|
|
181
|
-
// (see CLIAdapter's handler-error catch) instead of hanging or auto-writing.
|
|
182
|
-
// --dashboard keeps its own adapter even under --json.
|
|
183
|
-
const headlessMode = isJsonMode() && !options.dashboard;
|
|
184
|
-
let adapter;
|
|
185
|
-
if (headlessMode) {
|
|
186
|
-
const { HeadlessAdapter } = await import('./adapters/headless-adapter.js');
|
|
187
|
-
adapter = new HeadlessAdapter({
|
|
188
|
-
emitter,
|
|
189
|
-
sendEvent,
|
|
190
|
-
debug: augmentedOptions.debug,
|
|
191
|
-
options: {
|
|
192
|
-
apiKey: augmentedOptions.apiKey,
|
|
193
|
-
clientId: augmentedOptions.clientId,
|
|
194
|
-
noBranch: augmentedOptions.noBranch,
|
|
195
|
-
noCommit: augmentedOptions.noCommit,
|
|
196
|
-
createPr: augmentedOptions.createPr,
|
|
197
|
-
noGitCheck: augmentedOptions.noGitCheck,
|
|
198
|
-
ci: augmentedOptions.ci,
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
else if (options.dashboard) {
|
|
203
|
-
adapter = new DashboardAdapter({ emitter, sendEvent, debug: augmentedOptions.debug });
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
adapter = new CLIAdapter({ emitter, sendEvent, debug: augmentedOptions.debug });
|
|
207
|
-
}
|
|
208
|
-
const machineWithActors = installerMachine.provide({
|
|
209
|
-
actors: {
|
|
210
|
-
checkAuthentication: fromPromise(async () => {
|
|
211
|
-
// Check for active environment with credentials (covers unclaimed environments).
|
|
212
|
-
const activeEnv = getActiveEnvironment();
|
|
213
|
-
if (activeEnv?.apiKey) {
|
|
214
|
-
return true;
|
|
215
|
-
}
|
|
216
|
-
const token = getAccessToken();
|
|
217
|
-
if (!token) {
|
|
218
|
-
// This should rarely happen since bin.ts handles auth first
|
|
219
|
-
// But keep as safety net for programmatic usage
|
|
220
|
-
throw new Error(`Not authenticated. Run \`${formatWorkOSCommand('auth login')}\` first.`);
|
|
221
|
-
}
|
|
222
|
-
return true;
|
|
223
|
-
}),
|
|
224
|
-
checkWorkspace: fromPromise(async ({ input }) => {
|
|
225
|
-
const scaffoldable = await isScaffoldableEmptyDir(input.options.installDir);
|
|
226
|
-
const packageManager = resolvePackageManager({
|
|
227
|
-
pm: input.options.pm,
|
|
228
|
-
userAgent: process.env.npm_config_user_agent,
|
|
229
|
-
});
|
|
230
|
-
// headlessMode is computed above; --scaffold opts in during interactive runs.
|
|
231
|
-
const autoScaffold = scaffoldable && (headlessMode || !!input.options.scaffold);
|
|
232
|
-
return { scaffoldable, packageManager, autoScaffold };
|
|
233
|
-
}),
|
|
234
|
-
runScaffold: fromPromise(async ({ input }) => {
|
|
235
|
-
const { options: installerOptions, packageManager, emitter: ctxEmitter } = input.context;
|
|
236
|
-
await runCreateNextApp({
|
|
237
|
-
installDir: installerOptions.installDir,
|
|
238
|
-
packageManager: packageManager ?? 'npm',
|
|
239
|
-
emitter: ctxEmitter,
|
|
240
|
-
});
|
|
241
|
-
}),
|
|
242
|
-
detectIntegration: fromPromise(async ({ input }) => {
|
|
243
|
-
const integration = await detectIntegrationFn({ installDir: input.options.installDir });
|
|
244
|
-
return { integration };
|
|
245
|
-
}),
|
|
246
|
-
checkGitStatus: fromPromise(async () => {
|
|
247
|
-
if (!isInGitRepo()) {
|
|
248
|
-
return { isClean: true, files: [] };
|
|
249
|
-
}
|
|
250
|
-
const files = getUncommittedOrUntrackedFiles();
|
|
251
|
-
return { isClean: files.length === 0, files };
|
|
252
|
-
}),
|
|
253
|
-
configureEnvironment: fromPromise(async ({ input }) => {
|
|
254
|
-
const { context } = input;
|
|
255
|
-
const { options: installerOptions, integration, credentials } = context;
|
|
256
|
-
if (!integration || !credentials) {
|
|
257
|
-
throw new Error('Missing integration or credentials');
|
|
258
|
-
}
|
|
259
|
-
// Non-JS integrations own their env file writing (e.g. Python writes
|
|
260
|
-
// .env inside its own run()). Skip here so we don't leak a .env.local
|
|
261
|
-
// with JS-flavored vars (WORKOS_COOKIE_PASSWORD, wrong redirect port).
|
|
262
|
-
const registry = await getRegistry();
|
|
263
|
-
const mod = registry.get(integration);
|
|
264
|
-
if (mod?.config.metadata.language !== 'javascript') {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
const port = detectPort(integration, installerOptions.installDir);
|
|
268
|
-
const callbackPath = getCallbackPath(integration);
|
|
269
|
-
const redirectUri = installerOptions.redirectUri || `http://localhost:${port}${callbackPath}`;
|
|
270
|
-
const requiresApiKey = ['nextjs', 'tanstack-start', 'react-router'].includes(integration);
|
|
271
|
-
if (credentials.apiKey && requiresApiKey) {
|
|
272
|
-
await autoConfigureWorkOSEnvironment(credentials.apiKey, integration, port, {
|
|
273
|
-
homepageUrl: installerOptions.homepageUrl,
|
|
274
|
-
redirectUri: installerOptions.redirectUri,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
const redirectUriKey = integration === 'nextjs' ? 'NEXT_PUBLIC_WORKOS_REDIRECT_URI' : 'WORKOS_REDIRECT_URI';
|
|
278
|
-
writeEnvLocal(installerOptions.installDir, {
|
|
279
|
-
...(credentials.apiKey ? { WORKOS_API_KEY: credentials.apiKey } : {}),
|
|
280
|
-
WORKOS_CLIENT_ID: credentials.clientId,
|
|
281
|
-
[redirectUriKey]: redirectUri,
|
|
282
|
-
});
|
|
283
|
-
}),
|
|
284
|
-
runAgent: fromPromise(async ({ input }) => {
|
|
285
|
-
const { context } = input;
|
|
286
|
-
const { options: installerOptions, integration, credentials } = context;
|
|
287
|
-
if (!integration) {
|
|
288
|
-
return { success: false, error: new Error('No integration specified') };
|
|
289
|
-
}
|
|
290
|
-
try {
|
|
291
|
-
const agentOptions = {
|
|
292
|
-
...installerOptions,
|
|
293
|
-
apiKey: credentials?.apiKey,
|
|
294
|
-
clientId: credentials?.clientId,
|
|
295
|
-
credentialSource: context.credentialSource,
|
|
296
|
-
emitter: context.emitter,
|
|
297
|
-
};
|
|
298
|
-
const summary = await runIntegrationInstallerFn(integration, agentOptions);
|
|
299
|
-
return {
|
|
300
|
-
success: true,
|
|
301
|
-
summary: summary || `Successfully installed WorkOS AuthKit for ${integration}!`,
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
catch (error) {
|
|
305
|
-
return {
|
|
306
|
-
success: false,
|
|
307
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
}),
|
|
311
|
-
buildCompletion: fromPromise(async ({ input }) => {
|
|
312
|
-
const { integration, changedFiles, options: installerOptions } = input.context;
|
|
313
|
-
if (!integration)
|
|
314
|
-
return undefined;
|
|
315
|
-
try {
|
|
316
|
-
const registry = await getRegistry();
|
|
317
|
-
const mod = registry.get(integration);
|
|
318
|
-
const cfg = mod?.config;
|
|
319
|
-
const settings = getInstallerSettings();
|
|
320
|
-
return await buildCompletionData({ integration, changedFiles, installDir: installerOptions.installDir }, {
|
|
321
|
-
resolveDevCommand,
|
|
322
|
-
detectPort,
|
|
323
|
-
docsUrl: cfg?.metadata.docsUrl ?? settings.documentation.workosDocsUrl,
|
|
324
|
-
dashboardUrl: settings.documentation.dashboardUrl,
|
|
325
|
-
frameworkNextSteps: cfg?.ui.getOutroNextSteps?.({}) ?? [],
|
|
326
|
-
signInSnippet: cfg?.ui.getSignInSnippet?.({}),
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
catch {
|
|
330
|
-
// Degrade to the static fallback box rather than blocking completion.
|
|
331
|
-
return undefined;
|
|
332
|
-
}
|
|
333
|
-
}),
|
|
334
|
-
// Credential discovery actors
|
|
335
|
-
detectEnvFiles: fromPromise(async ({ input }) => {
|
|
336
|
-
return checkForEnvFiles(input.installDir);
|
|
337
|
-
}),
|
|
338
|
-
scanEnvFiles: fromPromise(async ({ input }) => {
|
|
339
|
-
return discoverCredentials(input.installDir);
|
|
340
|
-
}),
|
|
341
|
-
checkStoredAuth: fromPromise(async () => {
|
|
342
|
-
const activeEnv = getActiveEnvironment();
|
|
343
|
-
if (activeEnv?.apiKey && isUnclaimedEnvironment(activeEnv)) {
|
|
344
|
-
return true;
|
|
345
|
-
}
|
|
346
|
-
const token = getAccessToken();
|
|
347
|
-
return token !== null;
|
|
348
|
-
}),
|
|
349
|
-
runDeviceAuth: fromPromise(async ({ input }) => {
|
|
350
|
-
const clientId = getCliAuthClientId();
|
|
351
|
-
const authkitDomain = getAuthkitDomain();
|
|
352
|
-
const deviceAuth = await requestDeviceCode({
|
|
353
|
-
clientId,
|
|
354
|
-
authkitDomain,
|
|
355
|
-
});
|
|
356
|
-
// Emit device started event with verification info
|
|
357
|
-
input.emitter.emit('device:started', {
|
|
358
|
-
verificationUri: deviceAuth.verification_uri,
|
|
359
|
-
verificationUriComplete: deviceAuth.verification_uri_complete,
|
|
360
|
-
userCode: deviceAuth.user_code,
|
|
361
|
-
});
|
|
362
|
-
// Open browser
|
|
363
|
-
try {
|
|
364
|
-
const { default: openFn } = await import('open');
|
|
365
|
-
await openFn(deviceAuth.verification_uri_complete, { wait: false });
|
|
366
|
-
}
|
|
367
|
-
catch (error) {
|
|
368
|
-
observeHostFailure('browser-launch', error, {
|
|
369
|
-
operation: 'open',
|
|
370
|
-
target: deviceAuth.verification_uri_complete,
|
|
371
|
-
label: 'installer device auth browser',
|
|
372
|
-
});
|
|
373
|
-
// User can open manually
|
|
374
|
-
}
|
|
375
|
-
const result = await pollForToken(deviceAuth.device_code, {
|
|
376
|
-
clientId,
|
|
377
|
-
authkitDomain,
|
|
378
|
-
interval: deviceAuth.interval,
|
|
379
|
-
onPoll: () => input.emitter.emit('device:polling', {}),
|
|
380
|
-
});
|
|
381
|
-
// Save the auth token
|
|
382
|
-
saveCredentials({
|
|
383
|
-
accessToken: result.accessToken,
|
|
384
|
-
expiresAt: result.expiresAt,
|
|
385
|
-
userId: result.userId,
|
|
386
|
-
email: result.email,
|
|
387
|
-
refreshToken: result.refreshToken,
|
|
388
|
-
});
|
|
389
|
-
return { result, deviceAuth };
|
|
390
|
-
}),
|
|
391
|
-
fetchStagingCredentials: fromPromise(async () => {
|
|
392
|
-
const activeEnv = getActiveEnvironment();
|
|
393
|
-
if (activeEnv?.clientId && activeEnv?.apiKey) {
|
|
394
|
-
return { clientId: activeEnv.clientId, apiKey: activeEnv.apiKey };
|
|
395
|
-
}
|
|
396
|
-
const cached = getStagingCredentials();
|
|
397
|
-
if (cached)
|
|
398
|
-
return cached;
|
|
399
|
-
const token = getAccessToken();
|
|
400
|
-
if (!token)
|
|
401
|
-
throw new Error('No access token available');
|
|
402
|
-
const staging = await fetchStagingCredentialsApi(token);
|
|
403
|
-
saveStagingCredentials(staging);
|
|
404
|
-
try {
|
|
405
|
-
const config = getConfig() ?? { environments: {} };
|
|
406
|
-
if (!config.environments['default']) {
|
|
407
|
-
config.environments['default'] = {
|
|
408
|
-
name: 'default',
|
|
409
|
-
type: staging.apiKey.startsWith('sk_test_') ? 'sandbox' : 'production',
|
|
410
|
-
apiKey: staging.apiKey,
|
|
411
|
-
clientId: staging.clientId,
|
|
412
|
-
};
|
|
413
|
-
if (!config.activeEnvironment) {
|
|
414
|
-
config.activeEnvironment = 'default';
|
|
415
|
-
}
|
|
416
|
-
saveConfig(config);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
catch {
|
|
420
|
-
// Don't block install if config-store write fails
|
|
421
|
-
}
|
|
422
|
-
return staging;
|
|
423
|
-
}),
|
|
424
|
-
// Branch check actors
|
|
425
|
-
checkBranch: fromPromise(async () => {
|
|
426
|
-
const branch = getCurrentBranch();
|
|
427
|
-
if (!branch) {
|
|
428
|
-
return { branch: null, isProtected: false };
|
|
429
|
-
}
|
|
430
|
-
return {
|
|
431
|
-
branch,
|
|
432
|
-
isProtected: isProtectedBranch(branch),
|
|
433
|
-
};
|
|
434
|
-
}),
|
|
435
|
-
createBranch: fromPromise(async ({ input }) => {
|
|
436
|
-
const { name, fallbackName } = input;
|
|
437
|
-
const targetBranch = branchExists(name) ? fallbackName : name;
|
|
438
|
-
createGitBranch(targetBranch);
|
|
439
|
-
return { branch: targetBranch };
|
|
440
|
-
}),
|
|
441
|
-
// Post-install actors
|
|
442
|
-
detectChanges: fromPromise(async () => {
|
|
443
|
-
return detectChanges();
|
|
444
|
-
}),
|
|
445
|
-
generateCommitMessage: fromPromise(async ({ input }) => {
|
|
446
|
-
return generateCommitMessageAi(input.integration, input.files, { direct: input.direct });
|
|
447
|
-
}),
|
|
448
|
-
commitChanges: fromPromise(async ({ input }) => {
|
|
449
|
-
stageAndCommit(input.message, input.cwd);
|
|
450
|
-
}),
|
|
451
|
-
generatePrDescription: fromPromise(async ({ input }) => {
|
|
452
|
-
return generatePrDescriptionAi(input.integration, input.files, input.commitMessage, { direct: input.direct });
|
|
453
|
-
}),
|
|
454
|
-
pushBranch: fromPromise(async ({ input }) => {
|
|
455
|
-
pushGitBranch(input.cwd);
|
|
456
|
-
}),
|
|
457
|
-
createPr: fromPromise(async ({ input }) => {
|
|
458
|
-
return createPullRequest(input.title, input.body, input.cwd);
|
|
459
|
-
}),
|
|
460
|
-
},
|
|
461
|
-
});
|
|
462
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
463
|
-
let inspector;
|
|
464
|
-
if (augmentedOptions.inspect) {
|
|
465
|
-
const originalLog = console.log;
|
|
466
|
-
let inspectUrl;
|
|
467
|
-
console.log = (...args) => {
|
|
468
|
-
const msg = args.join(' ');
|
|
469
|
-
if (typeof msg === 'string' && msg.startsWith('https://stately.ai/inspect/')) {
|
|
470
|
-
inspectUrl = msg;
|
|
471
|
-
console.log = originalLog;
|
|
472
|
-
console.log(`Opening XState inspector: ${inspectUrl}`);
|
|
473
|
-
void open(inspectUrl).catch((error) => {
|
|
474
|
-
observeHostFailure('browser-launch', error, {
|
|
475
|
-
operation: 'open',
|
|
476
|
-
target: inspectUrl,
|
|
477
|
-
label: 'XState inspector browser',
|
|
478
|
-
});
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
originalLog.apply(console, args);
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
// Dynamic import - @statelyai/inspect is a devDependency
|
|
486
|
-
const { createSkyInspector } = await import('@statelyai/inspect');
|
|
487
|
-
inspector = createSkyInspector();
|
|
488
|
-
setTimeout(() => {
|
|
489
|
-
console.log = originalLog;
|
|
490
|
-
}, 5000).unref();
|
|
491
|
-
}
|
|
492
|
-
actor = createActor(machineWithActors, {
|
|
493
|
-
input: { emitter, options: augmentedOptions },
|
|
494
|
-
inspect: inspector?.inspect,
|
|
495
|
-
});
|
|
496
|
-
await adapter.start();
|
|
497
|
-
analytics.configureAuthFromAvailableSources();
|
|
498
|
-
const mode = headlessMode ? 'headless' : augmentedOptions.dashboard ? 'tui' : 'cli';
|
|
499
|
-
analytics.sessionStart(mode, getVersion());
|
|
500
|
-
let installerStatus = 'success';
|
|
501
|
-
// Handle ctrl+c by sending CANCEL to state machine for graceful shutdown
|
|
502
|
-
const handleSigint = () => {
|
|
503
|
-
installerStatus = 'cancelled';
|
|
504
|
-
actor?.send({ type: 'CANCEL' });
|
|
505
|
-
};
|
|
506
|
-
process.on('SIGINT', handleSigint);
|
|
507
|
-
try {
|
|
508
|
-
await new Promise((resolve, reject) => {
|
|
509
|
-
actor.subscribe({
|
|
510
|
-
complete: () => {
|
|
511
|
-
const snapshot = actor.getSnapshot();
|
|
512
|
-
if (snapshot.value === 'error') {
|
|
513
|
-
const err = snapshot.context.error;
|
|
514
|
-
installerStatus = 'error';
|
|
515
|
-
reject(err ?? new Error('Wizard failed'));
|
|
516
|
-
}
|
|
517
|
-
else if (snapshot.value === 'cancelled') {
|
|
518
|
-
installerStatus = 'cancelled';
|
|
519
|
-
resolve();
|
|
520
|
-
}
|
|
521
|
-
else {
|
|
522
|
-
resolve();
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
error: (err) => {
|
|
526
|
-
installerStatus = 'error';
|
|
527
|
-
reject(err);
|
|
528
|
-
},
|
|
529
|
-
});
|
|
530
|
-
actor.start();
|
|
531
|
-
actor.send({ type: 'START' });
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
catch (error) {
|
|
535
|
-
installerStatus = 'error';
|
|
536
|
-
logError('Wizard failed with error:', error instanceof Error ? error.stack || error.message : String(error));
|
|
537
|
-
throw error;
|
|
538
|
-
}
|
|
539
|
-
finally {
|
|
540
|
-
process.off('SIGINT', handleSigint);
|
|
541
|
-
// Record the detected framework so session.end carries it (and the API can
|
|
542
|
-
// tag install metrics by integration). Known only after detection runs, so
|
|
543
|
-
// it's read from the final machine snapshot here; absent if the session
|
|
544
|
-
// aborted before detection.
|
|
545
|
-
const finalContext = actor?.getSnapshot().context;
|
|
546
|
-
const detectedIntegration = finalContext?.integration;
|
|
547
|
-
if (detectedIntegration) {
|
|
548
|
-
analytics.setTag('installer.integration', detectedIntegration);
|
|
549
|
-
}
|
|
550
|
-
// Record whether the empty-dir flow scaffolded a new app, so session.end
|
|
551
|
-
// carries it for adoption + scaffold-failure tracking.
|
|
552
|
-
if (finalContext?.scaffolded) {
|
|
553
|
-
analytics.setTag('scaffolded', true);
|
|
554
|
-
}
|
|
555
|
-
await analytics.shutdown(installerStatus);
|
|
556
|
-
await adapter.stop();
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
//# sourceMappingURL=run-with-core.js.map
|