workos 0.0.24 → 0.1.0
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/.claude-plugin/plugin.json +13 -0
- package/LICENSE +47 -0
- package/README.md +154 -1
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +163 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.config.d.ts +52 -0
- package/dist/cli.config.js +70 -0
- package/dist/cli.config.js.map +1 -0
- package/dist/package.json +87 -0
- package/dist/src/commands/install-skill.d.ts +20 -0
- package/dist/src/commands/install-skill.js +130 -0
- package/dist/src/commands/install-skill.js.map +1 -0
- package/dist/src/commands/install.d.ts +22 -0
- package/dist/src/commands/install.js +57 -0
- package/dist/src/commands/install.js.map +1 -0
- package/dist/src/commands/login.d.ts +1 -0
- package/dist/src/commands/login.js +141 -0
- package/dist/src/commands/login.js.map +1 -0
- package/dist/src/commands/logout.d.ts +1 -0
- package/dist/src/commands/logout.js +17 -0
- package/dist/src/commands/logout.js.map +1 -0
- package/dist/src/dashboard/components/AnimatedLogo.d.ts +8 -0
- package/dist/src/dashboard/components/AnimatedLogo.js +16 -0
- package/dist/src/dashboard/components/AnimatedLogo.js.map +1 -0
- package/dist/src/dashboard/components/CompletionView.d.ts +13 -0
- package/dist/src/dashboard/components/CompletionView.js +21 -0
- package/dist/src/dashboard/components/CompletionView.js.map +1 -0
- package/dist/src/dashboard/components/ConfirmPrompt.d.ts +9 -0
- package/dist/src/dashboard/components/ConfirmPrompt.js +25 -0
- package/dist/src/dashboard/components/ConfirmPrompt.js.map +1 -0
- package/dist/src/dashboard/components/CredentialsForm.d.ts +10 -0
- package/dist/src/dashboard/components/CredentialsForm.js +47 -0
- package/dist/src/dashboard/components/CredentialsForm.js.map +1 -0
- package/dist/src/dashboard/components/Dashboard.d.ts +3 -0
- package/dist/src/dashboard/components/Dashboard.js +100 -0
- package/dist/src/dashboard/components/Dashboard.js.map +1 -0
- package/dist/src/dashboard/components/DashboardLayout.d.ts +24 -0
- package/dist/src/dashboard/components/DashboardLayout.js +25 -0
- package/dist/src/dashboard/components/DashboardLayout.js.map +1 -0
- package/dist/src/dashboard/components/DiffPanel.d.ts +9 -0
- package/dist/src/dashboard/components/DiffPanel.js +136 -0
- package/dist/src/dashboard/components/DiffPanel.js.map +1 -0
- package/dist/src/dashboard/components/InlinePrompt.d.ts +8 -0
- package/dist/src/dashboard/components/InlinePrompt.js +19 -0
- package/dist/src/dashboard/components/InlinePrompt.js.map +1 -0
- package/dist/src/dashboard/components/OutputPanel.d.ts +10 -0
- package/dist/src/dashboard/components/OutputPanel.js +100 -0
- package/dist/src/dashboard/components/OutputPanel.js.map +1 -0
- package/dist/src/dashboard/components/Panel.d.ts +12 -0
- package/dist/src/dashboard/components/Panel.js +6 -0
- package/dist/src/dashboard/components/Panel.js.map +1 -0
- package/dist/src/dashboard/components/TextInput.d.ts +13 -0
- package/dist/src/dashboard/components/TextInput.js +57 -0
- package/dist/src/dashboard/components/TextInput.js.map +1 -0
- package/dist/src/dashboard/components/WelcomeArt.d.ts +2 -0
- package/dist/src/dashboard/components/WelcomeArt.js +9 -0
- package/dist/src/dashboard/components/WelcomeArt.js.map +1 -0
- package/dist/src/dashboard/hooks/useAnimation.d.ts +7 -0
- package/dist/src/dashboard/hooks/useAnimation.js +24 -0
- package/dist/src/dashboard/hooks/useAnimation.js.map +1 -0
- package/dist/src/dashboard/hooks/useKeyboard.d.ts +8 -0
- package/dist/src/dashboard/hooks/useKeyboard.js +18 -0
- package/dist/src/dashboard/hooks/useKeyboard.js.map +1 -0
- package/dist/src/dashboard/hooks/useTerminalSize.d.ts +8 -0
- package/dist/src/dashboard/hooks/useTerminalSize.js +23 -0
- package/dist/src/dashboard/hooks/useTerminalSize.js.map +1 -0
- package/dist/src/dashboard/index.d.ts +6 -0
- package/dist/src/dashboard/index.js +36 -0
- package/dist/src/dashboard/index.js.map +1 -0
- package/dist/src/dashboard/lib/diff-utils.d.ts +21 -0
- package/dist/src/dashboard/lib/diff-utils.js +271 -0
- package/dist/src/dashboard/lib/diff-utils.js.map +1 -0
- package/dist/src/dashboard/lib/logo-frames.d.ts +20 -0
- package/dist/src/dashboard/lib/logo-frames.js +109 -0
- package/dist/src/dashboard/lib/logo-frames.js.map +1 -0
- package/dist/src/dashboard/lib/welcome-art.d.ts +1 -0
- package/dist/src/dashboard/lib/welcome-art.js +5 -0
- package/dist/src/dashboard/lib/welcome-art.js.map +1 -0
- package/dist/src/dashboard/types.d.ts +5 -0
- package/dist/src/dashboard/types.js +2 -0
- package/dist/src/dashboard/types.js.map +1 -0
- package/dist/src/lib/__tests__/test-utils.d.ts +40 -0
- package/dist/src/lib/__tests__/test-utils.js +108 -0
- package/dist/src/lib/__tests__/test-utils.js.map +1 -0
- package/dist/src/lib/adapters/cli-adapter.d.ts +56 -0
- package/dist/src/lib/adapters/cli-adapter.js +318 -0
- package/dist/src/lib/adapters/cli-adapter.js.map +1 -0
- package/dist/src/lib/adapters/dashboard-adapter.d.ts +30 -0
- package/dist/src/lib/adapters/dashboard-adapter.js +97 -0
- package/dist/src/lib/adapters/dashboard-adapter.js.map +1 -0
- package/dist/src/lib/adapters/index.d.ts +3 -0
- package/dist/src/lib/adapters/index.js +3 -0
- package/dist/src/lib/adapters/index.js.map +1 -0
- package/dist/src/lib/adapters/types.d.ts +41 -0
- package/dist/src/lib/adapters/types.js +2 -0
- package/dist/src/lib/adapters/types.js.map +1 -0
- package/dist/src/lib/agent-interface.d.ts +75 -0
- package/dist/src/lib/agent-interface.js +563 -0
- package/dist/src/lib/agent-interface.js.map +1 -0
- package/dist/src/lib/agent-runner.d.ts +9 -0
- package/dist/src/lib/agent-runner.js +213 -0
- package/dist/src/lib/agent-runner.js.map +1 -0
- package/dist/src/lib/api.d.ts +25 -0
- package/dist/src/lib/api.js +120 -0
- package/dist/src/lib/api.js.map +1 -0
- package/dist/src/lib/config.d.ts +60 -0
- package/dist/src/lib/config.js +88 -0
- package/dist/src/lib/config.js.map +1 -0
- package/dist/src/lib/constants.d.ts +32 -0
- package/dist/src/lib/constants.js +53 -0
- package/dist/src/lib/constants.js.map +1 -0
- package/dist/src/lib/credentials.d.ts +19 -0
- package/dist/src/lib/credentials.js +55 -0
- package/dist/src/lib/credentials.js.map +1 -0
- package/dist/src/lib/env-writer.d.ts +14 -0
- package/dist/src/lib/env-writer.js +39 -0
- package/dist/src/lib/env-writer.js.map +1 -0
- package/dist/src/lib/events.d.ts +114 -0
- package/dist/src/lib/events.js +19 -0
- package/dist/src/lib/events.js.map +1 -0
- package/dist/src/lib/framework-config.d.ts +108 -0
- package/dist/src/lib/framework-config.js +11 -0
- package/dist/src/lib/framework-config.js.map +1 -0
- package/dist/src/lib/helper-functions.d.ts +1 -0
- package/dist/src/lib/helper-functions.js +2 -0
- package/dist/src/lib/helper-functions.js.map +1 -0
- package/dist/src/lib/port-detection.d.ts +7 -0
- package/dist/src/lib/port-detection.js +112 -0
- package/dist/src/lib/port-detection.js.map +1 -0
- package/dist/src/lib/progress-tracker.d.ts +22 -0
- package/dist/src/lib/progress-tracker.js +47 -0
- package/dist/src/lib/progress-tracker.js.map +1 -0
- package/dist/src/lib/run-with-core.d.ts +2 -0
- package/dist/src/lib/run-with-core.js +266 -0
- package/dist/src/lib/run-with-core.js.map +1 -0
- package/dist/src/lib/safe-tools.d.ts +2 -0
- package/dist/src/lib/safe-tools.js +212 -0
- package/dist/src/lib/safe-tools.js.map +1 -0
- package/dist/src/lib/settings.d.ts +59 -0
- package/dist/src/lib/settings.js +36 -0
- package/dist/src/lib/settings.js.map +1 -0
- package/dist/src/lib/token-refresh.d.ts +12 -0
- package/dist/src/lib/token-refresh.js +26 -0
- package/dist/src/lib/token-refresh.js.map +1 -0
- package/dist/src/lib/validation/build-validator.d.ts +9 -0
- package/dist/src/lib/validation/build-validator.js +118 -0
- package/dist/src/lib/validation/build-validator.js.map +1 -0
- package/dist/src/lib/validation/index.d.ts +3 -0
- package/dist/src/lib/validation/index.js +3 -0
- package/dist/src/lib/validation/index.js.map +1 -0
- package/dist/src/lib/validation/types.d.ts +41 -0
- package/dist/src/lib/validation/types.js +2 -0
- package/dist/src/lib/validation/types.js.map +1 -0
- package/dist/src/lib/validation/validator.d.ts +6 -0
- package/dist/src/lib/validation/validator.js +647 -0
- package/dist/src/lib/validation/validator.js.map +1 -0
- package/dist/src/lib/wizard-core.d.ts +200 -0
- package/dist/src/lib/wizard-core.js +392 -0
- package/dist/src/lib/wizard-core.js.map +1 -0
- package/dist/src/lib/wizard-core.types.d.ts +73 -0
- package/dist/src/lib/wizard-core.types.js +2 -0
- package/dist/src/lib/wizard-core.types.js.map +1 -0
- package/dist/src/lib/workos-management.d.ts +32 -0
- package/dist/src/lib/workos-management.js +142 -0
- package/dist/src/lib/workos-management.js.map +1 -0
- package/dist/src/nextjs/nextjs-wizard-agent.d.ts +6 -0
- package/dist/src/nextjs/nextjs-wizard-agent.js +97 -0
- package/dist/src/nextjs/nextjs-wizard-agent.js.map +1 -0
- package/dist/src/nextjs/utils.d.ts +8 -0
- package/dist/src/nextjs/utils.js +53 -0
- package/dist/src/nextjs/utils.js.map +1 -0
- package/dist/src/react/react-wizard-agent.d.ts +2 -0
- package/dist/src/react/react-wizard-agent.js +47 -0
- package/dist/src/react/react-wizard-agent.js.map +1 -0
- package/dist/src/react-router/react-router-wizard-agent.d.ts +6 -0
- package/dist/src/react-router/react-router-wizard-agent.js +103 -0
- package/dist/src/react-router/react-router-wizard-agent.js.map +1 -0
- package/dist/src/react-router/utils.d.ts +19 -0
- package/dist/src/react-router/utils.js +210 -0
- package/dist/src/react-router/utils.js.map +1 -0
- package/dist/src/run.d.ts +24 -0
- package/dist/src/run.js +48 -0
- package/dist/src/run.js.map +1 -0
- package/dist/src/steps/add-or-update-environment-variables.d.ts +10 -0
- package/dist/src/steps/add-or-update-environment-variables.js +155 -0
- package/dist/src/steps/add-or-update-environment-variables.js.map +1 -0
- package/dist/src/steps/index.d.ts +3 -0
- package/dist/src/steps/index.js +4 -0
- package/dist/src/steps/index.js.map +1 -0
- package/dist/src/steps/run-prettier.d.ts +5 -0
- package/dist/src/steps/run-prettier.js +54 -0
- package/dist/src/steps/run-prettier.js.map +1 -0
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.d.ts +8 -0
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.js +7 -0
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.js.map +1 -0
- package/dist/src/steps/upload-environment-variables/index.d.ts +6 -0
- package/dist/src/steps/upload-environment-variables/index.js +57 -0
- package/dist/src/steps/upload-environment-variables/index.js.map +1 -0
- package/dist/src/steps/upload-environment-variables/providers/vercel.d.ts +14 -0
- package/dist/src/steps/upload-environment-variables/providers/vercel.js +104 -0
- package/dist/src/steps/upload-environment-variables/providers/vercel.js.map +1 -0
- package/dist/src/tanstack-start/tanstack-start-wizard-agent.d.ts +2 -0
- package/dist/src/tanstack-start/tanstack-start-wizard-agent.js +49 -0
- package/dist/src/tanstack-start/tanstack-start-wizard-agent.js.map +1 -0
- package/dist/src/telemetry.d.ts +2 -0
- package/dist/src/telemetry.js +29 -0
- package/dist/src/telemetry.js.map +1 -0
- package/dist/src/utils/analytics.d.ts +24 -0
- package/dist/src/utils/analytics.js +139 -0
- package/dist/src/utils/analytics.js.map +1 -0
- package/dist/src/utils/bash.d.ts +2 -0
- package/dist/src/utils/bash.js +17 -0
- package/dist/src/utils/bash.js.map +1 -0
- package/dist/src/utils/clack-utils.d.ts +93 -0
- package/dist/src/utils/clack-utils.js +397 -0
- package/dist/src/utils/clack-utils.js.map +1 -0
- package/dist/src/utils/clack.d.ts +5 -0
- package/dist/src/utils/clack.js +34 -0
- package/dist/src/utils/clack.js.map +1 -0
- package/dist/src/utils/cli-symbols.d.ts +32 -0
- package/dist/src/utils/cli-symbols.js +46 -0
- package/dist/src/utils/cli-symbols.js.map +1 -0
- package/dist/src/utils/debug.d.ts +7 -0
- package/dist/src/utils/debug.js +88 -0
- package/dist/src/utils/debug.js.map +1 -0
- package/dist/src/utils/env-parser.d.ts +5 -0
- package/dist/src/utils/env-parser.js +18 -0
- package/dist/src/utils/env-parser.js.map +1 -0
- package/dist/src/utils/environment.d.ts +4 -0
- package/dist/src/utils/environment.js +69 -0
- package/dist/src/utils/environment.js.map +1 -0
- package/dist/src/utils/errors.d.ts +3 -0
- package/dist/src/utils/errors.js +7 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/logging.d.ts +9 -0
- package/dist/src/utils/logging.js +36 -0
- package/dist/src/utils/logging.js.map +1 -0
- package/dist/src/utils/package-json.d.ts +25 -0
- package/dist/src/utils/package-json.js +21 -0
- package/dist/src/utils/package-json.js.map +1 -0
- package/dist/src/utils/package-manager.d.ts +21 -0
- package/dist/src/utils/package-manager.js +167 -0
- package/dist/src/utils/package-manager.js.map +1 -0
- package/dist/src/utils/redact.d.ts +5 -0
- package/dist/src/utils/redact.js +29 -0
- package/dist/src/utils/redact.js.map +1 -0
- package/dist/src/utils/semver.d.ts +10 -0
- package/dist/src/utils/semver.js +43 -0
- package/dist/src/utils/semver.js.map +1 -0
- package/dist/src/utils/string.d.ts +1 -0
- package/dist/src/utils/string.js +6 -0
- package/dist/src/utils/string.js.map +1 -0
- package/dist/src/utils/telemetry-client.d.ts +15 -0
- package/dist/src/utils/telemetry-client.js +57 -0
- package/dist/src/utils/telemetry-client.js.map +1 -0
- package/dist/src/utils/telemetry-types.d.ts +51 -0
- package/dist/src/utils/telemetry-types.js +6 -0
- package/dist/src/utils/telemetry-types.js.map +1 -0
- package/dist/src/utils/types.d.ts +80 -0
- package/dist/src/utils/types.js +2 -0
- package/dist/src/utils/types.js.map +1 -0
- package/dist/src/utils/urls.d.ts +7 -0
- package/dist/src/utils/urls.js +8 -0
- package/dist/src/utils/urls.js.map +1 -0
- package/dist/src/utils/vendor/is-unicorn-supported.d.ts +1 -0
- package/dist/src/utils/vendor/is-unicorn-supported.js +21 -0
- package/dist/src/utils/vendor/is-unicorn-supported.js.map +1 -0
- package/dist/src/vanilla-js/vanilla-js-wizard-agent.d.ts +2 -0
- package/dist/src/vanilla-js/vanilla-js-wizard-agent.js +47 -0
- package/dist/src/vanilla-js/vanilla-js-wizard-agent.js.map +1 -0
- package/package.json +76 -84
- package/skills/workos-authkit-base/SKILL.md +113 -0
- package/skills/workos-authkit-nextjs/SKILL.md +115 -0
- package/skills/workos-authkit-react/SKILL.md +91 -0
- package/skills/workos-authkit-react-router/SKILL.md +106 -0
- package/skills/workos-authkit-tanstack-start/SKILL.md +104 -0
- package/skills/workos-authkit-vanilla-js/SKILL.md +81 -0
- package/build/apps/index.js +0 -50
- package/build/apps/slack.js +0 -151
- package/build/cli.js +0 -42
- package/build/config.js +0 -34
- package/build/dev.js +0 -5
- package/build/enable-api-access.png +0 -0
- package/build/groups.js +0 -480
- package/build/index.js +0 -3
- package/build/info.js +0 -69
- package/build/login.js +0 -161
- package/build/main.js +0 -214
- package/build/users.js +0 -402
- package/build/util.js +0 -157
- package/coverage/clover.xml +0 -66
- package/coverage/coverage-final.json +0 -4
- package/coverage/lcov-report/base.css +0 -212
- package/coverage/lcov-report/cli.ts.html +0 -329
- package/coverage/lcov-report/config.ts.html +0 -152
- package/coverage/lcov-report/index.html +0 -119
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -1
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -158
- package/coverage/lcov-report/util.ts.html +0 -350
- package/coverage/lcov.info +0 -121
- package/package-lock.json +0 -7617
- package/tests/util.test.ts +0 -35
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { major, minVersion, satisfies, subset, valid, validRange } from 'semver';
|
|
2
|
+
export function fulfillsVersionRange({ version, acceptableVersions, canBeLatest, }) {
|
|
3
|
+
if (version === 'latest') {
|
|
4
|
+
return canBeLatest;
|
|
5
|
+
}
|
|
6
|
+
let cleanedUserVersion, isRange;
|
|
7
|
+
if (valid(version)) {
|
|
8
|
+
cleanedUserVersion = valid(version);
|
|
9
|
+
isRange = false;
|
|
10
|
+
}
|
|
11
|
+
else if (validRange(version)) {
|
|
12
|
+
cleanedUserVersion = validRange(version);
|
|
13
|
+
isRange = true;
|
|
14
|
+
}
|
|
15
|
+
return (
|
|
16
|
+
// If the given version is a bogus format, this will still be undefined and we'll automatically reject it
|
|
17
|
+
!!cleanedUserVersion &&
|
|
18
|
+
(isRange ? subset(cleanedUserVersion, acceptableVersions) : satisfies(cleanedUserVersion, acceptableVersions)));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a version bucket string for analytics.
|
|
22
|
+
* Returns format like "15.x" for versions >= minimumMajor, or "<{minimumMajor}.0.0" otherwise.
|
|
23
|
+
*/
|
|
24
|
+
export function getVersionBucket(version, minimumMajor) {
|
|
25
|
+
if (!version) {
|
|
26
|
+
return 'none';
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const minVer = minVersion(version);
|
|
30
|
+
if (!minVer) {
|
|
31
|
+
return 'invalid';
|
|
32
|
+
}
|
|
33
|
+
const majorVersion = major(minVer);
|
|
34
|
+
if (majorVersion >= minimumMajor) {
|
|
35
|
+
return `${majorVersion}.x`;
|
|
36
|
+
}
|
|
37
|
+
return `<${minimumMajor}.0.0`;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return 'unknown';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=semver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../src/utils/semver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEjF,MAAM,UAAU,oBAAoB,CAAC,EACnC,OAAO,EACP,kBAAkB,EAClB,WAAW,GAKZ;IACC,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,kBAAkB,EAAE,OAAO,CAAC;IAEhC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACnB,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;SAAM,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,kBAAkB,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IAED,OAAO;IACL,yGAAyG;IACzG,CAAC,CAAC,kBAAkB;QACpB,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAC/G,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAA2B,EAAE,YAAoB;IAChF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,YAAY,IAAI,YAAY,EAAE,CAAC;YACjC,OAAO,GAAG,YAAY,IAAI,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,YAAY,MAAM,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { major, minVersion, satisfies, subset, valid, validRange } from 'semver';\n\nexport function fulfillsVersionRange({\n version,\n acceptableVersions,\n canBeLatest,\n}: {\n version: string;\n acceptableVersions: string;\n canBeLatest: boolean;\n}): boolean {\n if (version === 'latest') {\n return canBeLatest;\n }\n\n let cleanedUserVersion, isRange;\n\n if (valid(version)) {\n cleanedUserVersion = valid(version);\n isRange = false;\n } else if (validRange(version)) {\n cleanedUserVersion = validRange(version);\n isRange = true;\n }\n\n return (\n // If the given version is a bogus format, this will still be undefined and we'll automatically reject it\n !!cleanedUserVersion &&\n (isRange ? subset(cleanedUserVersion, acceptableVersions) : satisfies(cleanedUserVersion, acceptableVersions))\n );\n}\n\n/**\n * Get a version bucket string for analytics.\n * Returns format like \"15.x\" for versions >= minimumMajor, or \"<{minimumMajor}.0.0\" otherwise.\n */\nexport function getVersionBucket(version: string | undefined, minimumMajor: number): string {\n if (!version) {\n return 'none';\n }\n\n try {\n const minVer = minVersion(version);\n if (!minVer) {\n return 'invalid';\n }\n const majorVersion = major(minVer);\n if (majorVersion >= minimumMajor) {\n return `${majorVersion}.x`;\n }\n return `<${minimumMajor}.0.0`;\n } catch {\n return 'unknown';\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function stripAnsii(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src/utils/string.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,OAAO;IAChB,4CAA4C;IAC5C,6EAA6E,EAC7E,EAAE,CACH,CAAC;AACJ,CAAC","sourcesContent":["export function stripAnsii(str: string): string {\n return str.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n '',\n );\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TelemetryEvent } from './telemetry-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* HTTP client that queues telemetry events and flushes them to the gateway.
|
|
4
|
+
* Failures are silent—telemetry should never crash the wizard.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TelemetryClient {
|
|
7
|
+
private events;
|
|
8
|
+
private accessToken;
|
|
9
|
+
private gatewayUrl;
|
|
10
|
+
setGatewayUrl(url: string): void;
|
|
11
|
+
setAccessToken(token: string): void;
|
|
12
|
+
queueEvent(event: TelemetryEvent): void;
|
|
13
|
+
flush(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare const telemetryClient: TelemetryClient;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { debug } from './debug.js';
|
|
2
|
+
/**
|
|
3
|
+
* HTTP client that queues telemetry events and flushes them to the gateway.
|
|
4
|
+
* Failures are silent—telemetry should never crash the wizard.
|
|
5
|
+
*/
|
|
6
|
+
export class TelemetryClient {
|
|
7
|
+
events = [];
|
|
8
|
+
accessToken = null;
|
|
9
|
+
gatewayUrl = null;
|
|
10
|
+
setGatewayUrl(url) {
|
|
11
|
+
this.gatewayUrl = url;
|
|
12
|
+
}
|
|
13
|
+
setAccessToken(token) {
|
|
14
|
+
this.accessToken = token;
|
|
15
|
+
}
|
|
16
|
+
queueEvent(event) {
|
|
17
|
+
this.events.push(event);
|
|
18
|
+
}
|
|
19
|
+
async flush() {
|
|
20
|
+
if (this.events.length === 0)
|
|
21
|
+
return;
|
|
22
|
+
if (!this.gatewayUrl) {
|
|
23
|
+
debug('[Telemetry] No gateway URL configured, skipping flush');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const payload = { events: [...this.events] };
|
|
27
|
+
this.events = [];
|
|
28
|
+
const headers = {
|
|
29
|
+
'Content-Type': 'application/json',
|
|
30
|
+
};
|
|
31
|
+
if (this.accessToken) {
|
|
32
|
+
headers['Authorization'] = `Bearer ${this.accessToken}`;
|
|
33
|
+
}
|
|
34
|
+
const controller = new AbortController();
|
|
35
|
+
const timeout = setTimeout(() => controller.abort(), 3000);
|
|
36
|
+
try {
|
|
37
|
+
debug(`[Telemetry] Sending ${payload.events.length} events to ${this.gatewayUrl}/telemetry`);
|
|
38
|
+
const response = await fetch(`${this.gatewayUrl}/telemetry`, {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
headers,
|
|
41
|
+
body: JSON.stringify(payload),
|
|
42
|
+
signal: controller.signal,
|
|
43
|
+
});
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
debug(`[Telemetry] Failed to send: ${response.status}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
debug(`[Telemetry] Error sending events: ${error}`);
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
clearTimeout(timeout);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export const telemetryClient = new TelemetryClient();
|
|
57
|
+
//# sourceMappingURL=telemetry-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-client.js","sourceRoot":"","sources":["../../../src/utils/telemetry-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC;;;GAGG;AACH,MAAM,OAAO,eAAe;IAClB,MAAM,GAAqB,EAAE,CAAC;IAC9B,WAAW,GAAkB,IAAI,CAAC;IAClC,UAAU,GAAkB,IAAI,CAAC;IAEzC,aAAa,CAAC,GAAW;QACvB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;IACxB,CAAC;IAED,cAAc,CAAC,KAAa;QAC1B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,UAAU,CAAC,KAAqB;QAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QACrC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,KAAK,CAAC,uDAAuD,CAAC,CAAC;YAC/D,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAqB,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/D,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,MAAM,OAAO,GAA2B;YACtC,cAAc,EAAE,kBAAkB;SACnC,CAAC;QACF,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1D,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;QAE3D,IAAI,CAAC;YACH,KAAK,CAAC,uBAAuB,OAAO,CAAC,MAAM,CAAC,MAAM,cAAc,IAAI,CAAC,UAAU,YAAY,CAAC,CAAC;YAE7F,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,UAAU,YAAY,EAAE;gBAC3D,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;aAC1B,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,KAAK,CAAC,+BAA+B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,KAAK,CAAC,qCAAqC,KAAK,EAAE,CAAC,CAAC;QACtD,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["import { debug } from './debug.js';\nimport type { TelemetryEvent, TelemetryRequest } from './telemetry-types.js';\n\n/**\n * HTTP client that queues telemetry events and flushes them to the gateway.\n * Failures are silent—telemetry should never crash the wizard.\n */\nexport class TelemetryClient {\n private events: TelemetryEvent[] = [];\n private accessToken: string | null = null;\n private gatewayUrl: string | null = null;\n\n setGatewayUrl(url: string) {\n this.gatewayUrl = url;\n }\n\n setAccessToken(token: string) {\n this.accessToken = token;\n }\n\n queueEvent(event: TelemetryEvent) {\n this.events.push(event);\n }\n\n async flush(): Promise<void> {\n if (this.events.length === 0) return;\n if (!this.gatewayUrl) {\n debug('[Telemetry] No gateway URL configured, skipping flush');\n return;\n }\n\n const payload: TelemetryRequest = { events: [...this.events] };\n this.events = [];\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n if (this.accessToken) {\n headers['Authorization'] = `Bearer ${this.accessToken}`;\n }\n\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), 3000);\n\n try {\n debug(`[Telemetry] Sending ${payload.events.length} events to ${this.gatewayUrl}/telemetry`);\n\n const response = await fetch(`${this.gatewayUrl}/telemetry`, {\n method: 'POST',\n headers,\n body: JSON.stringify(payload),\n signal: controller.signal,\n });\n\n if (!response.ok) {\n debug(`[Telemetry] Failed to send: ${response.status}`);\n }\n } catch (error) {\n debug(`[Telemetry] Error sending events: ${error}`);\n } finally {\n clearTimeout(timeout);\n }\n }\n}\n\nexport const telemetryClient = new TelemetryClient();\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telemetry event types for wizard → gateway communication.
|
|
3
|
+
* The gateway converts these to OTel format.
|
|
4
|
+
*/
|
|
5
|
+
export interface TelemetryEvent {
|
|
6
|
+
type: 'session.start' | 'session.end' | 'step' | 'agent.tool' | 'agent.llm';
|
|
7
|
+
sessionId: string;
|
|
8
|
+
timestamp: string;
|
|
9
|
+
attributes?: Record<string, string | number | boolean>;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionStartEvent extends TelemetryEvent {
|
|
12
|
+
type: 'session.start';
|
|
13
|
+
attributes: {
|
|
14
|
+
'wizard.version': string;
|
|
15
|
+
'wizard.mode': 'cli' | 'tui';
|
|
16
|
+
'workos.user_id'?: string;
|
|
17
|
+
'workos.org_id'?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface SessionEndEvent extends TelemetryEvent {
|
|
21
|
+
type: 'session.end';
|
|
22
|
+
attributes: {
|
|
23
|
+
'wizard.outcome': 'success' | 'error' | 'cancelled';
|
|
24
|
+
'wizard.duration_ms': number;
|
|
25
|
+
} & Record<string, string | number | boolean>;
|
|
26
|
+
}
|
|
27
|
+
export interface StepEvent extends TelemetryEvent {
|
|
28
|
+
type: 'step';
|
|
29
|
+
name: string;
|
|
30
|
+
durationMs: number;
|
|
31
|
+
success: boolean;
|
|
32
|
+
error?: {
|
|
33
|
+
type: string;
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface AgentToolEvent extends TelemetryEvent {
|
|
38
|
+
type: 'agent.tool';
|
|
39
|
+
toolName: string;
|
|
40
|
+
durationMs: number;
|
|
41
|
+
success: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface AgentLLMEvent extends TelemetryEvent {
|
|
44
|
+
type: 'agent.llm';
|
|
45
|
+
model: string;
|
|
46
|
+
inputTokens: number;
|
|
47
|
+
outputTokens: number;
|
|
48
|
+
}
|
|
49
|
+
export interface TelemetryRequest {
|
|
50
|
+
events: TelemetryEvent[];
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-types.js","sourceRoot":"","sources":["../../../src/utils/telemetry-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * Telemetry event types for wizard → gateway communication.\n * The gateway converts these to OTel format.\n */\n\nexport interface TelemetryEvent {\n type: 'session.start' | 'session.end' | 'step' | 'agent.tool' | 'agent.llm';\n sessionId: string;\n timestamp: string;\n attributes?: Record<string, string | number | boolean>;\n}\n\nexport interface SessionStartEvent extends TelemetryEvent {\n type: 'session.start';\n attributes: {\n 'wizard.version': string;\n 'wizard.mode': 'cli' | 'tui';\n 'workos.user_id'?: string;\n 'workos.org_id'?: string;\n };\n}\n\nexport interface SessionEndEvent extends TelemetryEvent {\n type: 'session.end';\n attributes: {\n 'wizard.outcome': 'success' | 'error' | 'cancelled';\n 'wizard.duration_ms': number;\n } & Record<string, string | number | boolean>;\n}\n\nexport interface StepEvent extends TelemetryEvent {\n type: 'step';\n name: string;\n durationMs: number;\n success: boolean;\n error?: {\n type: string;\n message: string;\n };\n}\n\nexport interface AgentToolEvent extends TelemetryEvent {\n type: 'agent.tool';\n toolName: string;\n durationMs: number;\n success: boolean;\n}\n\nexport interface AgentLLMEvent extends TelemetryEvent {\n type: 'agent.llm';\n model: string;\n inputTokens: number;\n outputTokens: number;\n}\n\nexport interface TelemetryRequest {\n events: TelemetryEvent[];\n}\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export type WizardOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Whether to enable debug mode.
|
|
4
|
+
*/
|
|
5
|
+
debug: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Whether to force install the SDK package to continue with the installation in case
|
|
8
|
+
* any package manager checks are failing (e.g. peer dependency versions).
|
|
9
|
+
*
|
|
10
|
+
* Use with caution and only if you know what you're doing.
|
|
11
|
+
*
|
|
12
|
+
* Does not apply to all wizard flows (currently NPM only)
|
|
13
|
+
*/
|
|
14
|
+
forceInstall: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The directory to run the wizard in.
|
|
17
|
+
*/
|
|
18
|
+
installDir: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to use local services (LLM gateway on localhost:8000)
|
|
21
|
+
*/
|
|
22
|
+
local: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* CI mode - non-interactive execution
|
|
25
|
+
*/
|
|
26
|
+
ci: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Skip authentication check (for local development only)
|
|
29
|
+
*/
|
|
30
|
+
skipAuth: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* WorkOS API key (sk_xxx)
|
|
33
|
+
*/
|
|
34
|
+
apiKey?: string;
|
|
35
|
+
/**
|
|
36
|
+
* WorkOS Client ID (client_xxx)
|
|
37
|
+
*/
|
|
38
|
+
clientId?: string;
|
|
39
|
+
/**
|
|
40
|
+
* App homepage URL for WorkOS dashboard config.
|
|
41
|
+
* Defaults to http://localhost:{detected_port}
|
|
42
|
+
*/
|
|
43
|
+
homepageUrl?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Redirect URI for WorkOS callback.
|
|
46
|
+
* Defaults to framework-specific convention (e.g., /api/auth/callback)
|
|
47
|
+
*/
|
|
48
|
+
redirectUri?: string;
|
|
49
|
+
/**
|
|
50
|
+
* [Experimental] Enable visual dashboard mode
|
|
51
|
+
*/
|
|
52
|
+
dashboard?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Event emitter for dashboard mode
|
|
55
|
+
*/
|
|
56
|
+
emitter?: import('../lib/events.js').WizardEventEmitter;
|
|
57
|
+
/**
|
|
58
|
+
* Pre-selected framework integration (bypasses detection)
|
|
59
|
+
*/
|
|
60
|
+
integration?: import('../lib/constants.js').Integration;
|
|
61
|
+
/**
|
|
62
|
+
* Enable XState inspector - opens browser to visualize state machine live
|
|
63
|
+
*/
|
|
64
|
+
inspect?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Skip post-installation validation (includes build check)
|
|
67
|
+
*/
|
|
68
|
+
noValidate?: boolean;
|
|
69
|
+
};
|
|
70
|
+
export interface Feature {
|
|
71
|
+
id: string;
|
|
72
|
+
prompt: string;
|
|
73
|
+
enabledHint?: string;
|
|
74
|
+
disabledHint?: string;
|
|
75
|
+
}
|
|
76
|
+
export type FileChange = {
|
|
77
|
+
filePath: string;
|
|
78
|
+
oldContent?: string;
|
|
79
|
+
newContent: string;
|
|
80
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type WizardOptions = {\n /**\n * Whether to enable debug mode.\n */\n debug: boolean;\n\n /**\n * Whether to force install the SDK package to continue with the installation in case\n * any package manager checks are failing (e.g. peer dependency versions).\n *\n * Use with caution and only if you know what you're doing.\n *\n * Does not apply to all wizard flows (currently NPM only)\n */\n forceInstall: boolean;\n\n /**\n * The directory to run the wizard in.\n */\n installDir: string;\n\n /**\n * Whether to use local services (LLM gateway on localhost:8000)\n */\n local: boolean;\n\n /**\n * CI mode - non-interactive execution\n */\n ci: boolean;\n\n /**\n * Skip authentication check (for local development only)\n */\n skipAuth: boolean;\n\n /**\n * WorkOS API key (sk_xxx)\n */\n apiKey?: string;\n\n /**\n * WorkOS Client ID (client_xxx)\n */\n clientId?: string;\n\n /**\n * App homepage URL for WorkOS dashboard config.\n * Defaults to http://localhost:{detected_port}\n */\n homepageUrl?: string;\n\n /**\n * Redirect URI for WorkOS callback.\n * Defaults to framework-specific convention (e.g., /api/auth/callback)\n */\n redirectUri?: string;\n\n /**\n * [Experimental] Enable visual dashboard mode\n */\n dashboard?: boolean;\n\n /**\n * Event emitter for dashboard mode\n */\n emitter?: import('../lib/events.js').WizardEventEmitter;\n\n /**\n * Pre-selected framework integration (bypasses detection)\n */\n integration?: import('../lib/constants.js').Integration;\n\n /**\n * Enable XState inspector - opens browser to visualize state machine live\n */\n inspect?: boolean;\n\n /**\n * Skip post-installation validation (includes build check)\n */\n noValidate?: boolean;\n};\n\nexport interface Feature {\n id: string;\n prompt: string;\n enabledHint?: string;\n disabledHint?: string;\n}\n\nexport type FileChange = {\n filePath: string;\n oldContent?: string;\n newContent: string;\n};\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getLlmGatewayUrl } from '../lib/settings.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get URLs. Env vars override config defaults.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getWorkOSApiUrl: () => string;
|
|
6
|
+
export declare const getWorkOSDashboardUrl: () => string;
|
|
7
|
+
export declare const getLlmGatewayUrlFromHost: typeof getLlmGatewayUrl;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getLlmGatewayUrl } from '../lib/settings.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get URLs. Env vars override config defaults.
|
|
4
|
+
*/
|
|
5
|
+
export const getWorkOSApiUrl = () => process.env.WORKOS_API_URL || 'https://api.workos.com';
|
|
6
|
+
export const getWorkOSDashboardUrl = () => process.env.WORKOS_DASHBOARD_URL || 'https://dashboard.workos.com';
|
|
7
|
+
export const getLlmGatewayUrlFromHost = getLlmGatewayUrl;
|
|
8
|
+
//# sourceMappingURL=urls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../src/utils/urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,wBAAwB,CAAC;AAE5F,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,8BAA8B,CAAC;AAE9G,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,CAAC","sourcesContent":["import { getLlmGatewayUrl } from '../lib/settings.js';\n\n/**\n * Get URLs. Env vars override config defaults.\n */\n\nexport const getWorkOSApiUrl = () => process.env.WORKOS_API_URL || 'https://api.workos.com';\n\nexport const getWorkOSDashboardUrl = () => process.env.WORKOS_DASHBOARD_URL || 'https://dashboard.workos.com';\n\nexport const getLlmGatewayUrlFromHost = getLlmGatewayUrl;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isUnicodeSupported(): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Vendored from: https://github.com/sindresorhus/is-unicode-supported/blob/c80c691dde9e2fcfe3996810858c6672c8f35ad9/index.js#L3
|
|
2
|
+
// MIT License
|
|
3
|
+
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
7
|
+
export function isUnicodeSupported() {
|
|
8
|
+
if (process.platform !== 'win32') {
|
|
9
|
+
return process.env.TERM !== 'linux'; // Linux console (kernel)
|
|
10
|
+
}
|
|
11
|
+
return (Boolean(process.env.CI) ||
|
|
12
|
+
Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
13
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
14
|
+
process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder
|
|
15
|
+
process.env.TERM_PROGRAM === 'Terminus-Sublime' ||
|
|
16
|
+
process.env.TERM_PROGRAM === 'vscode' ||
|
|
17
|
+
process.env.TERM === 'xterm-256color' ||
|
|
18
|
+
process.env.TERM === 'alacritty' ||
|
|
19
|
+
process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm');
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=is-unicorn-supported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-unicorn-supported.js","sourceRoot":"","sources":["../../../../src/utils/vendor/is-unicorn-supported.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAEhI,cAAc;AAEd,kFAAkF;AAElF,mbAAmb;AAEnb,iIAAiI;AAEjI,+cAA+c;AAE/c,MAAM,UAAU,kBAAkB;IAChC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,yBAAyB;IAChE,CAAC;IAED,OAAO,CACL,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,mBAAmB;QACtD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,qBAAqB;QAC9D,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,cAAc,IAAI,mBAAmB;QAChE,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,kBAAkB;QAC/C,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,QAAQ;QACrC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,gBAAgB;QACrC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW;QAChC,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,oBAAoB,CACvD,CAAC;AACJ,CAAC","sourcesContent":["// Vendored from: https://github.com/sindresorhus/is-unicode-supported/blob/c80c691dde9e2fcfe3996810858c6672c8f35ad9/index.js#L3\n\n// MIT License\n\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nexport function isUnicodeSupported() {\n if (process.platform !== 'win32') {\n return process.env.TERM !== 'linux'; // Linux console (kernel)\n }\n\n return (\n Boolean(process.env.CI) ||\n Boolean(process.env.WT_SESSION) || // Windows Terminal\n Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)\n process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder\n process.env.TERM_PROGRAM === 'Terminus-Sublime' ||\n process.env.TERM_PROGRAM === 'vscode' ||\n process.env.TERM === 'xterm-256color' ||\n process.env.TERM === 'alacritty' ||\n process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm'\n );\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { enableDebugLogs } from '../utils/debug.js';
|
|
2
|
+
import { runAgentWizard } from '../lib/agent-runner.js';
|
|
3
|
+
import { Integration } from '../lib/constants.js';
|
|
4
|
+
const VANILLA_JS_AGENT_CONFIG = {
|
|
5
|
+
metadata: {
|
|
6
|
+
name: 'Vanilla JavaScript',
|
|
7
|
+
integration: Integration.vanillaJs,
|
|
8
|
+
docsUrl: 'https://workos.com/docs/user-management/authkit/javascript',
|
|
9
|
+
unsupportedVersionDocsUrl: 'https://workos.com/docs/user-management/authkit/javascript',
|
|
10
|
+
skillName: 'workos-authkit-vanilla-js',
|
|
11
|
+
},
|
|
12
|
+
detection: {
|
|
13
|
+
packageName: 'workos',
|
|
14
|
+
packageDisplayName: 'Vanilla JavaScript',
|
|
15
|
+
getVersion: () => undefined,
|
|
16
|
+
},
|
|
17
|
+
environment: {
|
|
18
|
+
uploadToHosting: false,
|
|
19
|
+
requiresApiKey: false, // Client-only
|
|
20
|
+
getEnvVars: (apiKey, clientId) => ({
|
|
21
|
+
WORKOS_CLIENT_ID: clientId, // Only client ID needed
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
analytics: {
|
|
25
|
+
getTags: () => ({}),
|
|
26
|
+
},
|
|
27
|
+
prompts: {},
|
|
28
|
+
ui: {
|
|
29
|
+
successMessage: 'WorkOS AuthKit integration complete',
|
|
30
|
+
getOutroChanges: () => [
|
|
31
|
+
'Created WorkOS AuthKit integration',
|
|
32
|
+
'Added authentication to your JavaScript application',
|
|
33
|
+
'Set up login/logout functionality',
|
|
34
|
+
],
|
|
35
|
+
getOutroNextSteps: () => [
|
|
36
|
+
'Start your development server to test authentication',
|
|
37
|
+
'Visit the WorkOS Dashboard to manage users and settings',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export async function runVanillaJsWizardAgent(options) {
|
|
42
|
+
if (options.debug) {
|
|
43
|
+
enableDebugLogs();
|
|
44
|
+
}
|
|
45
|
+
return runAgentWizard(VANILLA_JS_AGENT_CONFIG, options);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=vanilla-js-wizard-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vanilla-js-wizard-agent.js","sourceRoot":"","sources":["../../../src/vanilla-js/vanilla-js-wizard-agent.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,uBAAuB,GAAoB;IAC/C,QAAQ,EAAE;QACR,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,WAAW,CAAC,SAAS;QAClC,OAAO,EAAE,4DAA4D;QACrE,yBAAyB,EAAE,4DAA4D;QACvF,SAAS,EAAE,2BAA2B;KACvC;IAED,SAAS,EAAE;QACT,WAAW,EAAE,QAAQ;QACrB,kBAAkB,EAAE,oBAAoB;QACxC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;KAC5B;IAED,WAAW,EAAE;QACX,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK,EAAE,cAAc;QACrC,UAAU,EAAE,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;YACjD,gBAAgB,EAAE,QAAQ,EAAE,wBAAwB;SACrD,CAAC;KACH;IAED,SAAS,EAAE;QACT,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KACpB;IAED,OAAO,EAAE,EAAE;IAEX,EAAE,EAAE;QACF,cAAc,EAAE,qCAAqC;QACrD,eAAe,EAAE,GAAG,EAAE,CAAC;YACrB,oCAAoC;YACpC,qDAAqD;YACrD,mCAAmC;SACpC;QACD,iBAAiB,EAAE,GAAG,EAAE,CAAC;YACvB,sDAAsD;YACtD,yDAAyD;SAC1D;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAAsB;IAClE,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,eAAe,EAAE,CAAC;IACpB,CAAC;IAED,OAAO,cAAc,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["/* Vanilla JS wizard using Claude Agent SDK */\nimport type { WizardOptions } from '../utils/types.js';\nimport type { FrameworkConfig } from '../lib/framework-config.js';\nimport { enableDebugLogs } from '../utils/debug.js';\nimport { runAgentWizard } from '../lib/agent-runner.js';\nimport { Integration } from '../lib/constants.js';\n\nconst VANILLA_JS_AGENT_CONFIG: FrameworkConfig = {\n metadata: {\n name: 'Vanilla JavaScript',\n integration: Integration.vanillaJs,\n docsUrl: 'https://workos.com/docs/user-management/authkit/javascript',\n unsupportedVersionDocsUrl: 'https://workos.com/docs/user-management/authkit/javascript',\n skillName: 'workos-authkit-vanilla-js',\n },\n\n detection: {\n packageName: 'workos',\n packageDisplayName: 'Vanilla JavaScript',\n getVersion: () => undefined,\n },\n\n environment: {\n uploadToHosting: false,\n requiresApiKey: false, // Client-only\n getEnvVars: (apiKey: string, clientId: string) => ({\n WORKOS_CLIENT_ID: clientId, // Only client ID needed\n }),\n },\n\n analytics: {\n getTags: () => ({}),\n },\n\n prompts: {},\n\n ui: {\n successMessage: 'WorkOS AuthKit integration complete',\n getOutroChanges: () => [\n 'Created WorkOS AuthKit integration',\n 'Added authentication to your JavaScript application',\n 'Set up login/logout functionality',\n ],\n getOutroNextSteps: () => [\n 'Start your development server to test authentication',\n 'Visit the WorkOS Dashboard to manage users and settings',\n ],\n },\n};\n\nexport async function runVanillaJsWizardAgent(options: WizardOptions): Promise<string> {\n if (options.debug) {\n enableDebugLogs();\n }\n\n return runAgentWizard(VANILLA_JS_AGENT_CONFIG, options);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,95 +1,87 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workos",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "The Official Workos CLI",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"workos",
|
|
8
|
+
"authkit",
|
|
9
|
+
"authentication",
|
|
10
|
+
"wizard",
|
|
11
|
+
"cli",
|
|
12
|
+
"setup",
|
|
13
|
+
"install",
|
|
14
|
+
"oauth",
|
|
15
|
+
"sso"
|
|
16
|
+
],
|
|
10
17
|
"bin": {
|
|
11
|
-
"workos": "
|
|
18
|
+
"workos": "dist/bin.js"
|
|
12
19
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
15
22
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
23
|
+
"files": [
|
|
24
|
+
"dist/bin.*",
|
|
25
|
+
"dist/src",
|
|
26
|
+
"dist/cli.config.*",
|
|
27
|
+
".claude-plugin",
|
|
28
|
+
"skills",
|
|
29
|
+
"package.json",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"main": "dist/index.js",
|
|
33
|
+
"typings": "dist/index.d.ts",
|
|
34
|
+
"typescript": {
|
|
35
|
+
"definition": "dist/index.d.ts"
|
|
24
36
|
},
|
|
25
|
-
"jest": {
|
|
26
|
-
"moduleFileExtensions": [
|
|
27
|
-
"json",
|
|
28
|
-
"ts",
|
|
29
|
-
"tsx",
|
|
30
|
-
"js"
|
|
31
|
-
],
|
|
32
|
-
"transform": {
|
|
33
|
-
"^.+\\.(ts|tsx)$": "ts-jest"
|
|
34
|
-
},
|
|
35
|
-
"globals": {
|
|
36
|
-
"ts-jest": {
|
|
37
|
-
"tsConfig": "tsconfig.json"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"testMatch": [
|
|
41
|
-
"**/tests/*.+(ts|tsx|js)"
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
"private": false,
|
|
45
37
|
"dependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"figures": "^2.0.0",
|
|
54
|
-
"got": "^9.2.2",
|
|
55
|
-
"inquirer": "^6.2.0",
|
|
56
|
-
"meow": "^5.0.0",
|
|
57
|
-
"node-osascript": "^2.1.0",
|
|
38
|
+
"@anthropic-ai/claude-agent-sdk": "~0.2.19",
|
|
39
|
+
"@clack/core": "^0.5.0",
|
|
40
|
+
"@clack/prompts": "0.11.0",
|
|
41
|
+
"chalk": "^5.6.2",
|
|
42
|
+
"diff": "^8.0.3",
|
|
43
|
+
"fast-glob": "^3.3.3",
|
|
44
|
+
"ink": "^6.6.0",
|
|
58
45
|
"opn": "^5.4.0",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"sha1": "^1.1.1",
|
|
66
|
-
"term-img": "^2.1.0",
|
|
67
|
-
"unique-string": "^1.0.0",
|
|
68
|
-
"update-notifier": "^2.5.0",
|
|
69
|
-
"url-parse": "^1.4.3",
|
|
70
|
-
"xdg-basedir": "^3.0.0",
|
|
71
|
-
"xkpasswd": "^1.0.5"
|
|
46
|
+
"react": "^19.2.3",
|
|
47
|
+
"semver": "^7.7.3",
|
|
48
|
+
"uuid": "^13.0.0",
|
|
49
|
+
"xstate": "^5.25.1",
|
|
50
|
+
"yargs": "^18.0.0",
|
|
51
|
+
"zod": "^4.3.5"
|
|
72
52
|
},
|
|
73
53
|
"devDependencies": {
|
|
74
|
-
"@
|
|
75
|
-
"@types/
|
|
76
|
-
"@types/
|
|
77
|
-
"@types/
|
|
78
|
-
"@types/
|
|
79
|
-
"@types/
|
|
80
|
-
"@
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
54
|
+
"@statelyai/inspect": "^0.4.0",
|
|
55
|
+
"@types/node": "~22.19.7",
|
|
56
|
+
"@types/opn": "5.1.0",
|
|
57
|
+
"@types/react": "^19.2.9",
|
|
58
|
+
"@types/semver": "^7.7.1",
|
|
59
|
+
"@types/yargs": "^17.0.35",
|
|
60
|
+
"@vitest/ui": "^4.0.17",
|
|
61
|
+
"dotenv": "^17.2.3",
|
|
62
|
+
"prettier": "^3.8.0",
|
|
63
|
+
"tsx": "^4.20.3",
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"vitest": "^4.0.17"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=20.20"
|
|
69
|
+
},
|
|
70
|
+
"packageManager": "pnpm@10.23.0+sha512.21c4e5698002ade97e4efe8b8b4a89a8de3c85a37919f957e7a0f30f38fbc5bbdd05980ffe29179b2fb6e6e691242e098d945d1601772cad0fef5fb6411e2a4b",
|
|
71
|
+
"scripts": {
|
|
72
|
+
"clean": "rm -rf ./dist",
|
|
73
|
+
"prebuild": "pnpm clean",
|
|
74
|
+
"build:watch": "pnpm tsc -w",
|
|
75
|
+
"build": "pnpm tsc",
|
|
76
|
+
"postbuild": "chmod +x ./dist/bin.js && cp -r scripts/** dist",
|
|
77
|
+
"lint": "prettier --check \"{lib,src,test}/**/*.ts\"",
|
|
78
|
+
"format": "prettier --write .",
|
|
79
|
+
"try": "tsx dev.ts",
|
|
80
|
+
"dev": "pnpm build && pnpm link --global && pnpm build:watch",
|
|
81
|
+
"test": "vitest run",
|
|
82
|
+
"test:watch": "vitest",
|
|
83
|
+
"typecheck": "tsc --noEmit"
|
|
84
|
+
},
|
|
85
|
+
"author": "WorkOS",
|
|
86
|
+
"license": "MIT"
|
|
95
87
|
}
|