workos 0.18.0 → 0.20.1
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 -783
- package/bin/workos.js +44 -0
- package/package.json +18 -107
- package/LICENSE +0 -47
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -1711
- package/dist/bin.js.map +0 -1
- package/dist/check-coverage.ts +0 -237
- 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 -205
- 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 -131
- 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 -23
- 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 -6
- package/dist/commands/emulate.js +0 -68
- package/dist/commands/emulate.js.map +0 -1
- package/dist/commands/env.d.ts +0 -9
- package/dist/commands/env.js +0 -227
- 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 -56
- 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 -22
- package/dist/commands/login.js +0 -184
- 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 -108
- 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 -49
- 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 -297
- 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/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 -194
- 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/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 -198
- 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 -288
- 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/emulate/core/id.d.ts +0 -48
- package/dist/emulate/core/id.js +0 -73
- package/dist/emulate/core/id.js.map +0 -1
- package/dist/emulate/core/index.d.ts +0 -8
- package/dist/emulate/core/index.js +0 -8
- package/dist/emulate/core/index.js.map +0 -1
- package/dist/emulate/core/jwt.d.ts +0 -28
- package/dist/emulate/core/jwt.js +0 -78
- package/dist/emulate/core/jwt.js.map +0 -1
- package/dist/emulate/core/middleware/auth.d.ts +0 -15
- package/dist/emulate/core/middleware/auth.js +0 -17
- package/dist/emulate/core/middleware/auth.js.map +0 -1
- package/dist/emulate/core/middleware/error-handler.d.ts +0 -22
- package/dist/emulate/core/middleware/error-handler.js +0 -72
- package/dist/emulate/core/middleware/error-handler.js.map +0 -1
- package/dist/emulate/core/pagination.d.ts +0 -27
- package/dist/emulate/core/pagination.js +0 -43
- package/dist/emulate/core/pagination.js.map +0 -1
- package/dist/emulate/core/plugin.d.ts +0 -15
- package/dist/emulate/core/plugin.js +0 -2
- package/dist/emulate/core/plugin.js.map +0 -1
- package/dist/emulate/core/server.d.ts +0 -17
- package/dist/emulate/core/server.js +0 -90
- package/dist/emulate/core/server.js.map +0 -1
- package/dist/emulate/core/store.d.ts +0 -44
- package/dist/emulate/core/store.js +0 -169
- package/dist/emulate/core/store.js.map +0 -1
- package/dist/emulate/index.d.ts +0 -25
- package/dist/emulate/index.js +0 -47
- package/dist/emulate/index.js.map +0 -1
- package/dist/emulate/workos/constants.d.ts +0 -56
- package/dist/emulate/workos/constants.js +0 -56
- package/dist/emulate/workos/constants.js.map +0 -1
- package/dist/emulate/workos/entities.d.ts +0 -360
- package/dist/emulate/workos/entities.js +0 -2
- package/dist/emulate/workos/entities.js.map +0 -1
- package/dist/emulate/workos/event-bus.d.ts +0 -17
- package/dist/emulate/workos/event-bus.js +0 -70
- package/dist/emulate/workos/event-bus.js.map +0 -1
- package/dist/emulate/workos/helpers.d.ts +0 -72
- package/dist/emulate/workos/helpers.js +0 -211
- package/dist/emulate/workos/helpers.js.map +0 -1
- package/dist/emulate/workos/index.d.ts +0 -93
- package/dist/emulate/workos/index.js +0 -326
- package/dist/emulate/workos/index.js.map +0 -1
- package/dist/emulate/workos/role-helpers.d.ts +0 -21
- package/dist/emulate/workos/role-helpers.js +0 -130
- package/dist/emulate/workos/role-helpers.js.map +0 -1
- package/dist/emulate/workos/routes/api-keys.d.ts +0 -2
- package/dist/emulate/workos/routes/api-keys.js +0 -32
- package/dist/emulate/workos/routes/api-keys.js.map +0 -1
- package/dist/emulate/workos/routes/audit-logs.d.ts +0 -2
- package/dist/emulate/workos/routes/audit-logs.js +0 -104
- package/dist/emulate/workos/routes/audit-logs.js.map +0 -1
- package/dist/emulate/workos/routes/auth-challenges.d.ts +0 -2
- package/dist/emulate/workos/routes/auth-challenges.js +0 -51
- package/dist/emulate/workos/routes/auth-challenges.js.map +0 -1
- package/dist/emulate/workos/routes/auth-factors.d.ts +0 -2
- package/dist/emulate/workos/routes/auth-factors.js +0 -51
- package/dist/emulate/workos/routes/auth-factors.js.map +0 -1
- package/dist/emulate/workos/routes/auth.d.ts +0 -2
- package/dist/emulate/workos/routes/auth.js +0 -350
- package/dist/emulate/workos/routes/auth.js.map +0 -1
- package/dist/emulate/workos/routes/authorization-checks.d.ts +0 -10
- package/dist/emulate/workos/routes/authorization-checks.js +0 -123
- package/dist/emulate/workos/routes/authorization-checks.js.map +0 -1
- package/dist/emulate/workos/routes/authorization-org-roles.d.ts +0 -2
- package/dist/emulate/workos/routes/authorization-org-roles.js +0 -64
- package/dist/emulate/workos/routes/authorization-org-roles.js.map +0 -1
- package/dist/emulate/workos/routes/authorization-permissions.d.ts +0 -2
- package/dist/emulate/workos/routes/authorization-permissions.js +0 -67
- package/dist/emulate/workos/routes/authorization-permissions.js.map +0 -1
- package/dist/emulate/workos/routes/authorization-resources.d.ts +0 -2
- package/dist/emulate/workos/routes/authorization-resources.js +0 -117
- package/dist/emulate/workos/routes/authorization-resources.js.map +0 -1
- package/dist/emulate/workos/routes/authorization-roles.d.ts +0 -2
- package/dist/emulate/workos/routes/authorization-roles.js +0 -13
- package/dist/emulate/workos/routes/authorization-roles.js.map +0 -1
- package/dist/emulate/workos/routes/config.d.ts +0 -2
- package/dist/emulate/workos/routes/config.js +0 -57
- package/dist/emulate/workos/routes/config.js.map +0 -1
- package/dist/emulate/workos/routes/connect.d.ts +0 -2
- package/dist/emulate/workos/routes/connect.js +0 -65
- package/dist/emulate/workos/routes/connect.js.map +0 -1
- package/dist/emulate/workos/routes/connections.d.ts +0 -2
- package/dist/emulate/workos/routes/connections.js +0 -73
- package/dist/emulate/workos/routes/connections.js.map +0 -1
- package/dist/emulate/workos/routes/data-integrations.d.ts +0 -2
- package/dist/emulate/workos/routes/data-integrations.js +0 -55
- package/dist/emulate/workos/routes/data-integrations.js.map +0 -1
- package/dist/emulate/workos/routes/directories.d.ts +0 -2
- package/dist/emulate/workos/routes/directories.js +0 -90
- package/dist/emulate/workos/routes/directories.js.map +0 -1
- package/dist/emulate/workos/routes/email-verification.d.ts +0 -2
- package/dist/emulate/workos/routes/email-verification.js +0 -49
- package/dist/emulate/workos/routes/email-verification.js.map +0 -1
- package/dist/emulate/workos/routes/events.d.ts +0 -2
- package/dist/emulate/workos/routes/events.js +0 -18
- package/dist/emulate/workos/routes/events.js.map +0 -1
- package/dist/emulate/workos/routes/feature-flags.d.ts +0 -2
- package/dist/emulate/workos/routes/feature-flags.js +0 -103
- package/dist/emulate/workos/routes/feature-flags.js.map +0 -1
- package/dist/emulate/workos/routes/invitations.d.ts +0 -2
- package/dist/emulate/workos/routes/invitations.js +0 -122
- package/dist/emulate/workos/routes/invitations.js.map +0 -1
- package/dist/emulate/workos/routes/legacy-mfa.d.ts +0 -2
- package/dist/emulate/workos/routes/legacy-mfa.js +0 -75
- package/dist/emulate/workos/routes/legacy-mfa.js.map +0 -1
- package/dist/emulate/workos/routes/magic-auth.d.ts +0 -2
- package/dist/emulate/workos/routes/magic-auth.js +0 -32
- package/dist/emulate/workos/routes/magic-auth.js.map +0 -1
- package/dist/emulate/workos/routes/memberships.d.ts +0 -2
- package/dist/emulate/workos/routes/memberships.js +0 -114
- package/dist/emulate/workos/routes/memberships.js.map +0 -1
- package/dist/emulate/workos/routes/organization-domains.d.ts +0 -2
- package/dist/emulate/workos/routes/organization-domains.js +0 -58
- package/dist/emulate/workos/routes/organization-domains.js.map +0 -1
- package/dist/emulate/workos/routes/organizations.d.ts +0 -2
- package/dist/emulate/workos/routes/organizations.js +0 -131
- package/dist/emulate/workos/routes/organizations.js.map +0 -1
- package/dist/emulate/workos/routes/password-reset.d.ts +0 -2
- package/dist/emulate/workos/routes/password-reset.js +0 -61
- package/dist/emulate/workos/routes/password-reset.js.map +0 -1
- package/dist/emulate/workos/routes/pipes.d.ts +0 -2
- package/dist/emulate/workos/routes/pipes.js +0 -82
- package/dist/emulate/workos/routes/pipes.js.map +0 -1
- package/dist/emulate/workos/routes/portal.d.ts +0 -2
- package/dist/emulate/workos/routes/portal.js +0 -18
- package/dist/emulate/workos/routes/portal.js.map +0 -1
- package/dist/emulate/workos/routes/radar.d.ts +0 -2
- package/dist/emulate/workos/routes/radar.js +0 -41
- package/dist/emulate/workos/routes/radar.js.map +0 -1
- package/dist/emulate/workos/routes/sessions.d.ts +0 -2
- package/dist/emulate/workos/routes/sessions.js +0 -51
- package/dist/emulate/workos/routes/sessions.js.map +0 -1
- package/dist/emulate/workos/routes/sso.d.ts +0 -2
- package/dist/emulate/workos/routes/sso.js +0 -161
- package/dist/emulate/workos/routes/sso.js.map +0 -1
- package/dist/emulate/workos/routes/user-features.d.ts +0 -2
- package/dist/emulate/workos/routes/user-features.js +0 -50
- package/dist/emulate/workos/routes/user-features.js.map +0 -1
- package/dist/emulate/workos/routes/users.d.ts +0 -2
- package/dist/emulate/workos/routes/users.js +0 -129
- package/dist/emulate/workos/routes/users.js.map +0 -1
- package/dist/emulate/workos/routes/webhook-endpoints.d.ts +0 -2
- package/dist/emulate/workos/routes/webhook-endpoints.js +0 -67
- package/dist/emulate/workos/routes/webhook-endpoints.js.map +0 -1
- package/dist/emulate/workos/routes/widgets.d.ts +0 -2
- package/dist/emulate/workos/routes/widgets.js +0 -27
- package/dist/emulate/workos/routes/widgets.js.map +0 -1
- package/dist/emulate/workos/store.d.ts +0 -48
- package/dist/emulate/workos/store.js +0 -102
- package/dist/emulate/workos/store.js.map +0 -1
- package/dist/emulate/workos/webhook-signer.d.ts +0 -1
- package/dist/emulate/workos/webhook-signer.js +0 -8
- package/dist/emulate/workos/webhook-signer.js.map +0 -1
- package/dist/gen-routes-lib.spec.ts +0 -659
- package/dist/gen-routes-lib.ts +0 -647
- package/dist/gen-routes.ts +0 -96
- 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 -90
- 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 -53
- 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 -146
- 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 -84
- package/dist/lib/adapters/cli-adapter.js +0 -525
- 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 -73
- package/dist/lib/adapters/headless-adapter.js +0 -310
- 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 -826
- 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 -36
- 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/config-store.d.ts +0 -50
- package/dist/lib/config-store.js +0 -269
- 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 -43
- package/dist/lib/constants.js +0 -42
- 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 -215
- package/dist/lib/events.js +0 -19
- package/dist/lib/events.js.map +0 -1
- package/dist/lib/framework-config.d.ts +0 -127
- 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 -556
- package/dist/lib/installer-core.js +0 -1115
- package/dist/lib/installer-core.js.map +0 -1
- package/dist/lib/installer-core.types.d.ts +0 -160
- 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 -39
- package/dist/lib/mcp-clients.js +0 -284
- package/dist/lib/mcp-clients.js.map +0 -1
- package/dist/lib/mcp-notice.d.ts +0 -72
- package/dist/lib/mcp-notice.js +0 -275
- package/dist/lib/mcp-notice.js.map +0 -1
- package/dist/lib/port-detection.d.ts +0 -7
- package/dist/lib/port-detection.js +0 -238
- 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 -115
- package/dist/lib/preferences.js +0 -201
- 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 -522
- 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 -59
- 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 -77
- 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 -77
- 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 -105
- 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 -684
- 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 -142
- 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 -32
- package/dist/run.js +0 -54
- 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 -57
- 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 -33
- package/dist/utils/box.js +0 -102
- package/dist/utils/box.js.map +0 -1
- package/dist/utils/clack-utils.d.ts +0 -97
- package/dist/utils/clack-utils.js +0 -422
- package/dist/utils/clack-utils.js.map +0 -1
- package/dist/utils/clack.d.ts +0 -5
- package/dist/utils/clack.js +0 -34
- package/dist/utils/clack.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 -32
- package/dist/utils/cli-symbols.js +0 -46
- 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 -1466
- 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 -37
- package/dist/utils/recovery-hints.js +0 -80
- 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 -18
- package/dist/utils/summary-box.js +0 -148
- 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 -113
- package/dist/utils/types.js +0 -2
- package/dist/utils/types.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post-install.js","sourceRoot":"","sources":["../../src/lib/post-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,MAAM,UAAU,aAAa;IAC3B,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,GAAW;IACzD,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7D,YAAY,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,IAAY,EAAE,GAAW;IACxE,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,WAAW,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3D,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE;YAC1G,GAAG;YACH,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC;aACC,QAAQ,EAAE;aACV,IAAI,EAAE,CAAC;IACZ,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,UAAU,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;IACtC,OAAO;;;;wBAIe,MAAM;;;+CAGiB,UAAU,MAAM,MAAM;;;;CAIpE,CAAC,IAAI,EAAE,CAAC;AACT,CAAC","sourcesContent":["import { execFileSync } from 'node:child_process';\nimport { writeFileSync, unlinkSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { getDefaultBranch, getUncommittedFiles } from '../utils/git-utils.js';\n\nexport function detectChanges(): { hasChanges: boolean; files: string[] } {\n const files = getUncommittedFiles();\n return { hasChanges: files.length > 0, files };\n}\n\nexport function stageAndCommit(message: string, cwd: string): void {\n execFileSync('git', ['add', '-A'], { cwd, stdio: 'ignore' });\n execFileSync('git', ['commit', '-m', message], { cwd, stdio: 'ignore' });\n}\n\nexport function pushBranch(cwd: string): void {\n execFileSync('git', ['push', '-u', 'origin', 'HEAD'], { cwd, stdio: 'pipe' });\n}\n\nexport function createPullRequest(title: string, body: string, cwd: string): string {\n const baseBranch = getDefaultBranch();\n const tmpFile = join(tmpdir(), `pr-body-${Date.now()}.md`);\n writeFileSync(tmpFile, body, 'utf-8');\n\n try {\n return execFileSync('gh', ['pr', 'create', '--title', title, '--body-file', tmpFile, '--base', baseBranch], {\n cwd,\n stdio: ['ignore', 'pipe', 'pipe'],\n })\n .toString()\n .trim();\n } finally {\n try {\n unlinkSync(tmpFile);\n } catch {}\n }\n}\n\nexport function getManualPrInstructions(branch: string): string {\n const baseBranch = getDefaultBranch();\n return `\nTo create a PR manually:\n\n1. Push your branch:\n git push -u origin ${branch}\n\n2. Create PR via GitHub:\n https://github.com/<owner>/<repo>/compare/${baseBranch}...${branch}\n\nOr install the GitHub CLI:\n https://cli.github.com/\n`.trim();\n}\n"]}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plain CLI preferences store.
|
|
3
|
-
*
|
|
4
|
-
* Stored at ~/.workos/preferences.json as plain JSON. These are NOT secrets —
|
|
5
|
-
* knowing that someone opted out of telemetry leaks nothing — so this
|
|
6
|
-
* deliberately avoids the keyring abstraction (config-store.ts) to prevent a
|
|
7
|
-
* non-secret write from ever triggering the insecure-fallback security warning.
|
|
8
|
-
*
|
|
9
|
-
* Mirrors the structural pattern of device-id.ts: a synchronous accessor backed
|
|
10
|
-
* by a cache, an async prewarm that populates that cache off the blocking-fs
|
|
11
|
-
* path, and a never-throws contract on every read/parse so a corrupt file can
|
|
12
|
-
* never break a command.
|
|
13
|
-
*/
|
|
14
|
-
export interface CliPreferences {
|
|
15
|
-
telemetry?: {
|
|
16
|
-
/** true => the user explicitly opted out of telemetry. */
|
|
17
|
-
optedOut?: boolean;
|
|
18
|
-
/** ISO timestamp the first-run notice was shown — written in Phase 2 only. */
|
|
19
|
-
noticeShownAt?: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* MCP-install onboarding state. Owned semantically by lib/mcp-notice.ts; the
|
|
23
|
-
* shape lives here so it rides the same plain-JSON prefs store as telemetry.
|
|
24
|
-
*/
|
|
25
|
-
mcp?: {
|
|
26
|
-
/**
|
|
27
|
-
* true => the user explicitly declined an automatic MCP install offer. The
|
|
28
|
-
* decline is absolute: no automatic surface (prompt or banner) asks again;
|
|
29
|
-
* `workos mcp install` stays available manually.
|
|
30
|
-
*/
|
|
31
|
-
promptDeclined?: boolean;
|
|
32
|
-
/** ISO timestamp the one-time MCP banner was shown. */
|
|
33
|
-
bannerShownAt?: string;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/** Effective source of the resolved telemetry-enabled decision. */
|
|
37
|
-
export type TelemetrySource = 'env' | 'preference' | 'default';
|
|
38
|
-
export declare function getPreferencesPath(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Asynchronously load preferences and warm the cache the synchronous
|
|
41
|
-
* getPreferences() reads. Memoized: the first call performs the IO, concurrent
|
|
42
|
-
* and later callers await the same promise. Prewarming this at startup keeps
|
|
43
|
-
* the synchronous telemetry path off blocking fs IO. Never rejects.
|
|
44
|
-
*/
|
|
45
|
-
export declare function loadPreferences(): Promise<CliPreferences>;
|
|
46
|
-
/**
|
|
47
|
-
* Synchronous accessor. Returns the prewarmed value when loadPreferences() has
|
|
48
|
-
* run; otherwise performs a one-time synchronous read of the same file. On any
|
|
49
|
-
* IO/parse failure returns {} (telemetry stays at its default-on state). Never
|
|
50
|
-
* throws.
|
|
51
|
-
*/
|
|
52
|
-
export declare function getPreferences(): CliPreferences;
|
|
53
|
-
/**
|
|
54
|
-
* Read-modify-write the on-disk preferences, merging `next` over the current
|
|
55
|
-
* persisted value so future fields are never clobbered, then update the cache.
|
|
56
|
-
* Throws on write failure so callers on the command path (opt-out/opt-in) can
|
|
57
|
-
* surface a clear error — the read path swallows, the write path does not.
|
|
58
|
-
*/
|
|
59
|
-
export declare function savePreferences(next: CliPreferences): void;
|
|
60
|
-
/** Whether the user has explicitly opted out via the saved preference. */
|
|
61
|
-
export declare function isTelemetryOptedOut(): boolean;
|
|
62
|
-
/** Persist the opt-out flag. Throws on write failure (see savePreferences). */
|
|
63
|
-
export declare function setTelemetryOptedOut(value: boolean): void;
|
|
64
|
-
/** Whether the first-run telemetry notice has already been shown (ever). */
|
|
65
|
-
export declare function isNoticeShown(): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Persist the first-run notice as shown, stamping the current time. Uses the
|
|
68
|
-
* read-modify-write savePreferences so it never clobbers the optedOut flag.
|
|
69
|
-
* Throws on write failure (see savePreferences) — the caller in
|
|
70
|
-
* telemetry-notice.ts swallows it so a read-only FS never blocks a command.
|
|
71
|
-
*/
|
|
72
|
-
export declare function markNoticeShown(): void;
|
|
73
|
-
/**
|
|
74
|
-
* Tri-state env override for telemetry.
|
|
75
|
-
*
|
|
76
|
-
* Only the explicit strings 'true' / 'false' count as an override. Any other
|
|
77
|
-
* value — including unset or garbage like '1' — returns undefined and falls
|
|
78
|
-
* through to the saved preference.
|
|
79
|
-
*
|
|
80
|
-
* This is a deliberate, documented change from the old `WORKOS_TELEMETRY !==
|
|
81
|
-
* 'false'` behaviour: previously `WORKOS_TELEMETRY=1` forced telemetry on even
|
|
82
|
-
* for opted-out users; now an opt-out is respected unless the env var
|
|
83
|
-
* explicitly says 'true'.
|
|
84
|
-
*/
|
|
85
|
-
export declare function envTelemetryOverride(): boolean | undefined;
|
|
86
|
-
/**
|
|
87
|
-
* Effective telemetry-enabled decision.
|
|
88
|
-
*
|
|
89
|
-
* Resolution order:
|
|
90
|
-
* 1. envTelemetryOverride() if defined — env wins in BOTH directions.
|
|
91
|
-
* 2. otherwise !isTelemetryOptedOut() — default-on unless explicitly opted out.
|
|
92
|
-
*/
|
|
93
|
-
export declare function isTelemetryEnabled(): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Which signal produced the effective telemetry decision. Mirrors the
|
|
96
|
-
* precedence in isTelemetryEnabled() so the `telemetry status` command and the
|
|
97
|
-
* resolver can never drift.
|
|
98
|
-
*
|
|
99
|
-
* Note: an explicit opt-in (optedOut === false) reads as 'default', not
|
|
100
|
-
* 'preference' — its outcome is identical to a fresh install, and the resolver
|
|
101
|
-
* only treats optedOut === true as a non-default signal, so reporting
|
|
102
|
-
* 'preference' here would imply a behavioral difference that does not exist.
|
|
103
|
-
*/
|
|
104
|
-
export declare function getTelemetrySource(): TelemetrySource;
|
|
105
|
-
/**
|
|
106
|
-
* Delete the preferences file, returning telemetry to its fresh-install state
|
|
107
|
-
* (opted-in, first-run notice unseen). Used by `debug reset` to wipe stored CLI
|
|
108
|
-
* state alongside credentials and config. No-op if the file does not exist;
|
|
109
|
-
* throws on a real delete failure (e.g. permission denied) so the caller can
|
|
110
|
-
* surface it, mirroring clearConfig/clearCredentials. Resets the in-memory
|
|
111
|
-
* cache so subsequent reads in this process reflect the cleared state.
|
|
112
|
-
*/
|
|
113
|
-
export declare function clearPreferences(): void;
|
|
114
|
-
/** Test seam — resets the in-memory cache between test cases. */
|
|
115
|
-
export declare function __resetPreferencesCache(): void;
|
package/dist/lib/preferences.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plain CLI preferences store.
|
|
3
|
-
*
|
|
4
|
-
* Stored at ~/.workos/preferences.json as plain JSON. These are NOT secrets —
|
|
5
|
-
* knowing that someone opted out of telemetry leaks nothing — so this
|
|
6
|
-
* deliberately avoids the keyring abstraction (config-store.ts) to prevent a
|
|
7
|
-
* non-secret write from ever triggering the insecure-fallback security warning.
|
|
8
|
-
*
|
|
9
|
-
* Mirrors the structural pattern of device-id.ts: a synchronous accessor backed
|
|
10
|
-
* by a cache, an async prewarm that populates that cache off the blocking-fs
|
|
11
|
-
* path, and a never-throws contract on every read/parse so a corrupt file can
|
|
12
|
-
* never break a command.
|
|
13
|
-
*/
|
|
14
|
-
import fs from 'node:fs';
|
|
15
|
-
import { readFile } from 'node:fs/promises';
|
|
16
|
-
import path from 'node:path';
|
|
17
|
-
import os from 'node:os';
|
|
18
|
-
let cached;
|
|
19
|
-
let pending;
|
|
20
|
-
export function getPreferencesPath() {
|
|
21
|
-
return path.join(os.homedir(), '.workos', 'preferences.json');
|
|
22
|
-
}
|
|
23
|
-
function parsePreferences(raw) {
|
|
24
|
-
try {
|
|
25
|
-
const value = JSON.parse(raw);
|
|
26
|
-
// Defend against a file that parses to a non-object (e.g. `"true"`, `42`).
|
|
27
|
-
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
// Corrupt JSON — fall through to empty preferences. A later savePreferences
|
|
33
|
-
// overwrites it cleanly; we never auto-delete.
|
|
34
|
-
}
|
|
35
|
-
return {};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Asynchronously load preferences and warm the cache the synchronous
|
|
39
|
-
* getPreferences() reads. Memoized: the first call performs the IO, concurrent
|
|
40
|
-
* and later callers await the same promise. Prewarming this at startup keeps
|
|
41
|
-
* the synchronous telemetry path off blocking fs IO. Never rejects.
|
|
42
|
-
*/
|
|
43
|
-
export function loadPreferences() {
|
|
44
|
-
if (cached)
|
|
45
|
-
return Promise.resolve(cached);
|
|
46
|
-
if (pending)
|
|
47
|
-
return pending;
|
|
48
|
-
pending = (async () => {
|
|
49
|
-
try {
|
|
50
|
-
const raw = await readFile(getPreferencesPath(), 'utf8');
|
|
51
|
-
cached = parsePreferences(raw);
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
// Missing/unreadable file — treat as no preferences set.
|
|
55
|
-
cached = {};
|
|
56
|
-
}
|
|
57
|
-
finally {
|
|
58
|
-
pending = undefined;
|
|
59
|
-
}
|
|
60
|
-
return cached;
|
|
61
|
-
})();
|
|
62
|
-
return pending;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Synchronous accessor. Returns the prewarmed value when loadPreferences() has
|
|
66
|
-
* run; otherwise performs a one-time synchronous read of the same file. On any
|
|
67
|
-
* IO/parse failure returns {} (telemetry stays at its default-on state). Never
|
|
68
|
-
* throws.
|
|
69
|
-
*/
|
|
70
|
-
export function getPreferences() {
|
|
71
|
-
if (cached)
|
|
72
|
-
return cached;
|
|
73
|
-
try {
|
|
74
|
-
const raw = fs.readFileSync(getPreferencesPath(), 'utf8');
|
|
75
|
-
cached = parsePreferences(raw);
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
// Missing/unreadable/corrupt — telemetry stays at its default-on state.
|
|
79
|
-
cached = {};
|
|
80
|
-
}
|
|
81
|
-
return cached;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Read-modify-write the on-disk preferences, merging `next` over the current
|
|
85
|
-
* persisted value so future fields are never clobbered, then update the cache.
|
|
86
|
-
* Throws on write failure so callers on the command path (opt-out/opt-in) can
|
|
87
|
-
* surface a clear error — the read path swallows, the write path does not.
|
|
88
|
-
*/
|
|
89
|
-
export function savePreferences(next) {
|
|
90
|
-
const filePath = getPreferencesPath();
|
|
91
|
-
// Read-modify-write over the CURRENT on-disk value (not the cache) so a field
|
|
92
|
-
// written by another process / a future phase is preserved.
|
|
93
|
-
let current = {};
|
|
94
|
-
try {
|
|
95
|
-
current = parsePreferences(fs.readFileSync(filePath, 'utf8'));
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
98
|
-
// No existing file (or unreadable) — start from empty.
|
|
99
|
-
}
|
|
100
|
-
const merged = {
|
|
101
|
-
...current,
|
|
102
|
-
...next,
|
|
103
|
-
...(current.telemetry || next.telemetry ? { telemetry: { ...current.telemetry, ...next.telemetry } } : {}),
|
|
104
|
-
// Deep-merge mcp too so writing one marker (e.g. bannerShownAt) never
|
|
105
|
-
// clobbers the other (promptDeclined), which are written at different times.
|
|
106
|
-
...(current.mcp || next.mcp ? { mcp: { ...current.mcp, ...next.mcp } } : {}),
|
|
107
|
-
};
|
|
108
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true, mode: 0o700 });
|
|
109
|
-
fs.writeFileSync(filePath, JSON.stringify(merged), { encoding: 'utf8', mode: 0o600 });
|
|
110
|
-
cached = merged;
|
|
111
|
-
}
|
|
112
|
-
/** Whether the user has explicitly opted out via the saved preference. */
|
|
113
|
-
export function isTelemetryOptedOut() {
|
|
114
|
-
return getPreferences().telemetry?.optedOut === true;
|
|
115
|
-
}
|
|
116
|
-
/** Persist the opt-out flag. Throws on write failure (see savePreferences). */
|
|
117
|
-
export function setTelemetryOptedOut(value) {
|
|
118
|
-
savePreferences({ telemetry: { optedOut: value } });
|
|
119
|
-
}
|
|
120
|
-
/** Whether the first-run telemetry notice has already been shown (ever). */
|
|
121
|
-
export function isNoticeShown() {
|
|
122
|
-
return !!getPreferences().telemetry?.noticeShownAt;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Persist the first-run notice as shown, stamping the current time. Uses the
|
|
126
|
-
* read-modify-write savePreferences so it never clobbers the optedOut flag.
|
|
127
|
-
* Throws on write failure (see savePreferences) — the caller in
|
|
128
|
-
* telemetry-notice.ts swallows it so a read-only FS never blocks a command.
|
|
129
|
-
*/
|
|
130
|
-
export function markNoticeShown() {
|
|
131
|
-
savePreferences({ telemetry: { noticeShownAt: new Date().toISOString() } });
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Tri-state env override for telemetry.
|
|
135
|
-
*
|
|
136
|
-
* Only the explicit strings 'true' / 'false' count as an override. Any other
|
|
137
|
-
* value — including unset or garbage like '1' — returns undefined and falls
|
|
138
|
-
* through to the saved preference.
|
|
139
|
-
*
|
|
140
|
-
* This is a deliberate, documented change from the old `WORKOS_TELEMETRY !==
|
|
141
|
-
* 'false'` behaviour: previously `WORKOS_TELEMETRY=1` forced telemetry on even
|
|
142
|
-
* for opted-out users; now an opt-out is respected unless the env var
|
|
143
|
-
* explicitly says 'true'.
|
|
144
|
-
*/
|
|
145
|
-
export function envTelemetryOverride() {
|
|
146
|
-
const value = process.env.WORKOS_TELEMETRY;
|
|
147
|
-
if (value === 'true')
|
|
148
|
-
return true;
|
|
149
|
-
if (value === 'false')
|
|
150
|
-
return false;
|
|
151
|
-
return undefined;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Effective telemetry-enabled decision.
|
|
155
|
-
*
|
|
156
|
-
* Resolution order:
|
|
157
|
-
* 1. envTelemetryOverride() if defined — env wins in BOTH directions.
|
|
158
|
-
* 2. otherwise !isTelemetryOptedOut() — default-on unless explicitly opted out.
|
|
159
|
-
*/
|
|
160
|
-
export function isTelemetryEnabled() {
|
|
161
|
-
const override = envTelemetryOverride();
|
|
162
|
-
if (override !== undefined)
|
|
163
|
-
return override;
|
|
164
|
-
return !isTelemetryOptedOut();
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Which signal produced the effective telemetry decision. Mirrors the
|
|
168
|
-
* precedence in isTelemetryEnabled() so the `telemetry status` command and the
|
|
169
|
-
* resolver can never drift.
|
|
170
|
-
*
|
|
171
|
-
* Note: an explicit opt-in (optedOut === false) reads as 'default', not
|
|
172
|
-
* 'preference' — its outcome is identical to a fresh install, and the resolver
|
|
173
|
-
* only treats optedOut === true as a non-default signal, so reporting
|
|
174
|
-
* 'preference' here would imply a behavioral difference that does not exist.
|
|
175
|
-
*/
|
|
176
|
-
export function getTelemetrySource() {
|
|
177
|
-
if (envTelemetryOverride() !== undefined)
|
|
178
|
-
return 'env';
|
|
179
|
-
if (isTelemetryOptedOut())
|
|
180
|
-
return 'preference';
|
|
181
|
-
return 'default';
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Delete the preferences file, returning telemetry to its fresh-install state
|
|
185
|
-
* (opted-in, first-run notice unseen). Used by `debug reset` to wipe stored CLI
|
|
186
|
-
* state alongside credentials and config. No-op if the file does not exist;
|
|
187
|
-
* throws on a real delete failure (e.g. permission denied) so the caller can
|
|
188
|
-
* surface it, mirroring clearConfig/clearCredentials. Resets the in-memory
|
|
189
|
-
* cache so subsequent reads in this process reflect the cleared state.
|
|
190
|
-
*/
|
|
191
|
-
export function clearPreferences() {
|
|
192
|
-
fs.rmSync(getPreferencesPath(), { force: true });
|
|
193
|
-
cached = {};
|
|
194
|
-
pending = undefined;
|
|
195
|
-
}
|
|
196
|
-
/** Test seam — resets the in-memory cache between test cases. */
|
|
197
|
-
export function __resetPreferencesCache() {
|
|
198
|
-
cached = undefined;
|
|
199
|
-
pending = undefined;
|
|
200
|
-
}
|
|
201
|
-
//# sourceMappingURL=preferences.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../src/lib/preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AA4BzB,IAAI,MAAkC,CAAC;AACvC,IAAI,OAA4C,CAAC;AAEjD,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,2EAA2E;QAC3E,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChE,OAAO,KAAuB,CAAC;QACjC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;QAC5E,+CAA+C;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ferences store.\n *\n * Stored at ~/.workos/preferences.json as plain JSON. These are NOT secrets —\n * knowing that someone opted out of telemetry leaks nothing — so this\n * deliberately avoids the keyring abstraction (config-store.ts) to prevent a\n * non-secret write from ever triggering the insecure-fallback security warning.\n *\n * Mirrors the structural pattern of device-id.ts: a synchronous accessor backed\n * by a cache, an async prewarm that populates that cache off the blocking-fs\n * path, and a never-throws contract on every read/parse so a corrupt file can\n * never break a command.\n */\n\nimport fs from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport os from 'node:os';\n\nexport interface CliPreferences {\n telemetry?: {\n /** true => the user explicitly opted out of telemetry. */\n optedOut?: boolean;\n /** ISO timestamp the first-run notice was shown — written in Phase 2 only. */\n noticeShownAt?: string;\n };\n /**\n * MCP-install onboarding state. Owned semantically by lib/mcp-notice.ts; the\n * shape lives here so it rides the same plain-JSON prefs store as telemetry.\n */\n mcp?: {\n /**\n * true => the user explicitly declined an automatic MCP install offer. The\n * decline is absolute: no automatic surface (prompt or banner) asks again;\n * `workos mcp install` stays available manually.\n */\n promptDeclined?: boolean;\n /** ISO timestamp the one-time MCP banner was shown. */\n bannerShownAt?: string;\n };\n}\n\n/** Effective source of the resolved telemetry-enabled decision. */\nexport type TelemetrySource = 'env' | 'preference' | 'default';\n\nlet cached: CliPreferences | undefined;\nlet pending: Promise<CliPreferences> | undefined;\n\nexport function getPreferencesPath(): string {\n return path.join(os.homedir(), '.workos', 'preferences.json');\n}\n\nfunction parsePreferences(raw: string): CliPreferences {\n try {\n const value = JSON.parse(raw);\n // Defend against a file that parses to a non-object (e.g. `\"true\"`, `42`).\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n return value as CliPreferences;\n }\n } catch {\n // Corrupt JSON — fall through to empty preferences. A later savePreferences\n // overwrites it cleanly; we never auto-delete.\n }\n return {};\n}\n\n/**\n * Asynchronously load preferences and warm the cache the synchronous\n * getPreferences() reads. Memoized: the first call performs the IO, concurrent\n * and later callers await the same promise. Prewarming this at startup keeps\n * the synchronous telemetry path off blocking fs IO. Never rejects.\n */\nexport function loadPreferences(): Promise<CliPreferences> {\n if (cached) return Promise.resolve(cached);\n if (pending) return pending;\n\n pending = (async () => {\n try {\n const raw = await readFile(getPreferencesPath(), 'utf8');\n cached = parsePreferences(raw);\n } catch {\n // Missing/unreadable file — treat as no preferences set.\n cached = {};\n } finally {\n pending = undefined;\n }\n return cached;\n })();\n\n return pending;\n}\n\n/**\n * Synchronous accessor. Returns the prewarmed value when loadPreferences() has\n * run; otherwise performs a one-time synchronous read of the same file. On any\n * IO/parse failure returns {} (telemetry stays at its default-on state). Never\n * throws.\n */\nexport function getPreferences(): CliPreferences {\n if (cached) return cached;\n\n try {\n const raw = fs.readFileSync(getPreferencesPath(), 'utf8');\n cached = parsePreferences(raw);\n } catch {\n // Missing/unreadable/corrupt — telemetry stays at its default-on state.\n cached = {};\n }\n return cached;\n}\n\n/**\n * Read-modify-write the on-disk preferences, merging `next` over the current\n * persisted value so future fields are never clobbered, then update the cache.\n * Throws on write failure so callers on the command path (opt-out/opt-in) can\n * surface a clear error — the read path swallows, the write path does not.\n */\nexport function savePreferences(next: CliPreferences): void {\n const filePath = getPreferencesPath();\n\n // Read-modify-write over the CURRENT on-disk value (not the cache) so a field\n // written by another process / a future phase is preserved.\n let current: CliPreferences = {};\n try {\n current = parsePreferences(fs.readFileSync(filePath, 'utf8'));\n } catch {\n // No existing file (or unreadable) — start from empty.\n }\n\n const merged: CliPreferences = {\n ...current,\n ...next,\n ...(current.telemetry || next.telemetry ? { telemetry: { ...current.telemetry, ...next.telemetry } } : {}),\n // Deep-merge mcp too so writing one marker (e.g. bannerShownAt) never\n // clobbers the other (promptDeclined), which are written at different times.\n ...(current.mcp || next.mcp ? { mcp: { ...current.mcp, ...next.mcp } } : {}),\n };\n\n fs.mkdirSync(path.dirname(filePath), { recursive: true, mode: 0o700 });\n fs.writeFileSync(filePath, JSON.stringify(merged), { encoding: 'utf8', mode: 0o600 });\n cached = merged;\n}\n\n/** Whether the user has explicitly opted out via the saved preference. */\nexport function isTelemetryOptedOut(): boolean {\n return getPreferences().telemetry?.optedOut === true;\n}\n\n/** Persist the opt-out flag. Throws on write failure (see savePreferences). */\nexport function setTelemetryOptedOut(value: boolean): void {\n savePreferences({ telemetry: { optedOut: value } });\n}\n\n/** Whether the first-run telemetry notice has already been shown (ever). */\nexport function isNoticeShown(): boolean {\n return !!getPreferences().telemetry?.noticeShownAt;\n}\n\n/**\n * Persist the first-run notice as shown, stamping the current time. Uses the\n * read-modify-write savePreferences so it never clobbers the optedOut flag.\n * Throws on write failure (see savePreferences) — the caller in\n * telemetry-notice.ts swallows it so a read-only FS never blocks a command.\n */\nexport function markNoticeShown(): void {\n savePreferences({ telemetry: { noticeShownAt: new Date().toISOString() } });\n}\n\n/**\n * Tri-state env override for telemetry.\n *\n * Only the explicit strings 'true' / 'false' count as an override. Any other\n * value — including unset or garbage like '1' — returns undefined and falls\n * through to the saved preference.\n *\n * This is a deliberate, documented change from the old `WORKOS_TELEMETRY !==\n * 'false'` behaviour: previously `WORKOS_TELEMETRY=1` forced telemetry on even\n * for opted-out users; now an opt-out is respected unless the env var\n * explicitly says 'true'.\n */\nexport function envTelemetryOverride(): boolean | undefined {\n const value = process.env.WORKOS_TELEMETRY;\n if (value === 'true') return true;\n if (value === 'false') return false;\n return undefined;\n}\n\n/**\n * Effective telemetry-enabled decision.\n *\n * Resolution order:\n * 1. envTelemetryOverride() if defined — env wins in BOTH directions.\n * 2. otherwise !isTelemetryOptedOut() — default-on unless explicitly opted out.\n */\nexport function isTelemetryEnabled(): boolean {\n const override = envTelemetryOverride();\n if (override !== undefined) return override;\n return !isTelemetryOptedOut();\n}\n\n/**\n * Which signal produced the effective telemetry decision. Mirrors the\n * precedence in isTelemetryEnabled() so the `telemetry status` command and the\n * resolver can never drift.\n *\n * Note: an explicit opt-in (optedOut === false) reads as 'default', not\n * 'preference' — its outcome is identical to a fresh install, and the resolver\n * only treats optedOut === true as a non-default signal, so reporting\n * 'preference' here would imply a behavioral difference that does not exist.\n */\nexport function getTelemetrySource(): TelemetrySource {\n if (envTelemetryOverride() !== undefined) return 'env';\n if (isTelemetryOptedOut()) return 'preference';\n return 'default';\n}\n\n/**\n * Delete the preferences file, returning telemetry to its fresh-install state\n * (opted-in, first-run notice unseen). Used by `debug reset` to wipe stored CLI\n * state alongside credentials and config. No-op if the file does not exist;\n * throws on a real delete failure (e.g. permission denied) so the caller can\n * surface it, mirroring clearConfig/clearCredentials. Resets the in-memory\n * cache so subsequent reads in this process reflect the cleared state.\n */\nexport function clearPreferences(): void {\n fs.rmSync(getPreferencesPath(), { force: true });\n cached = {};\n pending = undefined;\n}\n\n/** Test seam — resets the in-memory cache between test cases. */\nexport function __resetPreferencesCache(): void {\n cached = undefined;\n pending = undefined;\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress tracking for wizard phases.
|
|
3
|
-
* Maps xstate machine states to user-friendly phase names.
|
|
4
|
-
*/
|
|
5
|
-
export interface Phase {
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
number: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const PHASES: Phase[];
|
|
11
|
-
export declare class ProgressTracker {
|
|
12
|
-
private currentPhase;
|
|
13
|
-
private completedPhases;
|
|
14
|
-
private readonly totalPhases;
|
|
15
|
-
enterPhase(stateId: string): void;
|
|
16
|
-
exitPhase(stateId: string): void;
|
|
17
|
-
getCurrentPhase(): Phase | null;
|
|
18
|
-
getCurrentIndicator(): string;
|
|
19
|
-
getCompletedSummary(): string[];
|
|
20
|
-
isComplete(): boolean;
|
|
21
|
-
reset(): void;
|
|
22
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress tracking for wizard phases.
|
|
3
|
-
* Maps xstate machine states to user-friendly phase names.
|
|
4
|
-
*/
|
|
5
|
-
export const PHASES = [
|
|
6
|
-
{ id: 'authenticating', name: 'Authentication', number: 1 },
|
|
7
|
-
{ id: 'preparing', name: 'Detection', number: 2 },
|
|
8
|
-
{ id: 'gatheringCredentials', name: 'Credentials', number: 3 },
|
|
9
|
-
{ id: 'configuring', name: 'Configuration', number: 4 },
|
|
10
|
-
{ id: 'runningAgent', name: 'Installation', number: 5 },
|
|
11
|
-
];
|
|
12
|
-
export class ProgressTracker {
|
|
13
|
-
currentPhase = null;
|
|
14
|
-
completedPhases = [];
|
|
15
|
-
totalPhases = PHASES.length;
|
|
16
|
-
enterPhase(stateId) {
|
|
17
|
-
const phase = PHASES.find((p) => p.id === stateId);
|
|
18
|
-
if (phase) {
|
|
19
|
-
this.currentPhase = phase;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exitPhase(stateId) {
|
|
23
|
-
const phase = PHASES.find((p) => p.id === stateId);
|
|
24
|
-
if (phase && !this.completedPhases.some((p) => p.id === phase.id)) {
|
|
25
|
-
this.completedPhases.push(phase);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
getCurrentPhase() {
|
|
29
|
-
return this.currentPhase;
|
|
30
|
-
}
|
|
31
|
-
getCurrentIndicator() {
|
|
32
|
-
if (!this.currentPhase)
|
|
33
|
-
return '';
|
|
34
|
-
return `[${this.currentPhase.number}/${this.totalPhases}] ${this.currentPhase.name}`;
|
|
35
|
-
}
|
|
36
|
-
getCompletedSummary() {
|
|
37
|
-
return this.completedPhases.map((p) => `✓ ${p.name}`);
|
|
38
|
-
}
|
|
39
|
-
isComplete() {
|
|
40
|
-
return this.completedPhases.length === this.totalPhases;
|
|
41
|
-
}
|
|
42
|
-
reset() {
|
|
43
|
-
this.currentPhase = null;
|
|
44
|
-
this.completedPhases = [];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=progress-tracker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress-tracker.js","sourceRoot":"","sources":["../../src/lib/progress-tracker.ts"],"names":[],"mappings":"A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;IACH,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,mBAAmB;QACjB,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,OAAO,EAAE,CAAC;QAClC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IACvF,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC;IAC1D,CAAC;IAED,KAAK;QACH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["/**\n * Progress tracking for wizard phases.\n * Maps xstate machine states to user-friendly phase names.\n */\n\nexport interface Phase {\n id: string;\n name: string;\n number: number;\n}\n\nexport const PHASES: Phase[] = [\n { id: 'authenticating', name: 'Authentication', number: 1 },\n { id: 'preparing', name: 'Detection', number: 2 },\n { id: 'gatheringCredentials', name: 'Credentials', number: 3 },\n { id: 'configuring', name: 'Configuration', number: 4 },\n { id: 'runningAgent', name: 'Installation', number: 5 },\n];\n\nexport class ProgressTracker {\n private currentPhase: Phase | null = null;\n private completedPhases: Phase[] = [];\n private readonly totalPhases = PHASES.length;\n\n enterPhase(stateId: string): void {\n const phase = PHASES.find((p) => p.id === stateId);\n if (phase) {\n this.currentPhase = phase;\n }\n }\n\n exitPhase(stateId: string): void {\n const phase = PHASES.find((p) => p.id === stateId);\n if (phase && !this.completedPhases.some((p) => p.id === phase.id)) {\n this.completedPhases.push(phase);\n }\n }\n\n getCurrentPhase(): Phase | null {\n return this.currentPhase;\n }\n\n getCurrentIndicator(): string {\n if (!this.currentPhase) return '';\n return `[${this.currentPhase.number}/${this.totalPhases}] ${this.currentPhase.name}`;\n }\n\n getCompletedSummary(): string[] {\n return this.completedPhases.map((p) => `✓ ${p.name}`);\n }\n\n isComplete(): boolean {\n return this.completedPhases.length === this.totalPhases;\n }\n\n reset(): void {\n this.currentPhase = null;\n this.completedPhases = [];\n }\n}\n"]}
|
package/dist/lib/registry.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { FrameworkConfig, Language } from './framework-config.js';
|
|
2
|
-
import type { InstallerOptions } from '../utils/types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Standard exports from an integration module.
|
|
5
|
-
* Each `src/integrations/{name}/index.ts` must export these.
|
|
6
|
-
*/
|
|
7
|
-
export interface IntegrationModule {
|
|
8
|
-
config: FrameworkConfig;
|
|
9
|
-
run: (options: InstallerOptions) => Promise<string>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Registry that provides lookup, detection, and enumeration of integrations.
|
|
13
|
-
*/
|
|
14
|
-
export interface IntegrationRegistry {
|
|
15
|
-
/** All registered integrations */
|
|
16
|
-
all(): FrameworkConfig[];
|
|
17
|
-
/** Get config by integration name */
|
|
18
|
-
get(name: string): IntegrationModule | undefined;
|
|
19
|
-
/** Get integrations for a specific language, ordered by priority */
|
|
20
|
-
forLanguage(language: Language): FrameworkConfig[];
|
|
21
|
-
/** Get integration names for CLI choices */
|
|
22
|
-
choices(): Array<{
|
|
23
|
-
name: string;
|
|
24
|
-
value: string;
|
|
25
|
-
}>;
|
|
26
|
-
/** Detection order: all integrations sorted by priority (higher = checked first) */
|
|
27
|
-
detectionOrder(): FrameworkConfig[];
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Build the integration registry by discovering all integration modules.
|
|
31
|
-
* Scans `src/integrations/` (or `dist/integrations/` at runtime) for directories
|
|
32
|
-
* with an index.js/index.ts file and dynamically imports them.
|
|
33
|
-
*/
|
|
34
|
-
export declare function buildRegistry(): Promise<IntegrationRegistry>;
|
|
35
|
-
/**
|
|
36
|
-
* Get the integration registry (builds once, caches thereafter).
|
|
37
|
-
*/
|
|
38
|
-
export declare function getRegistry(): Promise<IntegrationRegistry>;
|
|
39
|
-
/**
|
|
40
|
-
* Reset the registry cache. Used in tests.
|
|
41
|
-
*/
|
|
42
|
-
export declare function resetRegistry(): void;
|
package/dist/lib/registry.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { readdirSync, existsSync } from 'node:fs';
|
|
2
|
-
import { join, dirname } from 'node:path';
|
|
3
|
-
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
-
/**
|
|
5
|
-
* Build the integration registry by discovering all integration modules.
|
|
6
|
-
* Scans `src/integrations/` (or `dist/integrations/` at runtime) for directories
|
|
7
|
-
* with an index.js/index.ts file and dynamically imports them.
|
|
8
|
-
*/
|
|
9
|
-
export async function buildRegistry() {
|
|
10
|
-
const modules = new Map();
|
|
11
|
-
// Resolve the integrations directory relative to this file
|
|
12
|
-
// In dev: src/lib/registry.ts -> src/integrations/
|
|
13
|
-
// In dist: dist/lib/registry.js -> dist/integrations/
|
|
14
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
-
const __dirname = dirname(__filename);
|
|
16
|
-
const integrationsDir = join(__dirname, '..', 'integrations');
|
|
17
|
-
if (!existsSync(integrationsDir)) {
|
|
18
|
-
throw new Error(`No integrations directory found at ${integrationsDir}. Is the build corrupt?`);
|
|
19
|
-
}
|
|
20
|
-
const entries = readdirSync(integrationsDir, { withFileTypes: true });
|
|
21
|
-
const dirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
22
|
-
if (dirs.length === 0) {
|
|
23
|
-
throw new Error('No integrations found. Is the build corrupt?');
|
|
24
|
-
}
|
|
25
|
-
for (const dir of dirs) {
|
|
26
|
-
// Skip directories starting with _ (convention for internal files like _manifest.ts)
|
|
27
|
-
if (dir.startsWith('_'))
|
|
28
|
-
continue;
|
|
29
|
-
const indexPath = join(integrationsDir, dir, 'index.js');
|
|
30
|
-
const indexTsPath = join(integrationsDir, dir, 'index.ts');
|
|
31
|
-
if (!existsSync(indexPath) && !existsSync(indexTsPath)) {
|
|
32
|
-
// Skip directories without an index file (not an integration)
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
const mod = (await import(pathToFileURL(join(integrationsDir, dir, 'index.js')).href));
|
|
37
|
-
if (!mod.config || !mod.run) {
|
|
38
|
-
console.warn(`Integration ${dir} missing 'config' or 'run' export, skipping`);
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
const name = mod.config.metadata.integration;
|
|
42
|
-
if (modules.has(name)) {
|
|
43
|
-
throw new Error(`Duplicate integration name: '${name}' (found in both existing and '${dir}/')`);
|
|
44
|
-
}
|
|
45
|
-
modules.set(name, mod);
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
if (err instanceof Error && err.message.startsWith('Duplicate integration name')) {
|
|
49
|
-
throw err; // Re-throw duplicate name errors
|
|
50
|
-
}
|
|
51
|
-
console.warn(`Failed to load integration from ${dir}/: ${err}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// Build sorted config array (by priority, descending)
|
|
55
|
-
const sortedConfigs = Array.from(modules.values())
|
|
56
|
-
.map((m) => m.config)
|
|
57
|
-
.sort((a, b) => b.metadata.priority - a.metadata.priority);
|
|
58
|
-
return {
|
|
59
|
-
all() {
|
|
60
|
-
return sortedConfigs;
|
|
61
|
-
},
|
|
62
|
-
get(name) {
|
|
63
|
-
return modules.get(name);
|
|
64
|
-
},
|
|
65
|
-
forLanguage(language) {
|
|
66
|
-
return sortedConfigs.filter((c) => c.metadata.language === language);
|
|
67
|
-
},
|
|
68
|
-
choices() {
|
|
69
|
-
return sortedConfigs.map((c) => ({
|
|
70
|
-
name: c.metadata.name,
|
|
71
|
-
value: c.metadata.integration,
|
|
72
|
-
}));
|
|
73
|
-
},
|
|
74
|
-
detectionOrder() {
|
|
75
|
-
return sortedConfigs;
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
// Singleton cache
|
|
80
|
-
let _registry = null;
|
|
81
|
-
/**
|
|
82
|
-
* Get the integration registry (builds once, caches thereafter).
|
|
83
|
-
*/
|
|
84
|
-
export async function getRegistry() {
|
|
85
|
-
if (!_registry) {
|
|
86
|
-
_registry = await buildRegistry();
|
|
87
|
-
}
|
|
88
|
-
return _registry;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Reset the registry cache. Used in tests.
|
|
92
|
-
*/
|
|
93
|
-
export function resetRegistry() {
|
|
94
|
-
_registry = null;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=registry.js.map
|
package/dist/lib/registry.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/lib/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiCxD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;IAErD,2DAA2D;IAC3D,mDAAmD;IACnD,sDAAsD;IACtD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IAE9D,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACjC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AAC,CAAC;gBAC/B,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI;gBACrB,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW;aAC9B,CAAC,CAAC,CAAC;QACN,CAAC;QAED,cAAc;YACZ,OAAO,aAAa,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kBAAkB;AAClB,IAAI,SAAS,GAA+B,IAAI,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,MAAM,aAAa,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,SAAS,GAAG,IAAI,CAAC;AACnB,CAAC","sourcesContent":["import { readdirSync, existsSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport type { FrameworkConfig, Language } from './framework-config.js';\nimport type { InstallerOptions } from '../utils/types.js';\n\n/**\n * Standard exports from an integration module.\n * Each `src/integrations/{name}/index.ts` must export these.\n */\nexport interface IntegrationModule {\n config: FrameworkConfig;\n run: (options: InstallerOptions) => Promise<string>;\n}\n\n/**\n * Registry that provides lookup, detection, and enumeration of integrations.\n */\nexport interface IntegrationRegistry {\n /** All registered integrations */\n all(): FrameworkConfig[];\n\n /** Get config by integration name */\n get(name: string): IntegrationModule | undefined;\n\n /** Get integrations for a specific language, ordered by priority */\n forLanguage(language: Language): FrameworkConfig[];\n\n /** Get integration names for CLI choices */\n choices(): Array<{ name: string; value: string }>;\n\n /** Detection order: all integrations sorted by priority (higher = checked first) */\n detectionOrder(): FrameworkConfig[];\n}\n\n/**\n * Build the integration registry by discovering all integration modules.\n * Scans `src/integrations/` (or `dist/integrations/` at runtime) for directories\n * with an index.js/index.ts file and dynamically imports them.\n */\nexport async function buildRegistry(): Promise<IntegrationRegistry> {\n const modules = new Map<string, IntegrationModule>();\n\n // Resolve the integrations directory relative to this file\n // In dev: src/lib/registry.ts -> src/integrations/\n // In dist: dist/lib/registry.js -> dist/integrations/\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n const integrationsDir = join(__dirname, '..', 'integrations');\n\n if (!existsSync(integrationsDir)) {\n throw new Error(`No integrations directory found at ${integrationsDir}. Is the build corrupt?`);\n }\n\n const entries = readdirSync(integrationsDir, { withFileTypes: true });\n const dirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);\n\n if (dirs.length === 0) {\n throw new Error('No integrations found. Is the build corrupt?');\n }\n\n for (const dir of dirs) {\n // Skip directories starting with _ (convention for internal files like _manifest.ts)\n if (dir.startsWith('_')) continue;\n\n const indexPath = join(integrationsDir, dir, 'index.js');\n const indexTsPath = join(integrationsDir, dir, 'index.ts');\n\n if (!existsSync(indexPath) && !existsSync(indexTsPath)) {\n // Skip directories without an index file (not an integration)\n continue;\n }\n\n try {\n const mod = (await import(pathToFileURL(join(integrationsDir, dir, 'index.js')).href)) as IntegrationModule;\n\n if (!mod.config || !mod.run) {\n console.warn(`Integration ${dir} missing 'config' or 'run' export, skipping`);\n continue;\n }\n\n const name = mod.config.metadata.integration;\n\n if (modules.has(name)) {\n throw new Error(`Duplicate integration name: '${name}' (found in both existing and '${dir}/')`);\n }\n\n modules.set(name, mod);\n } catch (err) {\n if (err instanceof Error && err.message.startsWith('Duplicate integration name')) {\n throw err; // Re-throw duplicate name errors\n }\n console.warn(`Failed to load integration from ${dir}/: ${err}`);\n }\n }\n\n // Build sorted config array (by priority, descending)\n const sortedConfigs = Array.from(modules.values())\n .map((m) => m.config)\n .sort((a, b) => b.metadata.priority - a.metadata.priority);\n\n return {\n all() {\n return sortedConfigs;\n },\n\n get(name: string) {\n return modules.get(name);\n },\n\n forLanguage(language: Language) {\n return sortedConfigs.filter((c) => c.metadata.language === language);\n },\n\n choices() {\n return sortedConfigs.map((c) => ({\n name: c.metadata.name,\n value: c.metadata.integration,\n }));\n },\n\n detectionOrder() {\n return sortedConfigs;\n },\n };\n}\n\n// Singleton cache\nlet _registry: IntegrationRegistry | null = null;\n\n/**\n * Get the integration registry (builds once, caches thereafter).\n */\nexport async function getRegistry(): Promise<IntegrationRegistry> {\n if (!_registry) {\n _registry = await buildRegistry();\n }\n return _registry;\n}\n\n/**\n * Reset the registry cache. Used in tests.\n */\nexport function resetRegistry(): void {\n _registry = null;\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve credentials for install flow.
|
|
3
|
-
* Priority: existing creds (env var, --api-key, active env) -> unclaimed env provisioning -> login fallback.
|
|
4
|
-
*
|
|
5
|
-
* The installer needs both API credentials (for WorkOS API calls) AND gateway auth
|
|
6
|
-
* (for the LLM agent). This function ensures both are available:
|
|
7
|
-
* - Unclaimed env: API key + claim token (claim token proxy handles gateway)
|
|
8
|
-
* - Logged-in user: API key + OAuth token (credential proxy handles gateway)
|
|
9
|
-
* - Direct mode: not handled here (resolved in agent-interface.ts via ANTHROPIC_API_KEY)
|
|
10
|
-
*/
|
|
11
|
-
export declare function resolveInstallCredentials(apiKey: string | undefined, installDir: string | undefined, skipAuth: boolean | undefined, authenticate: () => Promise<unknown>): Promise<void>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve credentials for install flow.
|
|
3
|
-
* Priority: existing creds (env var, --api-key, active env) -> unclaimed env provisioning -> login fallback.
|
|
4
|
-
*
|
|
5
|
-
* The installer needs both API credentials (for WorkOS API calls) AND gateway auth
|
|
6
|
-
* (for the LLM agent). This function ensures both are available:
|
|
7
|
-
* - Unclaimed env: API key + claim token (claim token proxy handles gateway)
|
|
8
|
-
* - Logged-in user: API key + OAuth token (credential proxy handles gateway)
|
|
9
|
-
* - Direct mode: not handled here (resolved in agent-interface.ts via ANTHROPIC_API_KEY)
|
|
10
|
-
*/
|
|
11
|
-
export async function resolveInstallCredentials(apiKey, installDir, skipAuth, authenticate) {
|
|
12
|
-
// Explicit API key from env var or flag — user handles gateway auth separately
|
|
13
|
-
const envApiKey = process.env.WORKOS_API_KEY;
|
|
14
|
-
if (envApiKey)
|
|
15
|
-
return;
|
|
16
|
-
if (apiKey)
|
|
17
|
-
return;
|
|
18
|
-
try {
|
|
19
|
-
const { getActiveEnvironment, isUnclaimedEnvironment } = await import('./config-store.js');
|
|
20
|
-
const { getAccessToken } = await import('./credentials.js');
|
|
21
|
-
const activeEnv = getActiveEnvironment();
|
|
22
|
-
if (activeEnv?.apiKey) {
|
|
23
|
-
// Has API key — but does it have gateway auth?
|
|
24
|
-
if (isUnclaimedEnvironment(activeEnv)) {
|
|
25
|
-
// Unclaimed with claim token — claim token proxy will handle gateway
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (getAccessToken()) {
|
|
29
|
-
// Has a valid OAuth token — credential proxy will handle gateway.
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
// Has API key but no valid gateway auth — refresh or log in.
|
|
33
|
-
if (!skipAuth)
|
|
34
|
-
await authenticate();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
// No existing credentials — try unclaimed env provisioning
|
|
38
|
-
const { tryProvisionUnclaimedEnv } = await import('./unclaimed-env-provision.js');
|
|
39
|
-
const dir = installDir ?? process.cwd();
|
|
40
|
-
const provisioned = await tryProvisionUnclaimedEnv({ installDir: dir });
|
|
41
|
-
if (!provisioned) {
|
|
42
|
-
// Unclaimed env provisioning failed — fall back to login
|
|
43
|
-
if (!skipAuth)
|
|
44
|
-
await authenticate();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
const { logError } = await import('../utils/debug.js');
|
|
49
|
-
logError('[resolve-install-credentials] Failed:', error instanceof Error ? error.message : String(error));
|
|
50
|
-
throw error;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=resolve-install-credentials.js.map
|