workos 0.16.0 → 0.17.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 +7 -3
- package/dist/bin.js +10 -4
- package/dist/bin.js.map +1 -1
- package/dist/doctor/checks/auth-patterns.js +1 -1
- package/dist/doctor/checks/auth-patterns.js.map +1 -1
- package/dist/lib/adapters/cli-adapter.d.ts +7 -0
- package/dist/lib/adapters/cli-adapter.js +49 -0
- package/dist/lib/adapters/cli-adapter.js.map +1 -1
- package/dist/lib/adapters/dashboard-adapter.d.ts +4 -0
- package/dist/lib/adapters/dashboard-adapter.js +24 -0
- package/dist/lib/adapters/dashboard-adapter.js.map +1 -1
- package/dist/lib/adapters/headless-adapter.d.ts +6 -0
- package/dist/lib/adapters/headless-adapter.js +26 -1
- package/dist/lib/adapters/headless-adapter.js.map +1 -1
- package/dist/lib/agent-runner.js +55 -16
- package/dist/lib/agent-runner.js.map +1 -1
- package/dist/lib/events.d.ts +15 -0
- package/dist/lib/events.js.map +1 -1
- package/dist/lib/installer-core.d.ts +61 -1
- package/dist/lib/installer-core.js +132 -6
- package/dist/lib/installer-core.js.map +1 -1
- package/dist/lib/installer-core.types.d.ts +24 -0
- package/dist/lib/installer-core.types.js.map +1 -1
- package/dist/lib/run-with-core.js +26 -1
- package/dist/lib/run-with-core.js.map +1 -1
- package/dist/lib/scaffold/index.d.ts +1 -0
- package/dist/lib/scaffold/index.js +2 -0
- package/dist/lib/scaffold/index.js.map +1 -0
- package/dist/lib/scaffold/scaffold.d.ts +66 -0
- package/dist/lib/scaffold/scaffold.js +156 -0
- package/dist/lib/scaffold/scaffold.js.map +1 -0
- package/dist/lib/validation/security-checks.d.ts +35 -0
- package/dist/lib/validation/security-checks.js +105 -0
- package/dist/lib/validation/security-checks.js.map +1 -0
- package/dist/run.d.ts +2 -2
- package/dist/run.js +2 -1
- package/dist/run.js.map +1 -1
- package/dist/utils/types.d.ts +10 -4
- package/dist/utils/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { checkAuthPatterns } from '../../doctor/checks/auth-patterns.js';
|
|
2
|
+
/**
|
|
3
|
+
* The "security subset" of `workos doctor`'s auth-pattern checks that the
|
|
4
|
+
* installer enforces. These are the patterns that are *unsafe* or *leak secrets*
|
|
5
|
+
* (an unsafe GET sign-out, an API key in client env/source, an ungitignored
|
|
6
|
+
* .env). Completeness checks (missing middleware/callback/provider) are
|
|
7
|
+
* intentionally excluded here — `validateInstallation` already covers those, and
|
|
8
|
+
* they carry higher false-positive risk than we want gating install success.
|
|
9
|
+
*
|
|
10
|
+
* Keep in sync with the codes emitted by `src/doctor/checks/auth-patterns.ts`.
|
|
11
|
+
*/
|
|
12
|
+
const SECURITY_FINDING_CODES = new Set([
|
|
13
|
+
'SIGNOUT_GET_HANDLER',
|
|
14
|
+
'SIGNOUT_LINK_PREFETCH',
|
|
15
|
+
'API_KEY_LEAKED_TO_CLIENT',
|
|
16
|
+
'API_KEY_IN_SOURCE',
|
|
17
|
+
'ENV_FILE_NOT_GITIGNORED',
|
|
18
|
+
'MIXED_ENVIRONMENT',
|
|
19
|
+
]);
|
|
20
|
+
/** Map an installer integration id to the framework name doctor's checks expect. */
|
|
21
|
+
const INTEGRATION_FRAMEWORK_NAME = {
|
|
22
|
+
nextjs: 'Next.js',
|
|
23
|
+
'react-router': 'React Router',
|
|
24
|
+
'tanstack-start': 'TanStack Start',
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Run the security subset of doctor's auth-pattern checks against an install
|
|
28
|
+
* directory. Pure file inspection — no network — so it is safe to call both
|
|
29
|
+
* inside the installer's self-correction loop and as the final pre-success gate.
|
|
30
|
+
*
|
|
31
|
+
* This closes the install-validate ↔ doctor gap: previously install could report
|
|
32
|
+
* `success: true` while `workos doctor` immediately found a security hole,
|
|
33
|
+
* because neither the retry loop nor `validateInstallation` ran these checks.
|
|
34
|
+
*/
|
|
35
|
+
export async function runInstallSecurityChecks(integration, installDir) {
|
|
36
|
+
const framework = {
|
|
37
|
+
name: INTEGRATION_FRAMEWORK_NAME[integration] ?? null,
|
|
38
|
+
version: null,
|
|
39
|
+
};
|
|
40
|
+
// checkAuthPatterns loads .env files itself; these structs only satisfy the
|
|
41
|
+
// shape its non-Next.js checks read from.
|
|
42
|
+
const environment = {
|
|
43
|
+
apiKeyConfigured: false,
|
|
44
|
+
apiKeyType: null,
|
|
45
|
+
clientId: null,
|
|
46
|
+
redirectUri: null,
|
|
47
|
+
cookieDomain: null,
|
|
48
|
+
baseUrl: null,
|
|
49
|
+
};
|
|
50
|
+
const sdk = {
|
|
51
|
+
name: null,
|
|
52
|
+
version: null,
|
|
53
|
+
latest: null,
|
|
54
|
+
outdated: false,
|
|
55
|
+
isAuthKit: false,
|
|
56
|
+
language: 'javascript',
|
|
57
|
+
};
|
|
58
|
+
const result = await checkAuthPatterns({ installDir }, framework, environment, sdk);
|
|
59
|
+
const findings = result.findings.filter((f) => SECURITY_FINDING_CODES.has(f.code));
|
|
60
|
+
const blocking = findings.filter((f) => f.severity === 'error');
|
|
61
|
+
return { findings, blocking };
|
|
62
|
+
}
|
|
63
|
+
/** Convert security findings into ValidationIssues for the emitter/report surfaces. */
|
|
64
|
+
export function securityFindingsToIssues(findings) {
|
|
65
|
+
return findings.map((f) => ({
|
|
66
|
+
type: 'pattern',
|
|
67
|
+
severity: f.severity,
|
|
68
|
+
message: f.filePath ? `${f.message} (${f.filePath})` : f.message,
|
|
69
|
+
hint: f.remediation,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Build an agent correction prompt from security findings so the installer's
|
|
74
|
+
* self-correction loop fixes them before declaring success. Returns an empty
|
|
75
|
+
* string when there is nothing to correct.
|
|
76
|
+
*/
|
|
77
|
+
export function formatSecurityFindingsForAgent(findings) {
|
|
78
|
+
if (findings.length === 0)
|
|
79
|
+
return '';
|
|
80
|
+
const lines = findings.map((f) => {
|
|
81
|
+
const loc = f.filePath ? ` in ${f.filePath}` : '';
|
|
82
|
+
const fix = f.remediation ? ` Fix: ${f.remediation}` : '';
|
|
83
|
+
return `- [${f.severity}] ${f.message}${loc}.${fix}`;
|
|
84
|
+
});
|
|
85
|
+
return `Security checks found issues that must be fixed:\n\n${lines.join('\n')}\n\nApply the fixes above, then make sure the project still builds.`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Build the error message thrown when error-severity security findings survive
|
|
89
|
+
* the installer's retries — the message that turns a silent insecure "success"
|
|
90
|
+
* into a visible failure.
|
|
91
|
+
*/
|
|
92
|
+
export function formatBlockingSecurityError(blocking) {
|
|
93
|
+
const lines = blocking.map((f) => {
|
|
94
|
+
const loc = f.filePath ? ` (${f.filePath})` : '';
|
|
95
|
+
return ` • ${f.code}: ${f.message}${loc}`;
|
|
96
|
+
});
|
|
97
|
+
return [
|
|
98
|
+
'Installation produced insecure code that could not be auto-corrected:',
|
|
99
|
+
'',
|
|
100
|
+
...lines,
|
|
101
|
+
'',
|
|
102
|
+
'Fix the issues above (or run `workos doctor` for details and remediation) and re-run the installer.',
|
|
103
|
+
].join('\n');
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=security-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-checks.js","sourceRoot":"","sources":["../../../src/lib/validation/security-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIzE;;;;;;;;;GASG;AACH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAS;IAC7C,qBAAqB;IACrB,uBAAuB;IACvB,0BAA0B;IAC1B,mBAAmB;IACnB,yBAAyB;IACzB,mBAAmB;CACpB,CAAC,CAAC;AAEH,oFAAoF;AACpF,MAAM,0BAA0B,GAA2B;IACzD,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,cAAc;IAC9B,gBAAgB,EAAE,gBAAgB;CACnC,CAAC;AAY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QACL,uEAAuE;QACvE,EAAE;QACF,GAAG,KAAK;QACR,EAAE;QACF,qGAAqG;KACtG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC","sourcesContent":["import { checkAuthPatterns } from '../../doctor/checks/auth-patterns.js';\nimport type { AuthPatternFinding, FrameworkInfo, EnvironmentInfo, SdkInfo } from '../../doctor/types.js';\nimport type { ValidationIssue } from './types.js';\n\n/**\n * The \"security subset\" of `workos doctor`'s auth-pattern checks that the\n * installer enforces. These are the patterns that are *unsafe* or *leak secrets*\n * (an unsafe GET sign-out, an API key in client env/source, an ungitignored\n * .env). Completeness checks (missing middleware/callback/provider) are\n * intentionally excluded here — `validateInstallation` already covers those, and\n * they carry higher false-positive risk than we want gating install success.\n *\n * Keep in sync with the codes emitted by `src/doctor/checks/auth-patterns.ts`.\n */\nconst SECURITY_FINDING_CODES = new Set<string>([\n 'SIGNOUT_GET_HANDLER',\n 'SIGNOUT_LINK_PREFETCH',\n 'API_KEY_LEAKED_TO_CLIENT',\n 'API_KEY_IN_SOURCE',\n 'ENV_FILE_NOT_GITIGNORED',\n 'MIXED_ENVIRONMENT',\n]);\n\n/** Map an installer integration id to the framework name doctor's checks expect. */\nconst INTEGRATION_FRAMEWORK_NAME: Record<string, string> = {\n nextjs: 'Next.js',\n 'react-router': 'React Router',\n 'tanstack-start': 'TanStack Start',\n};\n\nexport interface SecurityCheckResult {\n /** All security-class findings for this install (errors + warnings). */\n findings: AuthPatternFinding[];\n /**\n * Error-severity findings that must block a successful install. Empty when the\n * install is secure; a non-empty list means install should not report success.\n */\n blocking: AuthPatternFinding[];\n}\n\n/**\n * Run the security subset of doctor's auth-pattern checks against an install\n * directory. Pure file inspection — no network — so it is safe to call both\n * inside the installer's self-correction loop and as the final pre-success gate.\n *\n * This closes the install-validate ↔ doctor gap: previously install could report\n * `success: true` while `workos doctor` immediately found a security hole,\n * because neither the retry loop nor `validateInstallation` ran these checks.\n */\nexport async function runInstallSecurityChecks(integration: string, installDir: string): Promise<SecurityCheckResult> {\n const framework: FrameworkInfo = {\n name: INTEGRATION_FRAMEWORK_NAME[integration] ?? null,\n version: null,\n };\n // checkAuthPatterns loads .env files itself; these structs only satisfy the\n // shape its non-Next.js checks read from.\n const environment: EnvironmentInfo = {\n apiKeyConfigured: false,\n apiKeyType: null,\n clientId: null,\n redirectUri: null,\n cookieDomain: null,\n baseUrl: null,\n };\n const sdk: SdkInfo = {\n name: null,\n version: null,\n latest: null,\n outdated: false,\n isAuthKit: false,\n language: 'javascript',\n };\n\n const result = await checkAuthPatterns({ installDir }, framework, environment, sdk);\n const findings = result.findings.filter((f) => SECURITY_FINDING_CODES.has(f.code));\n const blocking = findings.filter((f) => f.severity === 'error');\n return { findings, blocking };\n}\n\n/** Convert security findings into ValidationIssues for the emitter/report surfaces. */\nexport function securityFindingsToIssues(findings: AuthPatternFinding[]): ValidationIssue[] {\n return findings.map((f) => ({\n type: 'pattern',\n severity: f.severity,\n message: f.filePath ? `${f.message} (${f.filePath})` : f.message,\n hint: f.remediation,\n }));\n}\n\n/**\n * Build an agent correction prompt from security findings so the installer's\n * self-correction loop fixes them before declaring success. Returns an empty\n * string when there is nothing to correct.\n */\nexport function formatSecurityFindingsForAgent(findings: AuthPatternFinding[]): string {\n if (findings.length === 0) return '';\n const lines = findings.map((f) => {\n const loc = f.filePath ? ` in ${f.filePath}` : '';\n const fix = f.remediation ? ` Fix: ${f.remediation}` : '';\n return `- [${f.severity}] ${f.message}${loc}.${fix}`;\n });\n return `Security checks found issues that must be fixed:\\n\\n${lines.join('\\n')}\\n\\nApply the fixes above, then make sure the project still builds.`;\n}\n\n/**\n * Build the error message thrown when error-severity security findings survive\n * the installer's retries — the message that turns a silent insecure \"success\"\n * into a visible failure.\n */\nexport function formatBlockingSecurityError(blocking: AuthPatternFinding[]): string {\n const lines = blocking.map((f) => {\n const loc = f.filePath ? ` (${f.filePath})` : '';\n return ` • ${f.code}: ${f.message}${loc}`;\n });\n return [\n 'Installation produced insecure code that could not be auto-corrected:',\n '',\n ...lines,\n '',\n 'Fix the issues above (or run `workos doctor` for details and remediation) and re-run the installer.',\n ].join('\\n');\n}\n"]}
|
package/dist/run.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { Integration } from './lib/constants.js';
|
|
2
1
|
export type InstallerArgs = {
|
|
3
|
-
integration?: Integration;
|
|
4
2
|
debug?: boolean;
|
|
5
3
|
forceInstall?: boolean;
|
|
6
4
|
installDir?: string;
|
|
@@ -24,6 +22,8 @@ export type InstallerArgs = {
|
|
|
24
22
|
noGitCheck?: boolean;
|
|
25
23
|
gitCheck?: boolean;
|
|
26
24
|
direct?: boolean;
|
|
25
|
+
scaffold?: boolean;
|
|
26
|
+
pm?: string;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* Main entry point for the wizard CLI.
|
package/dist/run.js
CHANGED
|
@@ -31,7 +31,6 @@ function buildOptions(argv) {
|
|
|
31
31
|
homepageUrl: merged.homepageUrl,
|
|
32
32
|
redirectUri: merged.redirectUri,
|
|
33
33
|
dashboard: merged.dashboard ?? false,
|
|
34
|
-
integration: merged.integration,
|
|
35
34
|
inspect: merged.inspect ?? false,
|
|
36
35
|
noValidate: merged.noValidate ?? merged.validate === false,
|
|
37
36
|
noCommit: merged.noCommit ?? merged.commit === false,
|
|
@@ -39,6 +38,8 @@ function buildOptions(argv) {
|
|
|
39
38
|
createPr: merged.createPr ?? false,
|
|
40
39
|
noGitCheck: merged.noGitCheck ?? merged.gitCheck === false,
|
|
41
40
|
direct: merged.direct ?? false,
|
|
41
|
+
scaffold: merged.scaffold ?? false,
|
|
42
|
+
pm: merged.pm,
|
|
42
43
|
emitter: createInstallerEventEmitter(), // Will be replaced in runWithCore
|
|
43
44
|
};
|
|
44
45
|
}
|
package/dist/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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,EAAE,MAAM,CAAC,WAAW;QAC/B,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,KAAK;QACpC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK;QAChC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;QAC1D,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK;QACpD,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK;QACpD,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,KAAK;QAClC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;QAC1D,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,KAAK;QAC9B,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,KAAK;QAClC,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,OAAO,EAAE,2BAA2B,EAAE,EAAE,kCAAkC;KAC3E,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,GAAY;IACrC,IAAI,CAAC,GAAG;QAAE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;IAC/B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { readEnvironment } from './utils/environment.js';\nimport { runWithCore } from './lib/run-with-core.js';\nimport type { InstallerOptions } from './utils/types.js';\nimport { createInstallerEventEmitter } from './lib/events.js';\nimport path from 'path';\nimport { EventEmitter } from 'events';\n\nEventEmitter.defaultMaxListeners = 50;\n\nexport type InstallerArgs = {\n debug?: boolean;\n forceInstall?: boolean;\n installDir?: string;\n default?: boolean;\n local?: boolean;\n ci?: boolean;\n skipAuth?: boolean;\n apiKey?: string;\n clientId?: string;\n homepageUrl?: string;\n redirectUri?: string;\n dashboard?: boolean;\n inspect?: boolean;\n noValidate?: boolean;\n validate?: boolean;\n noCommit?: boolean;\n commit?: boolean;\n noBranch?: boolean;\n branch?: boolean;\n createPr?: boolean;\n noGitCheck?: boolean;\n gitCheck?: boolean;\n direct?: boolean;\n scaffold?: boolean;\n pm?: string;\n};\n\n/**\n * Main entry point for the wizard CLI.\n * Builds options from args and delegates to the core.\n */\nexport async function runInstaller(argv: InstallerArgs): Promise<void> {\n const options = buildOptions(argv);\n await runWithCore(options);\n}\n\n/**\n * Build InstallerOptions from CLI args and environment.\n */\nfunction buildOptions(argv: InstallerArgs): InstallerOptions {\n const envArgs = readEnvironment();\n const merged = { ...argv, ...envArgs };\n\n const installDir = resolveInstallDir(merged.installDir);\n\n return {\n debug: merged.debug ?? false,\n forceInstall: merged.forceInstall ?? false,\n installDir,\n local: merged.local ?? false,\n ci: merged.ci ?? false,\n skipAuth: merged.skipAuth ?? false,\n apiKey: merged.apiKey,\n clientId: merged.clientId,\n homepageUrl: merged.homepageUrl,\n redirectUri: merged.redirectUri,\n dashboard: merged.dashboard ?? false,\n inspect: merged.inspect ?? false,\n noValidate: merged.noValidate ?? merged.validate === false,\n noCommit: merged.noCommit ?? merged.commit === false,\n noBranch: merged.noBranch ?? merged.branch === false,\n createPr: merged.createPr ?? false,\n noGitCheck: merged.noGitCheck ?? merged.gitCheck === false,\n direct: merged.direct ?? false,\n scaffold: merged.scaffold ?? false,\n pm: merged.pm,\n emitter: createInstallerEventEmitter(), // Will be replaced in runWithCore\n };\n}\n\n/**\n * Resolve install directory to absolute path.\n */\nfunction resolveInstallDir(dir?: string): string {\n if (!dir) return process.cwd();\n return path.isAbsolute(dir) ? dir : path.join(process.cwd(), dir);\n}\n"]}
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -54,10 +54,6 @@ export type InstallerOptions = {
|
|
|
54
54
|
* Event emitter for dashboard mode
|
|
55
55
|
*/
|
|
56
56
|
emitter?: import('../lib/events.js').InstallerEventEmitter;
|
|
57
|
-
/**
|
|
58
|
-
* Pre-selected framework integration (bypasses detection)
|
|
59
|
-
*/
|
|
60
|
-
integration?: import('../lib/constants.js').Integration;
|
|
61
57
|
/**
|
|
62
58
|
* Enable XState inspector - opens browser to visualize state machine live
|
|
63
59
|
*/
|
|
@@ -93,6 +89,16 @@ export type InstallerOptions = {
|
|
|
93
89
|
* Default: 2. Set to 0 to disable retries entirely.
|
|
94
90
|
*/
|
|
95
91
|
maxRetries?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Scaffold a new Next.js app when run in an empty directory.
|
|
94
|
+
* Auto-enabled in headless mode; opt-in via --scaffold in interactive mode.
|
|
95
|
+
*/
|
|
96
|
+
scaffold?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Package manager for the scaffolded app (npm/pnpm/yarn/bun).
|
|
99
|
+
* Overrides detection from npm_config_user_agent.
|
|
100
|
+
*/
|
|
101
|
+
pm?: string;
|
|
96
102
|
};
|
|
97
103
|
export interface Feature {
|
|
98
104
|
id: string;
|
package/dist/utils/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type InstallerOptions = {\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').InstallerEventEmitter;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type InstallerOptions = {\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').InstallerEventEmitter;\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 /**\n * Skip post-install commit and PR workflow\n */\n noCommit?: boolean;\n\n /**\n * Skip branch creation (continue on current branch)\n */\n noBranch?: boolean;\n\n /**\n * Auto-create pull request after installation\n */\n createPr?: boolean;\n\n /**\n * Skip git dirty working tree check\n */\n noGitCheck?: boolean;\n\n /**\n * Direct mode - bypass llm-gateway and use user's own Anthropic API key.\n * Requires ANTHROPIC_API_KEY environment variable.\n */\n direct?: boolean;\n\n /**\n * Max correction attempts after initial agent run.\n * The agent gets this many chances to fix validation failures (typecheck/build).\n * Default: 2. Set to 0 to disable retries entirely.\n */\n maxRetries?: number;\n\n /**\n * Scaffold a new Next.js app when run in an empty directory.\n * Auto-enabled in headless mode; opt-in via --scaffold in interactive mode.\n */\n scaffold?: boolean;\n\n /**\n * Package manager for the scaffolded app (npm/pnpm/yarn/bun).\n * Overrides detection from npm_config_user_agent.\n */\n pm?: string;\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Official Workos CLI",
|
|
6
6
|
"repository": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@workos-inc/node": "^8.7.0",
|
|
55
55
|
"@workos/migrations": "^2.0.0",
|
|
56
56
|
"@workos/openapi-spec": "^0.1.0",
|
|
57
|
-
"@workos/skills": "0.6.
|
|
57
|
+
"@workos/skills": "0.6.1",
|
|
58
58
|
"chalk": "^5.6.2",
|
|
59
59
|
"diff": "^8.0.3",
|
|
60
60
|
"fast-glob": "^3.3.3",
|