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,641 +0,0 @@
|
|
|
1
|
-
import { relative } from 'node:path';
|
|
2
|
-
import ui, { PromptUnavailableError } from '../../utils/ui.js';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { getConfig } from '../settings.js';
|
|
5
|
-
import { ProgressTracker } from '../progress-tracker.js';
|
|
6
|
-
import { renderCompletionSummary, renderBrandMark } from '../../utils/summary-box.js';
|
|
7
|
-
import { formatWorkOSCommand } from '../../utils/command-invocation.js';
|
|
8
|
-
/**
|
|
9
|
-
* CLI adapter that renders wizard events via ui.
|
|
10
|
-
*
|
|
11
|
-
* Subscribes to InstallerEventEmitter and translates events into
|
|
12
|
-
* UI facade operations (logs, spinners, prompts).
|
|
13
|
-
*/
|
|
14
|
-
export class CLIAdapter {
|
|
15
|
-
emitter;
|
|
16
|
-
sendEvent;
|
|
17
|
-
debug;
|
|
18
|
-
spinner = null;
|
|
19
|
-
isStarted = false;
|
|
20
|
-
progress = new ProgressTracker();
|
|
21
|
-
// Scaffold (empty-dir) state, used to print a "next steps" hint on completion.
|
|
22
|
-
scaffolded = false;
|
|
23
|
-
scaffoldPackageManager = 'npm';
|
|
24
|
-
// Store bound handlers for cleanup
|
|
25
|
-
handlers = new Map();
|
|
26
|
-
// Queue for logs while prompt is active (parallel state issue)
|
|
27
|
-
isPromptActive = false;
|
|
28
|
-
pendingLogs = [];
|
|
29
|
-
// SIGINT handler for cleanup
|
|
30
|
-
sigIntHandler = null;
|
|
31
|
-
// Aborts in-flight/queued prompts when the run ends (cancellation, ctrl-c).
|
|
32
|
-
// The installer's `preparing` state can queue a second prompt behind a live
|
|
33
|
-
// one (git-dirty + protected-branch); if the first is cancelled, this signal
|
|
34
|
-
// stops the queued sibling from opening a now-moot question.
|
|
35
|
-
promptAbort = null;
|
|
36
|
-
// Last phase message shown on the agent spinner, restored after logging above it.
|
|
37
|
-
lastAgentMessage = 'Running AI agent...';
|
|
38
|
-
// Last file path rendered as a step line, to dedupe consecutive same-path ops.
|
|
39
|
-
lastFileOp = null;
|
|
40
|
-
constructor(config) {
|
|
41
|
-
this.emitter = config.emitter;
|
|
42
|
-
this.sendEvent = config.sendEvent;
|
|
43
|
-
this.debug = config.debug ?? false;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Queue a log call if a prompt is active, otherwise execute immediately.
|
|
47
|
-
*/
|
|
48
|
-
queueableLog(logFn) {
|
|
49
|
-
if (this.isPromptActive) {
|
|
50
|
-
this.pendingLogs.push(logFn);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
logFn();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Flush any queued logs after prompt completes.
|
|
58
|
-
*/
|
|
59
|
-
flushPendingLogs() {
|
|
60
|
-
const logs = this.pendingLogs.splice(0);
|
|
61
|
-
logs.forEach((fn) => fn());
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Run a prompt with the log queue engaged: mark a prompt active so async log
|
|
65
|
-
* events (detection:complete, branch:created, …) buffer instead of scribbling
|
|
66
|
-
* over the question, then release and flush once it resolves. Wraps every
|
|
67
|
-
* prompt handler so the active/flush lifecycle lives in one place.
|
|
68
|
-
*/
|
|
69
|
-
async withPromptActive(run) {
|
|
70
|
-
this.isPromptActive = true;
|
|
71
|
-
try {
|
|
72
|
-
return await run();
|
|
73
|
-
}
|
|
74
|
-
finally {
|
|
75
|
-
this.isPromptActive = false;
|
|
76
|
-
this.flushPendingLogs();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
async start() {
|
|
80
|
-
if (this.isStarted)
|
|
81
|
-
return;
|
|
82
|
-
this.isStarted = true;
|
|
83
|
-
this.promptAbort = new AbortController();
|
|
84
|
-
// Show intro
|
|
85
|
-
const config = getConfig();
|
|
86
|
-
if (config.branding.showAsciiArt) {
|
|
87
|
-
// Compact brand mark (the lock + wordmark) instead of the full block banner.
|
|
88
|
-
console.log('');
|
|
89
|
-
console.log(renderBrandMark('AuthKit installer'));
|
|
90
|
-
console.log('');
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
ui.intro('WorkOS', 'AuthKit installer');
|
|
94
|
-
}
|
|
95
|
-
// Handle Ctrl+C gracefully
|
|
96
|
-
const handleSigInt = () => {
|
|
97
|
-
this.promptAbort?.abort();
|
|
98
|
-
if (this.spinner) {
|
|
99
|
-
this.spinner.stop('Cancelled');
|
|
100
|
-
this.spinner = null;
|
|
101
|
-
}
|
|
102
|
-
ui.log.warn('Installer cancelled');
|
|
103
|
-
ui.outro('Your project was not modified');
|
|
104
|
-
process.exit(0);
|
|
105
|
-
};
|
|
106
|
-
process.on('SIGINT', handleSigInt);
|
|
107
|
-
this.sigIntHandler = handleSigInt;
|
|
108
|
-
// Subscribe to state events for progress tracking
|
|
109
|
-
this.subscribe('state:enter', this.handleStateEnter);
|
|
110
|
-
this.subscribe('state:exit', this.handleStateExit);
|
|
111
|
-
// Subscribe to events that require UI rendering
|
|
112
|
-
this.subscribe('auth:success', this.handleAuthSuccess);
|
|
113
|
-
this.subscribe('auth:failure', this.handleAuthFailure);
|
|
114
|
-
this.subscribe('detection:complete', this.handleDetectionComplete);
|
|
115
|
-
this.subscribe('detection:none', this.handleDetectionNone);
|
|
116
|
-
this.subscribe('git:dirty', this.handleGitDirty);
|
|
117
|
-
this.subscribe('credentials:found', this.handleCredentialsFound);
|
|
118
|
-
this.subscribe('credentials:request', this.handleCredentialsRequest);
|
|
119
|
-
this.subscribe('credentials:env:prompt', this.handleEnvScanPrompt);
|
|
120
|
-
this.subscribe('device:started', this.handleDeviceStarted);
|
|
121
|
-
this.subscribe('device:success', this.handleDeviceSuccess);
|
|
122
|
-
this.subscribe('device:error', this.handleDeviceError);
|
|
123
|
-
this.subscribe('device:timeout', this.handleDeviceTimeout);
|
|
124
|
-
this.subscribe('staging:fetching', this.handleStagingFetching);
|
|
125
|
-
this.subscribe('staging:success', this.handleStagingSuccess);
|
|
126
|
-
this.subscribe('staging:error', this.handleStagingError);
|
|
127
|
-
this.subscribe('credentials:env:found', this.handleEnvCredentialsFound);
|
|
128
|
-
this.subscribe('config:complete', this.handleConfigComplete);
|
|
129
|
-
this.subscribe('agent:start', this.handleAgentStart);
|
|
130
|
-
this.subscribe('agent:progress', this.handleAgentProgress);
|
|
131
|
-
// Persistent, append-only log of file operations + tool calls above the spinner.
|
|
132
|
-
this.subscribe('file:write', this.handleFileWrite);
|
|
133
|
-
this.subscribe('file:edit', this.handleFileEdit);
|
|
134
|
-
this.subscribe('agent:tool', this.handleAgentTool);
|
|
135
|
-
this.subscribe('validation:start', this.handleValidationStart);
|
|
136
|
-
this.subscribe('validation:issues', this.handleValidationIssues);
|
|
137
|
-
this.subscribe('validation:complete', this.handleValidationComplete);
|
|
138
|
-
this.subscribe('complete', this.handleComplete);
|
|
139
|
-
this.subscribe('error', this.handleError);
|
|
140
|
-
// Scaffold events (empty-directory app scaffolding)
|
|
141
|
-
this.subscribe('scaffold:prompt', this.handleScaffoldPrompt);
|
|
142
|
-
this.subscribe('scaffold:start', this.handleScaffoldStart);
|
|
143
|
-
this.subscribe('scaffold:progress', this.handleScaffoldProgress);
|
|
144
|
-
this.subscribe('scaffold:complete', this.handleScaffoldComplete);
|
|
145
|
-
this.subscribe('scaffold:failed', this.handleScaffoldFailed);
|
|
146
|
-
// Branch check events
|
|
147
|
-
this.subscribe('branch:prompt', this.handleBranchPrompt);
|
|
148
|
-
this.subscribe('branch:created', this.handleBranchCreated);
|
|
149
|
-
// Post-install events
|
|
150
|
-
this.subscribe('postinstall:changes', this.handlePostInstallChanges);
|
|
151
|
-
this.subscribe('postinstall:commit:prompt', this.handleCommitPrompt);
|
|
152
|
-
this.subscribe('postinstall:commit:generating', this.handleCommitGenerating);
|
|
153
|
-
this.subscribe('postinstall:commit:success', this.handleCommitSuccess);
|
|
154
|
-
this.subscribe('postinstall:commit:failed', this.handleCommitFailed);
|
|
155
|
-
this.subscribe('postinstall:pr:prompt', this.handlePrPrompt);
|
|
156
|
-
this.subscribe('postinstall:pr:generating', this.handlePrGenerating);
|
|
157
|
-
this.subscribe('postinstall:pr:pushing', this.handlePrPushing);
|
|
158
|
-
this.subscribe('postinstall:pr:success', this.handlePrSuccess);
|
|
159
|
-
this.subscribe('postinstall:pr:failed', this.handlePrFailed);
|
|
160
|
-
this.subscribe('postinstall:push:failed', this.handlePushFailed);
|
|
161
|
-
this.subscribe('postinstall:manual', this.handleManualInstructions);
|
|
162
|
-
}
|
|
163
|
-
async stop() {
|
|
164
|
-
if (!this.isStarted)
|
|
165
|
-
return;
|
|
166
|
-
// Abort any in-flight/queued prompt so a cancelled run can't leave a
|
|
167
|
-
// now-moot sibling question open (e.g. the branch prompt after git-cancel).
|
|
168
|
-
this.promptAbort?.abort();
|
|
169
|
-
this.promptAbort = null;
|
|
170
|
-
// Remove SIGINT handler
|
|
171
|
-
if (this.sigIntHandler) {
|
|
172
|
-
process.off('SIGINT', this.sigIntHandler);
|
|
173
|
-
this.sigIntHandler = null;
|
|
174
|
-
}
|
|
175
|
-
// Unsubscribe from all events
|
|
176
|
-
for (const [event, handler] of this.handlers) {
|
|
177
|
-
this.emitter.off(event, handler);
|
|
178
|
-
}
|
|
179
|
-
this.handlers.clear();
|
|
180
|
-
// Stop any active spinner
|
|
181
|
-
this.spinner?.stop();
|
|
182
|
-
this.spinner = null;
|
|
183
|
-
this.isStarted = false;
|
|
184
|
-
}
|
|
185
|
-
stopSpinner(message, code = 0) {
|
|
186
|
-
if (this.spinner) {
|
|
187
|
-
this.spinner.stop(message, code);
|
|
188
|
-
this.spinner = null;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
/** Debug logging - only outputs when debug mode is enabled */
|
|
192
|
-
debugLog = (message) => {
|
|
193
|
-
if (this.debug) {
|
|
194
|
-
console.log(chalk.dim(`[debug] ${message}`));
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* Helper to subscribe and track handlers for cleanup.
|
|
199
|
-
*/
|
|
200
|
-
subscribe(event, handler) {
|
|
201
|
-
const boundHandler = handler.bind(this);
|
|
202
|
-
// Handlers are invoked fire-and-forget by a plain EventEmitter, so an async
|
|
203
|
-
// rejection would become an unhandledRejection (silent crash). Route a
|
|
204
|
-
// PromptUnavailableError (prompt attempted where the user can't answer) to a
|
|
205
|
-
// clean fail-fast; re-surface anything else unchanged so real bugs still crash.
|
|
206
|
-
const safeHandler = (payload) => {
|
|
207
|
-
try {
|
|
208
|
-
const result = boundHandler(payload);
|
|
209
|
-
if (result instanceof Promise)
|
|
210
|
-
result.catch((err) => this.onHandlerError(err));
|
|
211
|
-
}
|
|
212
|
-
catch (err) {
|
|
213
|
-
this.onHandlerError(err);
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
this.handlers.set(event, safeHandler);
|
|
217
|
-
this.emitter.on(event, safeHandler);
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Terminal handler failure. A PromptUnavailableError means we reached a prompt
|
|
221
|
-
* in a context that can't answer it (non-TTY stdin) — the CLIAdapter only runs
|
|
222
|
-
* in human, non-JSON output, so this is always a real human at a broken input,
|
|
223
|
-
* never a JSON stream. Surface a clear message and exit before anything is
|
|
224
|
-
* written, rather than hanging or crashing. Re-throw anything else.
|
|
225
|
-
*/
|
|
226
|
-
onHandlerError = (error) => {
|
|
227
|
-
if (error instanceof PromptUnavailableError) {
|
|
228
|
-
this.spinner?.clear();
|
|
229
|
-
this.spinner = null;
|
|
230
|
-
ui.log.error(error.message);
|
|
231
|
-
ui.log.hint('Re-run in an interactive terminal, or pass the flags that answer these prompts.');
|
|
232
|
-
// Exit 1 (general error), matching the direct-command classification of
|
|
233
|
-
// this same error in bin.ts. NOT 4 — that's "auth required" (gh
|
|
234
|
-
// convention), which would send scripts into an auth-retry loop.
|
|
235
|
-
process.exit(1);
|
|
236
|
-
}
|
|
237
|
-
throw error;
|
|
238
|
-
};
|
|
239
|
-
// ===== Event Handlers =====
|
|
240
|
-
handleStateEnter = ({ state }) => {
|
|
241
|
-
this.progress.enterPhase(state);
|
|
242
|
-
};
|
|
243
|
-
handleStateExit = ({ state }) => {
|
|
244
|
-
this.progress.exitPhase(state);
|
|
245
|
-
};
|
|
246
|
-
handleAuthSuccess = () => {
|
|
247
|
-
ui.log.success('Authenticated');
|
|
248
|
-
};
|
|
249
|
-
handleAuthFailure = ({ message }) => {
|
|
250
|
-
ui.log.error(`Auth failed: ${message}`);
|
|
251
|
-
ui.log.info('Visit https://dashboard.workos.com to verify your account');
|
|
252
|
-
};
|
|
253
|
-
handleDetectionComplete = ({ integration }) => {
|
|
254
|
-
this.queueableLog(() => ui.log.success(`Detected ${chalk.bold(integration)}`));
|
|
255
|
-
};
|
|
256
|
-
handleDetectionNone = () => {
|
|
257
|
-
this.queueableLog(() => ui.log.warn('Could not detect framework automatically'));
|
|
258
|
-
};
|
|
259
|
-
handleCredentialsFound = () => {
|
|
260
|
-
ui.log.success('Found existing WorkOS credentials in .env.local');
|
|
261
|
-
};
|
|
262
|
-
handleEnvScanPrompt = async ({ files }) => {
|
|
263
|
-
const fileList = files.length === 1 ? files[0] : files.slice(0, 2).join(', ');
|
|
264
|
-
const confirmed = await this.withPromptActive(() => ui.confirm({
|
|
265
|
-
message: `Found ${fileList}. Check for existing WorkOS credentials?`,
|
|
266
|
-
initialValue: true,
|
|
267
|
-
}));
|
|
268
|
-
this.sendEvent({
|
|
269
|
-
type: ui.isCancel(confirmed) || !confirmed ? 'ENV_SCAN_DECLINED' : 'ENV_SCAN_APPROVED',
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
handleDeviceStarted = ({ verificationUri, userCode }) => {
|
|
273
|
-
ui.log.info(`\nOpen this URL in your browser:\n`);
|
|
274
|
-
console.log(` ${chalk.cyan(verificationUri)}`);
|
|
275
|
-
console.log(`\nEnter code: ${chalk.bold(userCode)}\n`);
|
|
276
|
-
this.spinner = ui.spinner();
|
|
277
|
-
this.spinner.start('Waiting for authentication...');
|
|
278
|
-
};
|
|
279
|
-
handleDeviceSuccess = () => {
|
|
280
|
-
// Spinner will be stopped by handleStagingFetching
|
|
281
|
-
};
|
|
282
|
-
handleStagingFetching = () => {
|
|
283
|
-
if (this.spinner) {
|
|
284
|
-
this.spinner.stop('Authenticated');
|
|
285
|
-
}
|
|
286
|
-
this.spinner = ui.spinner();
|
|
287
|
-
this.spinner.start('Fetching your WorkOS credentials...');
|
|
288
|
-
};
|
|
289
|
-
handleStagingSuccess = ({ source }) => {
|
|
290
|
-
if (source === 'device') {
|
|
291
|
-
this.stopSpinner('Environment ready');
|
|
292
|
-
ui.log.success('Set up a WorkOS environment for this install');
|
|
293
|
-
}
|
|
294
|
-
else if (source === 'stored') {
|
|
295
|
-
this.stopSpinner('Using active environment');
|
|
296
|
-
ui.log.success('Using your active WorkOS environment');
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
this.stopSpinner('Environment ready');
|
|
300
|
-
ui.log.success('Using your WorkOS environment');
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
handleEnvCredentialsFound = ({ sourcePath }) => {
|
|
304
|
-
ui.log.success(`Found existing WorkOS credentials in ${sourcePath}`);
|
|
305
|
-
};
|
|
306
|
-
// Automatic auth / credential fetch can fail and fall back to manual entry.
|
|
307
|
-
// These finalize the spinner with a failure glyph so it isn't left spinning
|
|
308
|
-
// (orphaned) over the manual-credentials prompt that follows.
|
|
309
|
-
handleDeviceError = ({ message }) => {
|
|
310
|
-
this.stopSpinner('Automatic sign-in failed', 1);
|
|
311
|
-
if (this.debug)
|
|
312
|
-
this.debugLog(`[device:error] ${message}`);
|
|
313
|
-
};
|
|
314
|
-
handleDeviceTimeout = () => {
|
|
315
|
-
this.stopSpinner('Sign-in timed out', 1);
|
|
316
|
-
};
|
|
317
|
-
handleStagingError = ({ message }) => {
|
|
318
|
-
this.stopSpinner('Could not fetch WorkOS credentials', 1);
|
|
319
|
-
if (this.debug)
|
|
320
|
-
this.debugLog(`[staging:error] ${message}`);
|
|
321
|
-
};
|
|
322
|
-
handleGitDirty = async ({ files }) => {
|
|
323
|
-
ui.log.warn('You have uncommitted or untracked files:');
|
|
324
|
-
files.slice(0, 5).forEach((f) => ui.log.info(chalk.dim(` ${f}`)));
|
|
325
|
-
if (files.length > 5) {
|
|
326
|
-
ui.log.info(chalk.dim(` ... and ${files.length - 5} more`));
|
|
327
|
-
}
|
|
328
|
-
const confirmed = await this.withPromptActive(() => ui.confirm({
|
|
329
|
-
message: 'Continue anyway?',
|
|
330
|
-
initialValue: false,
|
|
331
|
-
signal: this.promptAbort?.signal,
|
|
332
|
-
}));
|
|
333
|
-
this.sendEvent({
|
|
334
|
-
type: ui.isCancel(confirmed) || !confirmed ? 'GIT_CANCELLED' : 'GIT_CONFIRMED',
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
handleCredentialsRequest = async ({ requiresApiKey, }) => {
|
|
338
|
-
// Guaranteed chokepoint: promptingManual is the fallback for any auth path,
|
|
339
|
-
// so clear any still-running spinner before the prompt opens (defense in
|
|
340
|
-
// depth on top of the device/staging error handlers and withPrompt's pause).
|
|
341
|
-
this.spinner?.clear();
|
|
342
|
-
this.spinner = null;
|
|
343
|
-
ui.log.step(`Get your credentials from ${chalk.cyan('https://dashboard.workos.com')}`);
|
|
344
|
-
const clientId = await ui.text({
|
|
345
|
-
message: 'Enter your WorkOS Client ID:',
|
|
346
|
-
placeholder: 'client_...',
|
|
347
|
-
validate: (value) => {
|
|
348
|
-
if (!value || value.trim().length === 0) {
|
|
349
|
-
return 'Client ID is required';
|
|
350
|
-
}
|
|
351
|
-
if (!value.startsWith('client_')) {
|
|
352
|
-
return 'Client ID should start with "client_"';
|
|
353
|
-
}
|
|
354
|
-
return undefined;
|
|
355
|
-
},
|
|
356
|
-
});
|
|
357
|
-
if (ui.isCancel(clientId)) {
|
|
358
|
-
this.sendEvent({ type: 'CANCEL' });
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
let apiKey = '';
|
|
362
|
-
if (requiresApiKey) {
|
|
363
|
-
ui.log.info(chalk.dim('ℹ️ Your API key will be hidden for security and saved to .env.local'));
|
|
364
|
-
const apiKeyResult = await ui.password({
|
|
365
|
-
message: 'Enter your WorkOS API Key:',
|
|
366
|
-
validate: (value) => {
|
|
367
|
-
if (!value || value.trim().length === 0) {
|
|
368
|
-
return 'API Key is required';
|
|
369
|
-
}
|
|
370
|
-
if (!value.startsWith('sk_')) {
|
|
371
|
-
return 'API Key should start with "sk_"';
|
|
372
|
-
}
|
|
373
|
-
return undefined;
|
|
374
|
-
},
|
|
375
|
-
});
|
|
376
|
-
if (ui.isCancel(apiKeyResult)) {
|
|
377
|
-
this.sendEvent({ type: 'CANCEL' });
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
apiKey = apiKeyResult;
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
ui.log.info(chalk.dim('ℹ️ Client-only SDK - API key not required'));
|
|
384
|
-
}
|
|
385
|
-
this.sendEvent({
|
|
386
|
-
type: 'CREDENTIALS_SUBMITTED',
|
|
387
|
-
apiKey,
|
|
388
|
-
clientId: clientId,
|
|
389
|
-
});
|
|
390
|
-
};
|
|
391
|
-
handleConfigComplete = () => {
|
|
392
|
-
ui.log.success('Environment configured');
|
|
393
|
-
};
|
|
394
|
-
handleAgentStart = () => {
|
|
395
|
-
this.spinner = ui.spinner();
|
|
396
|
-
this.spinner.start(this.lastAgentMessage);
|
|
397
|
-
// No setInterval: ui animates its own frames, and the old 2s reset
|
|
398
|
-
// clobbered the current phase text set by handleAgentProgress.
|
|
399
|
-
};
|
|
400
|
-
handleAgentProgress = ({ step, detail }) => {
|
|
401
|
-
const message = detail ? `${step}: ${detail}` : step;
|
|
402
|
-
this.lastAgentMessage = message;
|
|
403
|
-
this.spinner?.message(message);
|
|
404
|
-
};
|
|
405
|
-
/**
|
|
406
|
-
* Render a persistent line above the running spinner: stop the spinner to
|
|
407
|
-
* finalize its line, emit the log, then restart it on the last phase message.
|
|
408
|
-
* Mirrors the existing stop→log and stop→start-new-spinner precedents.
|
|
409
|
-
*/
|
|
410
|
-
logAboveSpinner(render) {
|
|
411
|
-
const wasRunning = this.spinner !== null;
|
|
412
|
-
this.spinner?.stop();
|
|
413
|
-
this.spinner = null;
|
|
414
|
-
render();
|
|
415
|
-
if (wasRunning) {
|
|
416
|
-
this.spinner = ui.spinner();
|
|
417
|
-
this.spinner.start(this.lastAgentMessage);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
logFileOp(verb, path) {
|
|
421
|
-
if (path === this.lastFileOp)
|
|
422
|
-
return; // dedupe consecutive same-path ops
|
|
423
|
-
this.lastFileOp = path;
|
|
424
|
-
const rel = relative(process.cwd(), path);
|
|
425
|
-
this.logAboveSpinner(() => ui.log.step(`${verb} ${chalk.dim(rel)}`));
|
|
426
|
-
}
|
|
427
|
-
handleFileWrite = ({ path }) => {
|
|
428
|
-
this.logFileOp('Creating', path);
|
|
429
|
-
};
|
|
430
|
-
handleFileEdit = ({ path }) => {
|
|
431
|
-
this.logFileOp('Editing', path);
|
|
432
|
-
};
|
|
433
|
-
handleAgentTool = ({ detail }) => {
|
|
434
|
-
const cmd = detail.length > 80 ? `${detail.slice(0, 77)}…` : detail;
|
|
435
|
-
this.logAboveSpinner(() => ui.log.step(`Running ${chalk.dim(cmd)}`));
|
|
436
|
-
};
|
|
437
|
-
handleValidationStart = () => {
|
|
438
|
-
this.stopSpinner('Agent completed');
|
|
439
|
-
};
|
|
440
|
-
handleValidationIssues = ({ issues }) => {
|
|
441
|
-
for (const issue of issues) {
|
|
442
|
-
if (issue.severity === 'error') {
|
|
443
|
-
ui.log.error(issue.message);
|
|
444
|
-
}
|
|
445
|
-
else {
|
|
446
|
-
ui.log.warn(issue.message);
|
|
447
|
-
}
|
|
448
|
-
if (issue.hint) {
|
|
449
|
-
ui.log.info(`Hint: ${issue.hint}`);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
handleValidationComplete = ({ passed, issueCount }) => {
|
|
454
|
-
if (passed) {
|
|
455
|
-
ui.log.success('Validation passed');
|
|
456
|
-
}
|
|
457
|
-
else {
|
|
458
|
-
ui.log.warn(`Validation found ${issueCount} issue(s)`);
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
handleComplete = ({ success, summary, completion }) => {
|
|
462
|
-
// Fires synchronously during the cancelled-state transition (emitCancelled),
|
|
463
|
-
// BEFORE a queued sibling prompt's microtask runs — so aborting here makes a
|
|
464
|
-
// cancelled run's still-queued prompt (e.g. the branch select after a
|
|
465
|
-
// git-dirty "No") open with an already-aborted signal and resolve to CANCEL
|
|
466
|
-
// without ever rendering a now-moot question.
|
|
467
|
-
this.promptAbort?.abort();
|
|
468
|
-
this.stopSpinner(success ? 'Done' : 'Failed');
|
|
469
|
-
console.log('');
|
|
470
|
-
console.log(renderCompletionSummary(success, summary, completion));
|
|
471
|
-
console.log('');
|
|
472
|
-
// When we scaffolded a fresh app, the install ran in the current dir, so
|
|
473
|
-
// point the user straight at the dev server.
|
|
474
|
-
if (success && this.scaffolded) {
|
|
475
|
-
ui.log.info(`Start your app: ${chalk.cyan(`${this.scaffoldPackageManager} run dev`)}`);
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
handleError = ({ message, stack }) => {
|
|
479
|
-
this.stopSpinner('Failed', 1);
|
|
480
|
-
// Rewrite raw API/SDK errors into user-friendly messages with a next step.
|
|
481
|
-
// Matching is word-boundary / code-based so 'author' doesn't read as 'auth'
|
|
482
|
-
// and 'Module not found' doesn't read as a missing-directory error.
|
|
483
|
-
const isServiceError = /\b50[0-9]\b/.test(message) || /server_error|internal_error|overloaded|service.*unavailable/i.test(message);
|
|
484
|
-
const isRateLimit = /\b429\b/.test(message) || /\brate.?limit/i.test(message);
|
|
485
|
-
const isNetworkError = /ECONNREFUSED|ETIMEDOUT|ENOTFOUND|fetch failed/i.test(message);
|
|
486
|
-
const isProcessExit = /process exited with code/i.test(message);
|
|
487
|
-
const isAuthError = /\b(401|403|unauthorized|forbidden|authentication|authorization)\b/i.test(message);
|
|
488
|
-
const isMissingPath = /\bENOENT\b/.test(message);
|
|
489
|
-
if (isServiceError) {
|
|
490
|
-
ui.log.error('The AI service is temporarily unavailable.');
|
|
491
|
-
ui.log.info('This is usually resolved within a few minutes. Please try again shortly.');
|
|
492
|
-
}
|
|
493
|
-
else if (isRateLimit) {
|
|
494
|
-
ui.log.error('The AI service is currently rate-limited.');
|
|
495
|
-
ui.log.info('Please wait a minute and try again.');
|
|
496
|
-
}
|
|
497
|
-
else if (isNetworkError) {
|
|
498
|
-
ui.log.error('Could not connect to the AI service.');
|
|
499
|
-
ui.log.info('Check your internet connection and try again.');
|
|
500
|
-
}
|
|
501
|
-
else if (isProcessExit) {
|
|
502
|
-
ui.log.error('The AI agent process exited unexpectedly.');
|
|
503
|
-
ui.log.info('Try running again. If this persists, run with --debug for details.');
|
|
504
|
-
}
|
|
505
|
-
else if (isAuthError) {
|
|
506
|
-
ui.log.error('Authentication failed.');
|
|
507
|
-
ui.log.info(`Try running: ${formatWorkOSCommand('auth logout')} && ${formatWorkOSCommand('install')}`);
|
|
508
|
-
}
|
|
509
|
-
else if (isMissingPath) {
|
|
510
|
-
ui.log.error(message);
|
|
511
|
-
ui.log.info('Make sure you are running this in your project directory.');
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
// Unknown error: still give the user somewhere to go next.
|
|
515
|
-
ui.log.error(message);
|
|
516
|
-
ui.log.info(`Re-run with ${chalk.cyan('--debug')} for details, or report it at ${chalk.cyan('https://github.com/workos/cli/issues')}`);
|
|
517
|
-
}
|
|
518
|
-
if (stack && this.debug) {
|
|
519
|
-
this.debugLog(stack);
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
// ===== Scaffold Event Handlers =====
|
|
523
|
-
handleScaffoldPrompt = async ({ packageManager }) => {
|
|
524
|
-
this.scaffoldPackageManager = packageManager;
|
|
525
|
-
const confirmed = await this.withPromptActive(() => ui.confirm({
|
|
526
|
-
message: 'This directory is empty. Scaffold a new Next.js app with AuthKit here?',
|
|
527
|
-
initialValue: true,
|
|
528
|
-
}));
|
|
529
|
-
this.sendEvent({
|
|
530
|
-
type: ui.isCancel(confirmed) || !confirmed ? 'SCAFFOLD_CANCELLED' : 'SCAFFOLD_CONFIRMED',
|
|
531
|
-
});
|
|
532
|
-
};
|
|
533
|
-
handleScaffoldStart = ({ packageManager }) => {
|
|
534
|
-
this.scaffoldPackageManager = packageManager;
|
|
535
|
-
this.spinner = ui.spinner();
|
|
536
|
-
this.spinner.start(`Scaffolding a new Next.js app with ${packageManager} (this can take a minute)...`);
|
|
537
|
-
};
|
|
538
|
-
// create-next-app output is verbose; surface it only under --debug and keep
|
|
539
|
-
// the spinner message stable so the CLI stays readable.
|
|
540
|
-
handleScaffoldProgress = ({ text }) => {
|
|
541
|
-
const line = text.trim();
|
|
542
|
-
if (line) {
|
|
543
|
-
this.debugLog(line);
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
handleScaffoldComplete = () => {
|
|
547
|
-
this.scaffolded = true;
|
|
548
|
-
this.stopSpinner('Next.js app created');
|
|
549
|
-
};
|
|
550
|
-
handleScaffoldFailed = ({ error }) => {
|
|
551
|
-
this.stopSpinner('Scaffold failed');
|
|
552
|
-
ui.log.error(`Could not scaffold the app: ${error}`);
|
|
553
|
-
};
|
|
554
|
-
handleBranchPrompt = async ({ branch }) => {
|
|
555
|
-
const choice = await this.withPromptActive(() => ui.select({
|
|
556
|
-
message: `You are on ${chalk.bold(branch)}. Create a feature branch?`,
|
|
557
|
-
options: [
|
|
558
|
-
{ value: 'create', label: 'Create feat/add-workos-authkit' },
|
|
559
|
-
{ value: 'continue', label: 'Continue on current branch' },
|
|
560
|
-
{ value: 'cancel', label: 'Cancel' },
|
|
561
|
-
],
|
|
562
|
-
signal: this.promptAbort?.signal,
|
|
563
|
-
}));
|
|
564
|
-
if (ui.isCancel(choice) || choice === 'cancel') {
|
|
565
|
-
this.sendEvent({ type: 'BRANCH_CANCEL' });
|
|
566
|
-
}
|
|
567
|
-
else if (choice === 'create') {
|
|
568
|
-
this.sendEvent({ type: 'BRANCH_CREATE' });
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
this.sendEvent({ type: 'BRANCH_CONTINUE' });
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
handleBranchCreated = ({ branch }) => {
|
|
575
|
-
this.queueableLog(() => ui.log.success(`Created branch ${chalk.bold(branch)}`));
|
|
576
|
-
};
|
|
577
|
-
// ===== Post-install Event Handlers =====
|
|
578
|
-
handlePostInstallChanges = ({ files }) => {
|
|
579
|
-
this.debugLog(`Post-install: ${files.length} changed files detected`);
|
|
580
|
-
};
|
|
581
|
-
handleCommitPrompt = async () => {
|
|
582
|
-
const confirmed = await this.withPromptActive(() => ui.confirm({
|
|
583
|
-
message: 'Commit the changes?',
|
|
584
|
-
initialValue: true,
|
|
585
|
-
}));
|
|
586
|
-
this.sendEvent({
|
|
587
|
-
type: ui.isCancel(confirmed) || !confirmed ? 'COMMIT_DECLINED' : 'COMMIT_APPROVED',
|
|
588
|
-
});
|
|
589
|
-
};
|
|
590
|
-
handleCommitGenerating = () => {
|
|
591
|
-
this.spinner = ui.spinner();
|
|
592
|
-
this.spinner.start('Generating commit message...');
|
|
593
|
-
};
|
|
594
|
-
handleCommitSuccess = ({ message }) => {
|
|
595
|
-
this.stopSpinner('Committed');
|
|
596
|
-
ui.log.success(`Committed: ${chalk.dim(message)}`);
|
|
597
|
-
};
|
|
598
|
-
handleCommitFailed = ({ error }) => {
|
|
599
|
-
this.stopSpinner('Commit failed');
|
|
600
|
-
ui.log.error(`Commit failed: ${error}`);
|
|
601
|
-
};
|
|
602
|
-
handlePrPrompt = async () => {
|
|
603
|
-
const confirmed = await this.withPromptActive(() => ui.confirm({
|
|
604
|
-
message: 'Create a pull request?',
|
|
605
|
-
initialValue: true,
|
|
606
|
-
}));
|
|
607
|
-
this.sendEvent({
|
|
608
|
-
type: ui.isCancel(confirmed) || !confirmed ? 'PR_DECLINED' : 'PR_APPROVED',
|
|
609
|
-
});
|
|
610
|
-
};
|
|
611
|
-
handlePrGenerating = () => {
|
|
612
|
-
this.spinner = ui.spinner();
|
|
613
|
-
this.spinner.start('Generating PR description...');
|
|
614
|
-
};
|
|
615
|
-
handlePrPushing = () => {
|
|
616
|
-
if (this.spinner) {
|
|
617
|
-
this.spinner.message('Pushing to remote...');
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
this.spinner = ui.spinner();
|
|
621
|
-
this.spinner.start('Pushing to remote...');
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
handlePrSuccess = ({ url }) => {
|
|
625
|
-
this.stopSpinner('PR created');
|
|
626
|
-
ui.log.success(`Pull request created: ${chalk.cyan(url)}`);
|
|
627
|
-
};
|
|
628
|
-
handlePrFailed = ({ error }) => {
|
|
629
|
-
this.stopSpinner('PR creation failed');
|
|
630
|
-
ui.log.error(`PR creation failed: ${error}`);
|
|
631
|
-
};
|
|
632
|
-
handlePushFailed = ({ error }) => {
|
|
633
|
-
this.stopSpinner('Push failed');
|
|
634
|
-
ui.log.error(`Push failed: ${error}`);
|
|
635
|
-
};
|
|
636
|
-
handleManualInstructions = ({ instructions }) => {
|
|
637
|
-
ui.log.info('GitHub CLI not found. Manual steps:');
|
|
638
|
-
console.log(chalk.dim(instructions));
|
|
639
|
-
};
|
|
640
|
-
}
|
|
641
|
-
//# sourceMappingURL=cli-adapter.js.map
|