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
package/dist/lib/events.d.ts
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
/**
|
|
3
|
-
* Structured data describing a successful installation, used to render the
|
|
4
|
-
* completion summary and enrich the headless `complete` NDJSON event.
|
|
5
|
-
*
|
|
6
|
-
* Defined here (not in installer-core.types.ts) to avoid an import cycle:
|
|
7
|
-
* installer-core.types.ts already imports from this module, so this module
|
|
8
|
-
* must not import back.
|
|
9
|
-
*/
|
|
10
|
-
export interface CompletionData {
|
|
11
|
-
/** Integration identifier (e.g. 'nextjs') */
|
|
12
|
-
integration: string;
|
|
13
|
-
/** Lockfile-aware dev command, e.g. "pnpm run dev" */
|
|
14
|
-
devCommand: string;
|
|
15
|
-
/** App URL with the detected port, e.g. "http://localhost:3000" */
|
|
16
|
-
url: string;
|
|
17
|
-
/** Changed files (git-relative), full list — display cap lives in the renderer */
|
|
18
|
-
files: string[];
|
|
19
|
-
/** Composed concrete + framework next-step lines */
|
|
20
|
-
nextSteps: string[];
|
|
21
|
-
/** Per-framework docs URL */
|
|
22
|
-
docsUrl: string;
|
|
23
|
-
/** WorkOS dashboard URL */
|
|
24
|
-
dashboardUrl: string;
|
|
25
|
-
/** Optional per-framework "add a sign-in link" snippet */
|
|
26
|
-
signInSnippet?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface InstallerEvents {
|
|
29
|
-
status: {
|
|
30
|
-
message: string;
|
|
31
|
-
};
|
|
32
|
-
output: {
|
|
33
|
-
text: string;
|
|
34
|
-
isError?: boolean;
|
|
35
|
-
};
|
|
36
|
-
'file:write': {
|
|
37
|
-
path: string;
|
|
38
|
-
content: string;
|
|
39
|
-
};
|
|
40
|
-
'file:edit': {
|
|
41
|
-
path: string;
|
|
42
|
-
oldContent: string;
|
|
43
|
-
newContent: string;
|
|
44
|
-
};
|
|
45
|
-
'prompt:request': {
|
|
46
|
-
id: string;
|
|
47
|
-
message: string;
|
|
48
|
-
options?: string[];
|
|
49
|
-
};
|
|
50
|
-
'prompt:response': {
|
|
51
|
-
id: string;
|
|
52
|
-
value: string;
|
|
53
|
-
};
|
|
54
|
-
'confirm:request': {
|
|
55
|
-
id: string;
|
|
56
|
-
message: string;
|
|
57
|
-
warning?: string;
|
|
58
|
-
files?: string[];
|
|
59
|
-
};
|
|
60
|
-
'confirm:response': {
|
|
61
|
-
id: string;
|
|
62
|
-
confirmed: boolean;
|
|
63
|
-
};
|
|
64
|
-
'credentials:request': {
|
|
65
|
-
requiresApiKey: boolean;
|
|
66
|
-
};
|
|
67
|
-
'credentials:response': {
|
|
68
|
-
apiKey: string;
|
|
69
|
-
clientId: string;
|
|
70
|
-
};
|
|
71
|
-
complete: {
|
|
72
|
-
success: boolean;
|
|
73
|
-
summary?: string;
|
|
74
|
-
completion?: CompletionData;
|
|
75
|
-
};
|
|
76
|
-
error: {
|
|
77
|
-
message: string;
|
|
78
|
-
stack?: string;
|
|
79
|
-
};
|
|
80
|
-
'state:enter': {
|
|
81
|
-
state: string;
|
|
82
|
-
};
|
|
83
|
-
'state:exit': {
|
|
84
|
-
state: string;
|
|
85
|
-
};
|
|
86
|
-
'auth:checking': Record<string, never>;
|
|
87
|
-
'auth:required': Record<string, never>;
|
|
88
|
-
'auth:success': Record<string, never>;
|
|
89
|
-
'auth:failure': {
|
|
90
|
-
message: string;
|
|
91
|
-
};
|
|
92
|
-
'detection:start': Record<string, never>;
|
|
93
|
-
'detection:complete': {
|
|
94
|
-
integration: string;
|
|
95
|
-
};
|
|
96
|
-
'detection:none': Record<string, never>;
|
|
97
|
-
'git:checking': Record<string, never>;
|
|
98
|
-
'git:clean': Record<string, never>;
|
|
99
|
-
'git:dirty': {
|
|
100
|
-
files: string[];
|
|
101
|
-
};
|
|
102
|
-
'git:dirty:confirmed': Record<string, never>;
|
|
103
|
-
'git:dirty:cancelled': Record<string, never>;
|
|
104
|
-
'credentials:gathering': {
|
|
105
|
-
requiresApiKey: boolean;
|
|
106
|
-
};
|
|
107
|
-
'credentials:found': Record<string, never>;
|
|
108
|
-
'credentials:env:detected': {
|
|
109
|
-
files: string[];
|
|
110
|
-
};
|
|
111
|
-
'credentials:env:prompt': {
|
|
112
|
-
files: string[];
|
|
113
|
-
};
|
|
114
|
-
'credentials:env:scanning': Record<string, never>;
|
|
115
|
-
'credentials:env:found': {
|
|
116
|
-
sourcePath: string;
|
|
117
|
-
};
|
|
118
|
-
'credentials:env:notfound': Record<string, never>;
|
|
119
|
-
'device:started': {
|
|
120
|
-
verificationUri: string;
|
|
121
|
-
verificationUriComplete: string;
|
|
122
|
-
userCode: string;
|
|
123
|
-
};
|
|
124
|
-
'device:polling': Record<string, never>;
|
|
125
|
-
'device:success': {
|
|
126
|
-
email?: string;
|
|
127
|
-
};
|
|
128
|
-
'device:timeout': Record<string, never>;
|
|
129
|
-
'device:error': {
|
|
130
|
-
message: string;
|
|
131
|
-
};
|
|
132
|
-
'staging:fetching': Record<string, never>;
|
|
133
|
-
'staging:success': {
|
|
134
|
-
source?: 'device' | 'stored';
|
|
135
|
-
};
|
|
136
|
-
'staging:error': {
|
|
137
|
-
message: string;
|
|
138
|
-
statusCode?: number;
|
|
139
|
-
};
|
|
140
|
-
'config:start': Record<string, never>;
|
|
141
|
-
'config:complete': Record<string, never>;
|
|
142
|
-
'agent:start': Record<string, never>;
|
|
143
|
-
'agent:progress': {
|
|
144
|
-
step: string;
|
|
145
|
-
detail?: string;
|
|
146
|
-
};
|
|
147
|
-
'agent:success': {
|
|
148
|
-
summary?: string;
|
|
149
|
-
};
|
|
150
|
-
'agent:failure': {
|
|
151
|
-
message: string;
|
|
152
|
-
stack?: string;
|
|
153
|
-
};
|
|
154
|
-
'agent:retry': {
|
|
155
|
-
attempt: number;
|
|
156
|
-
maxRetries: number;
|
|
157
|
-
};
|
|
158
|
-
'agent:tool': {
|
|
159
|
-
kind: 'command';
|
|
160
|
-
detail: string;
|
|
161
|
-
};
|
|
162
|
-
'validation:retry:start': {
|
|
163
|
-
attempt: number;
|
|
164
|
-
};
|
|
165
|
-
'validation:retry:complete': {
|
|
166
|
-
attempt: number;
|
|
167
|
-
passed: boolean;
|
|
168
|
-
};
|
|
169
|
-
'validation:start': {
|
|
170
|
-
framework: string;
|
|
171
|
-
};
|
|
172
|
-
'validation:issues': {
|
|
173
|
-
issues: import('./validation/types.js').ValidationIssue[];
|
|
174
|
-
};
|
|
175
|
-
'validation:complete': {
|
|
176
|
-
passed: boolean;
|
|
177
|
-
issueCount: number;
|
|
178
|
-
durationMs: number;
|
|
179
|
-
};
|
|
180
|
-
'scaffold:checking': Record<string, never>;
|
|
181
|
-
'scaffold:prompt': {
|
|
182
|
-
packageManager: string;
|
|
183
|
-
};
|
|
184
|
-
'scaffold:start': {
|
|
185
|
-
packageManager: string;
|
|
186
|
-
};
|
|
187
|
-
'scaffold:progress': {
|
|
188
|
-
text: string;
|
|
189
|
-
};
|
|
190
|
-
'scaffold:complete': Record<string, never>;
|
|
191
|
-
'scaffold:failed': {
|
|
192
|
-
error: string;
|
|
193
|
-
};
|
|
194
|
-
'scaffold:skipped': Record<string, never>;
|
|
195
|
-
'branch:checking': Record<string, never>;
|
|
196
|
-
'branch:protected': {
|
|
197
|
-
branch: string;
|
|
198
|
-
};
|
|
199
|
-
'branch:prompt': {
|
|
200
|
-
branch: string;
|
|
201
|
-
};
|
|
202
|
-
'branch:created': {
|
|
203
|
-
branch: string;
|
|
204
|
-
};
|
|
205
|
-
'branch:create:failed': {
|
|
206
|
-
error: string;
|
|
207
|
-
};
|
|
208
|
-
'branch:skipped': Record<string, never>;
|
|
209
|
-
'postinstall:changes': {
|
|
210
|
-
files: string[];
|
|
211
|
-
};
|
|
212
|
-
'postinstall:nochanges': Record<string, never>;
|
|
213
|
-
'postinstall:commit:prompt': Record<string, never>;
|
|
214
|
-
'postinstall:commit:generating': Record<string, never>;
|
|
215
|
-
'postinstall:commit:committing': {
|
|
216
|
-
message: string;
|
|
217
|
-
};
|
|
218
|
-
'postinstall:commit:success': {
|
|
219
|
-
message: string;
|
|
220
|
-
};
|
|
221
|
-
'postinstall:commit:failed': {
|
|
222
|
-
error: string;
|
|
223
|
-
};
|
|
224
|
-
'postinstall:pr:prompt': Record<string, never>;
|
|
225
|
-
'postinstall:pr:generating': Record<string, never>;
|
|
226
|
-
'postinstall:pr:pushing': Record<string, never>;
|
|
227
|
-
'postinstall:pr:creating': Record<string, never>;
|
|
228
|
-
'postinstall:pr:success': {
|
|
229
|
-
url: string;
|
|
230
|
-
};
|
|
231
|
-
'postinstall:pr:failed': {
|
|
232
|
-
error: string;
|
|
233
|
-
};
|
|
234
|
-
'postinstall:push:failed': {
|
|
235
|
-
error: string;
|
|
236
|
-
};
|
|
237
|
-
'postinstall:manual': {
|
|
238
|
-
instructions: string;
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
export type InstallerEventName = keyof InstallerEvents;
|
|
242
|
-
export declare class InstallerEventEmitter extends EventEmitter {
|
|
243
|
-
emit<K extends InstallerEventName>(event: K, payload: InstallerEvents[K]): boolean;
|
|
244
|
-
on<K extends InstallerEventName>(event: K, listener: (payload: InstallerEvents[K]) => void): this;
|
|
245
|
-
off<K extends InstallerEventName>(event: K, listener: (payload: InstallerEvents[K]) => void): this;
|
|
246
|
-
once<K extends InstallerEventName>(event: K, listener: (payload: InstallerEvents[K]) => void): this;
|
|
247
|
-
}
|
|
248
|
-
export declare function createInstallerEventEmitter(): InstallerEventEmitter;
|
package/dist/lib/events.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
export class InstallerEventEmitter extends EventEmitter {
|
|
3
|
-
emit(event, payload) {
|
|
4
|
-
return super.emit(event, payload);
|
|
5
|
-
}
|
|
6
|
-
on(event, listener) {
|
|
7
|
-
return super.on(event, listener);
|
|
8
|
-
}
|
|
9
|
-
off(event, listener) {
|
|
10
|
-
return super.off(event, listener);
|
|
11
|
-
}
|
|
12
|
-
once(event, listener) {
|
|
13
|
-
return super.once(event, listener);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export function createInstallerEventEmitter() {
|
|
17
|
-
return new InstallerEventEmitter();
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=events.js.map
|
package/dist/lib/events.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/lib/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAiItC,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACrD,IAAI,CAA+B,KAAQ,EAAE,OAA2B;QACtE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,EAAE,CAA+B,KAAQ,EAAE,QAA+C;QACxF,OAAO,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,GAAG,CAA+B,KAAQ,EAAE,QAA+C;QACzF,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAA+B,KAAQ,EAAE,QAA+C;QAC1F,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;CACF;AAED,MAAM,UAAU,2BAA2B;IACzC,OAAO,IAAI,qBAAqB,EAAE,CAAC;AACrC,CAAC","sourcesContent":["import { EventEmitter } from 'events';\n\n/**\n * Structured data describing a successful installation, used to render the\n * completion summary and enrich the headless `complete` NDJSON event.\n *\n * Defined here (not in installer-core.types.ts) to avoid an import cycle:\n * installer-core.types.ts already imports from this module, so this module\n * must not import back.\n */\nexport interface CompletionData {\n /** Integration identifier (e.g. 'nextjs') */\n integration: string;\n /** Lockfile-aware dev command, e.g. \"pnpm run dev\" */\n devCommand: string;\n /** App URL with the detected port, e.g. \"http://localhost:3000\" */\n url: string;\n /** Changed files (git-relative), full list — display cap lives in the renderer */\n files: string[];\n /** Composed concrete + framework next-step lines */\n nextSteps: string[];\n /** Per-framework docs URL */\n docsUrl: string;\n /** WorkOS dashboard URL */\n dashboardUrl: string;\n /** Optional per-framework \"add a sign-in link\" snippet */\n signInSnippet?: string;\n}\n\nexport interface InstallerEvents {\n status: { message: string };\n output: { text: string; isError?: boolean };\n 'file:write': { path: string; content: string };\n 'file:edit': { path: string; oldContent: string; newContent: string };\n 'prompt:request': { id: string; message: string; options?: string[] };\n 'prompt:response': { id: string; value: string };\n 'confirm:request': { id: string; message: string; warning?: string; files?: string[] };\n 'confirm:response': { id: string; confirmed: boolean };\n 'credentials:request': { requiresApiKey: boolean };\n 'credentials:response': { apiKey: string; clientId: string };\n complete: { success: boolean; summary?: string; completion?: CompletionData };\n error: { message: string; stack?: string };\n\n 'state:enter': { state: string };\n 'state:exit': { state: string };\n 'auth:checking': Record<string, never>;\n 'auth:required': Record<string, never>;\n 'auth:success': Record<string, never>;\n 'auth:failure': { message: string };\n 'detection:start': Record<string, never>;\n 'detection:complete': { integration: string };\n 'detection:none': Record<string, never>;\n 'git:checking': Record<string, never>;\n 'git:clean': Record<string, never>;\n 'git:dirty': { files: string[] };\n 'git:dirty:confirmed': Record<string, never>;\n 'git:dirty:cancelled': Record<string, never>;\n 'credentials:gathering': { requiresApiKey: boolean };\n 'credentials:found': Record<string, never>;\n // Credential discovery events\n 'credentials:env:detected': { files: string[] };\n 'credentials:env:prompt': { files: string[] };\n 'credentials:env:scanning': Record<string, never>;\n 'credentials:env:found': { sourcePath: string };\n 'credentials:env:notfound': Record<string, never>;\n // Device auth events\n 'device:started': { verificationUri: string; verificationUriComplete: string; userCode: string };\n 'device:polling': Record<string, never>;\n 'device:success': { email?: string };\n 'device:timeout': Record<string, never>;\n 'device:error': { message: string };\n // Staging API events\n 'staging:fetching': Record<string, never>;\n 'staging:success': { source?: 'device' | 'stored' };\n 'staging:error': { message: string; statusCode?: number };\n 'config:start': Record<string, never>;\n 'config:complete': Record<string, never>;\n 'agent:start': Record<string, never>;\n 'agent:progress': { step: string; detail?: string };\n 'agent:success': { summary?: string };\n 'agent:failure': { message: string; stack?: string };\n 'agent:retry': { attempt: number; maxRetries: number };\n // Surfaced agent tool activity (e.g. Bash commands run during install)\n 'agent:tool': { kind: 'command'; detail: string };\n\n 'validation:retry:start': { attempt: number };\n 'validation:retry:complete': { attempt: number; passed: boolean };\n\n 'validation:start': { framework: string };\n 'validation:issues': { issues: import('./validation/types.js').ValidationIssue[] };\n 'validation:complete': { passed: boolean; issueCount: number; durationMs: number };\n\n // Scaffold events (empty-directory app scaffolding)\n 'scaffold:checking': Record<string, never>;\n 'scaffold:prompt': { packageManager: string };\n 'scaffold:start': { packageManager: string };\n 'scaffold:progress': { text: string };\n 'scaffold:complete': Record<string, never>;\n 'scaffold:failed': { error: string };\n 'scaffold:skipped': Record<string, never>;\n\n // Branch check events\n 'branch:checking': Record<string, never>;\n 'branch:protected': { branch: string };\n 'branch:prompt': { branch: string };\n 'branch:created': { branch: string };\n 'branch:create:failed': { error: string };\n 'branch:skipped': Record<string, never>;\n\n // Post-install events\n 'postinstall:changes': { files: string[] };\n 'postinstall:nochanges': Record<string, never>;\n 'postinstall:commit:prompt': Record<string, never>;\n 'postinstall:commit:generating': Record<string, never>;\n 'postinstall:commit:committing': { message: string };\n 'postinstall:commit:success': { message: string };\n 'postinstall:commit:failed': { error: string };\n 'postinstall:pr:prompt': Record<string, never>;\n 'postinstall:pr:generating': Record<string, never>;\n 'postinstall:pr:pushing': Record<string, never>;\n 'postinstall:pr:creating': Record<string, never>;\n 'postinstall:pr:success': { url: string };\n 'postinstall:pr:failed': { error: string };\n 'postinstall:push:failed': { error: string };\n 'postinstall:manual': { instructions: string };\n}\n\nexport type InstallerEventName = keyof InstallerEvents;\n\nexport class InstallerEventEmitter extends EventEmitter {\n emit<K extends InstallerEventName>(event: K, payload: InstallerEvents[K]): boolean {\n return super.emit(event, payload);\n }\n\n on<K extends InstallerEventName>(event: K, listener: (payload: InstallerEvents[K]) => void): this {\n return super.on(event, listener);\n }\n\n off<K extends InstallerEventName>(event: K, listener: (payload: InstallerEvents[K]) => void): this {\n return super.off(event, listener);\n }\n\n once<K extends InstallerEventName>(event: K, listener: (payload: InstallerEvents[K]) => void): this {\n return super.once(event, listener);\n }\n}\n\nexport function createInstallerEventEmitter(): InstallerEventEmitter {\n return new InstallerEventEmitter();\n}\n"]}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import type { InstallerOptions } from '../utils/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Supported programming languages for framework integrations.
|
|
4
|
-
*/
|
|
5
|
-
export type Language = 'javascript' | 'python' | 'ruby' | 'php' | 'go' | 'kotlin' | 'dotnet' | 'elixir';
|
|
6
|
-
/**
|
|
7
|
-
* Configuration interface for framework-specific agent integrations.
|
|
8
|
-
* Each framework exports a FrameworkConfig that the universal runner uses.
|
|
9
|
-
*/
|
|
10
|
-
export interface FrameworkConfig {
|
|
11
|
-
metadata: FrameworkMetadata;
|
|
12
|
-
detection: FrameworkDetection;
|
|
13
|
-
environment: EnvironmentConfig;
|
|
14
|
-
analytics: AnalyticsConfig;
|
|
15
|
-
prompts: PromptConfig;
|
|
16
|
-
ui: UIConfig;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Basic framework information and documentation
|
|
20
|
-
*/
|
|
21
|
-
export interface FrameworkMetadata {
|
|
22
|
-
/** Display name (e.g., "Next.js", "React") */
|
|
23
|
-
name: string;
|
|
24
|
-
/** Integration identifier (e.g., 'nextjs', 'python'). String, not enum — auto-discovered from registry. */
|
|
25
|
-
integration: string;
|
|
26
|
-
/** URL to framework-specific WorkOS AuthKit docs */
|
|
27
|
-
docsUrl: string;
|
|
28
|
-
/**
|
|
29
|
-
* Optional URL to docs for users with unsupported framework versions.
|
|
30
|
-
* If not provided, defaults to docsUrl.
|
|
31
|
-
*/
|
|
32
|
-
unsupportedVersionDocsUrl?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Optional function to gather framework-specific context before agent runs.
|
|
35
|
-
* For Next.js: detects router type
|
|
36
|
-
* For React Native: detects Expo vs bare
|
|
37
|
-
*/
|
|
38
|
-
gatherContext?: (options: InstallerOptions) => Promise<Record<string, any>>;
|
|
39
|
-
/**
|
|
40
|
-
* Name of the framework-specific skill for agent integration.
|
|
41
|
-
* Skills are located in .claude/skills/{skillName}/SKILL.md
|
|
42
|
-
*/
|
|
43
|
-
skillName?: string;
|
|
44
|
-
/** Language ecosystem this integration belongs to */
|
|
45
|
-
language: Language;
|
|
46
|
-
/** Stability tier: 'stable' for tested integrations, 'experimental' for new ones */
|
|
47
|
-
stability: 'stable' | 'experimental';
|
|
48
|
-
/** Detection priority — higher numbers are checked first */
|
|
49
|
-
priority: number;
|
|
50
|
-
/** Default package manager command (e.g., 'pip', 'gem', 'go'). Optional for JS integrations. */
|
|
51
|
-
packageManager?: string;
|
|
52
|
-
/** Primary manifest file (e.g., 'pyproject.toml', 'Gemfile'). Optional for JS integrations. */
|
|
53
|
-
manifestFile?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Optional custom detection override for non-JS integrations. When present,
|
|
56
|
-
* the registry calls this instead of falling back to `manifestFile` existence.
|
|
57
|
-
* Use when a single manifest file isn't enough (e.g., Django projects may
|
|
58
|
-
* use `manage.py` + `requirements.txt` without a `pyproject.toml`).
|
|
59
|
-
*/
|
|
60
|
-
detect?: (options: Pick<InstallerOptions, 'installDir'>) => boolean | Promise<boolean>;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Framework detection and version handling
|
|
64
|
-
*/
|
|
65
|
-
export interface FrameworkDetection {
|
|
66
|
-
/** Package name to check in package.json (e.g., "next", "react") */
|
|
67
|
-
packageName: string;
|
|
68
|
-
/** Human-readable name for error messages (e.g., "Next.js") */
|
|
69
|
-
packageDisplayName: string;
|
|
70
|
-
/** Extract version from package.json */
|
|
71
|
-
getVersion: (packageJson: any) => string | undefined;
|
|
72
|
-
/** Optional: Convert version to analytics bucket (e.g., "15.x") */
|
|
73
|
-
getVersionBucket?: (version: string) => string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Environment variable configuration
|
|
77
|
-
*/
|
|
78
|
-
export interface EnvironmentConfig {
|
|
79
|
-
/** Whether to upload env vars to hosting providers post-agent */
|
|
80
|
-
uploadToHosting: boolean;
|
|
81
|
-
/** Whether this framework requires API key (false for client-only SDKs) */
|
|
82
|
-
requiresApiKey: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Build the environment variables object for this framework.
|
|
85
|
-
* Returns the exact variable names and values to upload to hosting providers.
|
|
86
|
-
*/
|
|
87
|
-
getEnvVars: (apiKey: string, clientId: string) => Record<string, string>;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Analytics configuration
|
|
91
|
-
*/
|
|
92
|
-
export interface AnalyticsConfig {
|
|
93
|
-
/** Generate tags from context (e.g., { 'nextjs-version': '15.x', 'router': 'app' }) */
|
|
94
|
-
getTags: (context: any) => Record<string, any>;
|
|
95
|
-
/** Optional: Additional event properties */
|
|
96
|
-
getEventProperties?: (context: any) => Record<string, any>;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Prompt configuration
|
|
100
|
-
*/
|
|
101
|
-
export interface PromptConfig {
|
|
102
|
-
/**
|
|
103
|
-
* Optional: Additional context lines to append to base prompt
|
|
104
|
-
* For Next.js: "- Router: app"
|
|
105
|
-
* For React Native: "- Platform: Expo"
|
|
106
|
-
*/
|
|
107
|
-
getAdditionalContextLines?: (context: any) => string[];
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* UI messaging configuration
|
|
111
|
-
*/
|
|
112
|
-
export interface UIConfig {
|
|
113
|
-
/** Success message when agent completes */
|
|
114
|
-
successMessage: string;
|
|
115
|
-
/** Generate "What the agent did" bullets from context */
|
|
116
|
-
getOutroChanges: (context: any) => string[];
|
|
117
|
-
/** Generate "Next steps" bullets from context */
|
|
118
|
-
getOutroNextSteps: (context: any) => string[];
|
|
119
|
-
/**
|
|
120
|
-
* Optional per-framework "add a sign-in link" snippet, surfaced as a next
|
|
121
|
-
* step in the completion summary. Only defined for frameworks that scaffold
|
|
122
|
-
* interactive auth UI. Copy must stay accurate to what the agent scaffolds.
|
|
123
|
-
*/
|
|
124
|
-
getSignInSnippet?: (context: any) => string;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Generate welcome message from framework name
|
|
128
|
-
*/
|
|
129
|
-
export declare function getWelcomeMessage(frameworkName: string): string;
|
|
130
|
-
/**
|
|
131
|
-
* Shared spinner message for all frameworks
|
|
132
|
-
*/
|
|
133
|
-
export declare const SPINNER_MESSAGE = "Setting up WorkOS AuthKit with login, authentication, and session management...";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate welcome message from framework name
|
|
3
|
-
*/
|
|
4
|
-
export function getWelcomeMessage(frameworkName) {
|
|
5
|
-
return `WorkOS AuthKit ${frameworkName} installer (agent-powered)`;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Shared spinner message for all frameworks
|
|
9
|
-
*/
|
|
10
|
-
export const SPINNER_MESSAGE = 'Setting up WorkOS AuthKit with login, authentication, and session management...';
|
|
11
|
-
//# sourceMappingURL=framework-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"framework-config.js","sourceRoot":"","sources":["../../src/lib/framework-config.ts"],"names":[],"mappings":"AA0JA;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,aAAqB;IACrD,OAAO,kBAAkB,aAAa,4BAA4B,CAAC;AACrE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,iFAAiF,CAAC","sourcesContent":["import type { InstallerOptions } from '../utils/types.js';\n\n/**\n * Supported programming languages for framework integrations.\n */\nexport type Language = 'javascript' | 'python' | 'ruby' | 'php' | 'go' | 'kotlin' | 'dotnet' | 'elixir';\n\n/**\n * Configuration interface for framework-specific agent integrations.\n * Each framework exports a FrameworkConfig that the universal runner uses.\n */\nexport interface FrameworkConfig {\n metadata: FrameworkMetadata;\n detection: FrameworkDetection;\n environment: EnvironmentConfig;\n analytics: AnalyticsConfig;\n prompts: PromptConfig;\n ui: UIConfig;\n}\n\n/**\n * Basic framework information and documentation\n */\nexport interface FrameworkMetadata {\n /** Display name (e.g., \"Next.js\", \"React\") */\n name: string;\n\n /** Integration identifier (e.g., 'nextjs', 'python'). String, not enum — auto-discovered from registry. */\n integration: string;\n\n /** URL to framework-specific WorkOS AuthKit docs */\n docsUrl: string;\n\n /**\n * Optional URL to docs for users with unsupported framework versions.\n * If not provided, defaults to docsUrl.\n */\n unsupportedVersionDocsUrl?: string;\n\n /**\n * Optional function to gather framework-specific context before agent runs.\n * For Next.js: detects router type\n * For React Native: detects Expo vs bare\n */\n gatherContext?: (options: InstallerOptions) => Promise<Record<string, any>>;\n\n /**\n * Name of the framework-specific skill for agent integration.\n * Skills are located in .claude/skills/{skillName}/SKILL.md\n */\n skillName?: string;\n\n /** Language ecosystem this integration belongs to */\n language: Language;\n\n /** Stability tier: 'stable' for tested integrations, 'experimental' for new ones */\n stability: 'stable' | 'experimental';\n\n /** Detection priority — higher numbers are checked first */\n priority: number;\n\n /** Default package manager command (e.g., 'pip', 'gem', 'go'). Optional for JS integrations. */\n packageManager?: string;\n\n /** Primary manifest file (e.g., 'pyproject.toml', 'Gemfile'). Optional for JS integrations. */\n manifestFile?: string;\n\n /**\n * Optional custom detection override for non-JS integrations. When present,\n * the registry calls this instead of falling back to `manifestFile` existence.\n * Use when a single manifest file isn't enough (e.g., Django projects may\n * use `manage.py` + `requirements.txt` without a `pyproject.toml`).\n */\n detect?: (options: Pick<InstallerOptions, 'installDir'>) => boolean | Promise<boolean>;\n}\n\n/**\n * Framework detection and version handling\n */\nexport interface FrameworkDetection {\n /** Package name to check in package.json (e.g., \"next\", \"react\") */\n packageName: string;\n\n /** Human-readable name for error messages (e.g., \"Next.js\") */\n packageDisplayName: string;\n\n /** Extract version from package.json */\n getVersion: (packageJson: any) => string | undefined;\n\n /** Optional: Convert version to analytics bucket (e.g., \"15.x\") */\n getVersionBucket?: (version: string) => string;\n}\n\n/**\n * Environment variable configuration\n */\nexport interface EnvironmentConfig {\n /** Whether to upload env vars to hosting providers post-agent */\n uploadToHosting: boolean;\n\n /** Whether this framework requires API key (false for client-only SDKs) */\n requiresApiKey: boolean;\n\n /**\n * Build the environment variables object for this framework.\n * Returns the exact variable names and values to upload to hosting providers.\n */\n getEnvVars: (apiKey: string, clientId: string) => Record<string, string>;\n}\n\n/**\n * Analytics configuration\n */\nexport interface AnalyticsConfig {\n /** Generate tags from context (e.g., { 'nextjs-version': '15.x', 'router': 'app' }) */\n getTags: (context: any) => Record<string, any>;\n\n /** Optional: Additional event properties */\n getEventProperties?: (context: any) => Record<string, any>;\n}\n\n/**\n * Prompt configuration\n */\nexport interface PromptConfig {\n /**\n * Optional: Additional context lines to append to base prompt\n * For Next.js: \"- Router: app\"\n * For React Native: \"- Platform: Expo\"\n */\n getAdditionalContextLines?: (context: any) => string[];\n}\n\n/**\n * UI messaging configuration\n */\nexport interface UIConfig {\n /** Success message when agent completes */\n successMessage: string;\n\n /** Generate \"What the agent did\" bullets from context */\n getOutroChanges: (context: any) => string[];\n\n /** Generate \"Next steps\" bullets from context */\n getOutroNextSteps: (context: any) => string[];\n\n /**\n * Optional per-framework \"add a sign-in link\" snippet, surfaced as a next\n * step in the completion summary. Only defined for frameworks that scaffold\n * interactive auth UI. Copy must stay accurate to what the agent scaffolds.\n */\n getSignInSnippet?: (context: any) => string;\n}\n\n/**\n * Generate welcome message from framework name\n */\nexport function getWelcomeMessage(frameworkName: string): string {\n return `WorkOS AuthKit ${frameworkName} installer (agent-powered)`;\n}\n\n/**\n * Shared spinner message for all frameworks\n */\nexport const SPINNER_MESSAGE = 'Setting up WorkOS AuthKit with login, authentication, and session management...';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper-functions.js","sourceRoot":"","sources":["../../src/lib/helper-functions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC","sourcesContent":["export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n"]}
|
package/dist/lib/host-probe.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host capability probes for non-interactive / sandboxed environments.
|
|
3
|
-
*
|
|
4
|
-
* When the CLI runs inside an AI agent sandbox (Claude Code, Codex, Cursor),
|
|
5
|
-
* the keyring, home directory, network, or browser may be unavailable.
|
|
6
|
-
* These helpers detect that situation and emit a single actionable warning
|
|
7
|
-
* per session instead of letting opaque EPERM errors confuse the agent.
|
|
8
|
-
*/
|
|
9
|
-
export type HostCapability = 'home-fs' | 'keychain' | 'network' | 'browser-launch' | 'localhost-bind';
|
|
10
|
-
export type HostOperation = 'read' | 'write' | 'delete' | 'connect' | 'open' | 'listen';
|
|
11
|
-
export interface HostCapabilityDetails {
|
|
12
|
-
operation?: HostOperation;
|
|
13
|
-
target?: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ProbeFailure extends HostCapabilityDetails {
|
|
17
|
-
capability: HostCapability;
|
|
18
|
-
detail: string;
|
|
19
|
-
}
|
|
20
|
-
export interface ProbeResult {
|
|
21
|
-
ok: boolean;
|
|
22
|
-
failures: ProbeFailure[];
|
|
23
|
-
}
|
|
24
|
-
export declare function formatHostProbeFailure(failure: ProbeFailure): string;
|
|
25
|
-
export declare function runHostProbe(): Promise<ProbeResult>;
|
|
26
|
-
export declare function warnIfSandboxed(): Promise<void>;
|
|
27
|
-
export declare function observeHostFailure(capability: HostCapability, error: unknown, details?: HostCapabilityDetails): void;
|
|
28
|
-
export declare function _resetProbeState(): void;
|
package/dist/lib/host-probe.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host capability probes for non-interactive / sandboxed environments.
|
|
3
|
-
*
|
|
4
|
-
* When the CLI runs inside an AI agent sandbox (Claude Code, Codex, Cursor),
|
|
5
|
-
* the keyring, home directory, network, or browser may be unavailable.
|
|
6
|
-
* These helpers detect that situation and emit a single actionable warning
|
|
7
|
-
* per session instead of letting opaque EPERM errors confuse the agent.
|
|
8
|
-
*/
|
|
9
|
-
import { promises as fs } from 'node:fs';
|
|
10
|
-
import path from 'node:path';
|
|
11
|
-
import os from 'node:os';
|
|
12
|
-
import { Entry } from '@napi-rs/keyring';
|
|
13
|
-
import { isAgentMode, isCiMode } from '../utils/interaction-mode.js';
|
|
14
|
-
import { logInfo, logVisibleWarn } from '../utils/debug.js';
|
|
15
|
-
let warnedThisSession = false;
|
|
16
|
-
let cachedProbe;
|
|
17
|
-
const KEYCHAIN_SERVICE = 'workos-cli';
|
|
18
|
-
const KEYCHAIN_PROBE_ACCOUNT = 'probe';
|
|
19
|
-
const PERMISSION_PATTERNS = [
|
|
20
|
-
/\bEPERM\b/i,
|
|
21
|
-
/\bEACCES\b/i,
|
|
22
|
-
/operation not permitted/i,
|
|
23
|
-
/permission denied/i,
|
|
24
|
-
/\bsandboxd?\b/i,
|
|
25
|
-
/interaction is not allowed/i,
|
|
26
|
-
/access denied/i,
|
|
27
|
-
];
|
|
28
|
-
function isPermissionError(error) {
|
|
29
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
30
|
-
return PERMISSION_PATTERNS.some((p) => p.test(msg));
|
|
31
|
-
}
|
|
32
|
-
function isLikelyHostFailure(capability, error) {
|
|
33
|
-
if (capability === 'browser-launch' || capability === 'localhost-bind') {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
return isPermissionError(error);
|
|
37
|
-
}
|
|
38
|
-
function isMissingEntryError(error) {
|
|
39
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
40
|
-
return msg.includes('not found') || msg.includes('No such');
|
|
41
|
-
}
|
|
42
|
-
async function probeHomeFs() {
|
|
43
|
-
const dir = path.join(os.homedir(), '.workos');
|
|
44
|
-
const probePath = path.join(dir, `.probe-${process.pid}-${crypto.randomUUID()}`);
|
|
45
|
-
try {
|
|
46
|
-
await fs.mkdir(dir, { recursive: true, mode: 0o700 });
|
|
47
|
-
await fs.writeFile(probePath, new Date().toISOString(), { mode: 0o600 });
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
// Only treat permission-class errors as sandbox indicators. Transient
|
|
52
|
-
// errors like ENOSPC/EIO would otherwise produce a misleading "sandboxed
|
|
53
|
-
// environment" warning. Mirrors the gating in observeHostFailure().
|
|
54
|
-
if (!isPermissionError(error))
|
|
55
|
-
return null;
|
|
56
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
57
|
-
return { capability: 'home-fs', detail, operation: 'write', target: dir, label: 'WorkOS home directory' };
|
|
58
|
-
}
|
|
59
|
-
finally {
|
|
60
|
-
// Best-effort cleanup so a successful write never leaves an orphan file
|
|
61
|
-
// behind. Ignore unlink failures: if the file was never created the
|
|
62
|
-
// unlink will fail with ENOENT, and any other failure is unrelated to
|
|
63
|
-
// the probe's purpose (which is checking write access, not delete).
|
|
64
|
-
await fs.unlink(probePath).catch(() => { });
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function probeKeychain() {
|
|
68
|
-
try {
|
|
69
|
-
const entry = new Entry(KEYCHAIN_SERVICE, KEYCHAIN_PROBE_ACCOUNT);
|
|
70
|
-
entry.getPassword();
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
// A "not found" / "No such" error means the keychain is reachable but the
|
|
75
|
-
// probe entry simply doesn't exist — that's a healthy state, not a failure.
|
|
76
|
-
if (isMissingEntryError(error)) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
// Only treat permission-class errors as sandbox indicators. A user-canceled
|
|
80
|
-
// macOS prompt or a transient keyring daemon hiccup would otherwise produce
|
|
81
|
-
// a misleading "sandboxed environment" warning. Mirrors probeHomeFs() and
|
|
82
|
-
// observeHostFailure().
|
|
83
|
-
if (!isPermissionError(error))
|
|
84
|
-
return null;
|
|
85
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
86
|
-
return {
|
|
87
|
-
capability: 'keychain',
|
|
88
|
-
detail,
|
|
89
|
-
operation: 'read',
|
|
90
|
-
target: `${KEYCHAIN_SERVICE}/${KEYCHAIN_PROBE_ACCOUNT}`,
|
|
91
|
-
label: 'WorkOS keychain probe',
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
export function formatHostProbeFailure(failure) {
|
|
96
|
-
const parts = [failure.label ?? failure.capability];
|
|
97
|
-
if (failure.operation)
|
|
98
|
-
parts.push(`operation=${failure.operation}`);
|
|
99
|
-
if (failure.target)
|
|
100
|
-
parts.push(`target=${failure.target}`);
|
|
101
|
-
parts.push(`error=${failure.detail}`);
|
|
102
|
-
return parts.join(', ');
|
|
103
|
-
}
|
|
104
|
-
function formatHostFailureContext(capability, details, detail) {
|
|
105
|
-
return formatHostProbeFailure({ capability, ...details, detail });
|
|
106
|
-
}
|
|
107
|
-
export async function runHostProbe() {
|
|
108
|
-
if (cachedProbe)
|
|
109
|
-
return cachedProbe;
|
|
110
|
-
const failures = [];
|
|
111
|
-
const fsResult = await probeHomeFs();
|
|
112
|
-
if (fsResult)
|
|
113
|
-
failures.push(fsResult);
|
|
114
|
-
const keychainResult = probeKeychain();
|
|
115
|
-
if (keychainResult)
|
|
116
|
-
failures.push(keychainResult);
|
|
117
|
-
cachedProbe = { ok: failures.length === 0, failures };
|
|
118
|
-
return cachedProbe;
|
|
119
|
-
}
|
|
120
|
-
function shouldWarnForHostTrust() {
|
|
121
|
-
return isAgentMode() || isCiMode();
|
|
122
|
-
}
|
|
123
|
-
export async function warnIfSandboxed() {
|
|
124
|
-
if (warnedThisSession)
|
|
125
|
-
return;
|
|
126
|
-
if (!shouldWarnForHostTrust())
|
|
127
|
-
return;
|
|
128
|
-
const probe = await runHostProbe();
|
|
129
|
-
if (probe.ok)
|
|
130
|
-
return;
|
|
131
|
-
warnedThisSession = true;
|
|
132
|
-
const caps = probe.failures.map((f) => f.capability).join(', ');
|
|
133
|
-
logVisibleWarn(`Host capabilities may be unavailable (${caps}). This may be a sandboxed environment.`, 'Re-run this command on the host shell before trusting auth or API failures.');
|
|
134
|
-
for (const f of probe.failures) {
|
|
135
|
-
logInfo(`[host-probe] ${formatHostProbeFailure(f)}`);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
export function observeHostFailure(capability, error, details = {}) {
|
|
139
|
-
if (warnedThisSession)
|
|
140
|
-
return;
|
|
141
|
-
if (!shouldWarnForHostTrust())
|
|
142
|
-
return;
|
|
143
|
-
if (!isLikelyHostFailure(capability, error))
|
|
144
|
-
return;
|
|
145
|
-
warnedThisSession = true;
|
|
146
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
147
|
-
logVisibleWarn(`Host capability "${capability}" failed (${detail}). This may be a sandboxed environment.`, 'Re-run this command on the host shell before trusting auth or API failures.');
|
|
148
|
-
logInfo(`[host-probe] ${formatHostFailureContext(capability, details, detail)}`);
|
|
149
|
-
}
|
|
150
|
-
export function _resetProbeState() {
|
|
151
|
-
cachedProbe = undefined;
|
|
152
|
-
warnedThisSession = false;
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=host-probe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-probe.js","sourceRoot":"","sources":["../../src/lib/host-probe.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Host capability probes for non-interactive / sandboxed environments.\n *\n * When the CLI runs inside an AI agent sandbox (Claude Code, Codex, Cursor),\n * the keyring, home directory, network, or browser may be unavailable.\n * These helpers detect that situation and emit a single actionable warning\n * per session instead of letting opaque EPERM errors confuse the agent.\n */\n\nimport { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport os from 'node:os';\nimport { Entry } from '@napi-rs/keyring';\nimport { isAgentMode, isCiMode } from '../utils/interaction-mode.js';\nimport { logInfo, logVisibleWarn } from '../utils/debug.js';\n\nexport type HostCapability = 'home-fs' | 'keychain' | 'network' | 'browser-launch' | 'localhost-bind';\nexport type HostOperation = 'read' | 'write' | 'delete' | 'connect' | 'open' | 'listen';\n\nexport interface HostCapabilityDetails {\n operation?: HostOperation;\n target?: string;\n label?: string;\n}\n\nexport interface ProbeFailure extends HostCapabilityDetails {\n capability: HostCapability;\n detail: string;\n}\n\nexport interface ProbeResult {\n ok: boolean;\n failures: ProbeFailure[];\n}\n\nlet warnedThisSession = false;\nlet cachedProbe: ProbeResult | undefined;\n\nconst KEYCHAIN_SERVICE = 'workos-cli';\nconst KEYCHAIN_PROBE_ACCOUNT = 'probe';\n\nconst PERMISSION_PATTERNS = [\n /\\bEPERM\\b/i,\n /\\bEACCES\\b/i,\n /operation not permitted/i,\n /permission denied/i,\n /\\bsandboxd?\\b/i,\n /interaction is not allowed/i,\n /access denied/i,\n];\n\nfunction isPermissionError(error: unknown): boolean {\n const msg = error instanceof Error ? error.message : String(error);\n return PERMISSION_PATTERNS.some((p) => p.test(msg));\n}\n\nfunction isLikelyHostFailure(capability: HostCapability, error: unknown): boolean {\n if (capability === 'browser-launch' || capability === 'localhost-bind') {\n return true;\n }\n\n return isPermissionError(error);\n}\n\nfunction isMissingEntryError(error: unknown): boolean {\n const msg = error instanceof Error ? error.message : String(error);\n return msg.includes('not found') || msg.includes('No such');\n}\n\nasync function probeHomeFs(): Promise<ProbeFailure | null> {\n const dir = path.join(os.homedir(), '.workos');\n const probePath = path.join(dir, `.probe-${process.pid}-${crypto.randomUUID()}`);\n\n try {\n await fs.mkdir(dir, { recursive: true, mode: 0o700 });\n await fs.writeFile(probePath, new Date().toISOString(), { mode: 0o600 });\n return null;\n } catch (error) {\n // Only treat permission-class errors as sandbox indicators. Transient\n // errors like ENOSPC/EIO would otherwise produce a misleading \"sandboxed\n // environment\" warning. Mirrors the gating in observeHostFailure().\n if (!isPermissionError(error)) return null;\n const detail = error instanceof Error ? error.message : String(error);\n return { capability: 'home-fs', detail, operation: 'write', target: dir, label: 'WorkOS home directory' };\n } finally {\n // Best-effort cleanup so a successful write never leaves an orphan file\n // behind. Ignore unlink failures: if the file was never created the\n // unlink will fail with ENOENT, and any other failure is unrelated to\n // the probe's purpose (which is checking write access, not delete).\n await fs.unlink(probePath).catch(() => {});\n }\n}\n\nfunction probeKeychain(): ProbeFailure | null {\n try {\n const entry = new Entry(KEYCHAIN_SERVICE, KEYCHAIN_PROBE_ACCOUNT);\n entry.getPassword();\n return null;\n } catch (error) {\n // A \"not found\" / \"No such\" error means the keychain is reachable but the\n // probe entry simply doesn't exist — that's a healthy state, not a failure.\n if (isMissingEntryError(error)) {\n return null;\n }\n // Only treat permission-class errors as sandbox indicators. A user-canceled\n // macOS prompt or a transient keyring daemon hiccup would otherwise produce\n // a misleading \"sandboxed environment\" warning. Mirrors probeHomeFs() and\n // observeHostFailure().\n if (!isPermissionError(error)) return null;\n const detail = error instanceof Error ? error.message : String(error);\n return {\n capability: 'keychain',\n detail,\n operation: 'read',\n target: `${KEYCHAIN_SERVICE}/${KEYCHAIN_PROBE_ACCOUNT}`,\n label: 'WorkOS keychain probe',\n };\n }\n}\n\nexport function formatHostProbeFailure(failure: ProbeFailure): string {\n const parts = [failure.label ?? failure.capability];\n if (failure.operation) parts.push(`operation=${failure.operation}`);\n if (failure.target) parts.push(`target=${failure.target}`);\n parts.push(`error=${failure.detail}`);\n return parts.join(', ');\n}\n\nfunction formatHostFailureContext(capability: HostCapability, details: HostCapabilityDetails, detail: string): string {\n return formatHostProbeFailure({ capability, ...details, detail });\n}\n\nexport async function runHostProbe(): Promise<ProbeResult> {\n if (cachedProbe) return cachedProbe;\n\n const failures: ProbeFailure[] = [];\n\n const fsResult = await probeHomeFs();\n if (fsResult) failures.push(fsResult);\n\n const keychainResult = probeKeychain();\n if (keychainResult) failures.push(keychainResult);\n\n cachedProbe = { ok: failures.length === 0, failures };\n return cachedProbe;\n}\n\nfunction shouldWarnForHostTrust(): boolean {\n return isAgentMode() || isCiMode();\n}\n\nexport async function warnIfSandboxed(): Promise<void> {\n if (warnedThisSession) return;\n if (!shouldWarnForHostTrust()) return;\n\n const probe = await runHostProbe();\n if (probe.ok) return;\n\n warnedThisSession = true;\n\n const caps = probe.failures.map((f) => f.capability).join(', ');\n logVisibleWarn(\n `Host capabilities may be unavailable (${caps}). This may be a sandboxed environment.`,\n 'Re-run this command on the host shell before trusting auth or API failures.',\n );\n\n for (const f of probe.failures) {\n logInfo(`[host-probe] ${formatHostProbeFailure(f)}`);\n }\n}\n\nexport function observeHostFailure(\n capability: HostCapability,\n error: unknown,\n details: HostCapabilityDetails = {},\n): void {\n if (warnedThisSession) return;\n if (!shouldWarnForHostTrust()) return;\n if (!isLikelyHostFailure(capability, error)) return;\n\n warnedThisSession = true;\n\n const detail = error instanceof Error ? error.message : String(error);\n logVisibleWarn(\n `Host capability \"${capability}\" failed (${detail}). This may be a sandboxed environment.`,\n 'Re-run this command on the host shell before trusting auth or API failures.',\n );\n logInfo(`[host-probe] ${formatHostFailureContext(capability, details, detail)}`);\n}\n\nexport function _resetProbeState(): void {\n cachedProbe = undefined;\n warnedThisSession = false;\n}\n"]}
|