workos 0.17.0 → 0.18.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.
Files changed (81) hide show
  1. package/README.md +3 -4
  2. package/dist/bin.js +54 -1
  3. package/dist/bin.js.map +1 -1
  4. package/dist/cli.config.d.ts +0 -2
  5. package/dist/cli.config.js +3 -3
  6. package/dist/cli.config.js.map +1 -1
  7. package/dist/commands/debug.d.ts +11 -0
  8. package/dist/commands/debug.js +24 -8
  9. package/dist/commands/debug.js.map +1 -1
  10. package/dist/commands/install.js +4 -0
  11. package/dist/commands/install.js.map +1 -1
  12. package/dist/commands/mcp.d.ts +14 -0
  13. package/dist/commands/mcp.js +108 -0
  14. package/dist/commands/mcp.js.map +1 -0
  15. package/dist/doctor/checks/ai-analysis.js +2 -1
  16. package/dist/doctor/checks/ai-analysis.js.map +1 -1
  17. package/dist/doctor/checks/auth-patterns.js +1 -1
  18. package/dist/doctor/checks/auth-patterns.js.map +1 -1
  19. package/dist/doctor/checks/mcp.d.ts +15 -0
  20. package/dist/doctor/checks/mcp.js +34 -0
  21. package/dist/doctor/checks/mcp.js.map +1 -0
  22. package/dist/doctor/index.js +7 -1
  23. package/dist/doctor/index.js.map +1 -1
  24. package/dist/doctor/issues.js +16 -0
  25. package/dist/doctor/issues.js.map +1 -1
  26. package/dist/doctor/output.js +16 -2
  27. package/dist/doctor/output.js.map +1 -1
  28. package/dist/doctor/types.d.ts +17 -0
  29. package/dist/doctor/types.js.map +1 -1
  30. package/dist/emulate/workos/index.js.map +1 -1
  31. package/dist/lib/agent-interface.js +4 -4
  32. package/dist/lib/agent-interface.js.map +1 -1
  33. package/dist/lib/agent-runner.js +55 -16
  34. package/dist/lib/agent-runner.js.map +1 -1
  35. package/dist/lib/ai-content.js +2 -1
  36. package/dist/lib/ai-content.js.map +1 -1
  37. package/dist/lib/constants.d.ts +9 -0
  38. package/dist/lib/constants.js +9 -0
  39. package/dist/lib/constants.js.map +1 -1
  40. package/dist/lib/installer-core.d.ts +20 -20
  41. package/dist/lib/mcp-clients.d.ts +39 -0
  42. package/dist/lib/mcp-clients.js +284 -0
  43. package/dist/lib/mcp-clients.js.map +1 -0
  44. package/dist/lib/mcp-notice.d.ts +72 -0
  45. package/dist/lib/mcp-notice.js +275 -0
  46. package/dist/lib/mcp-notice.js.map +1 -0
  47. package/dist/lib/preferences.d.ts +14 -0
  48. package/dist/lib/preferences.js +3 -0
  49. package/dist/lib/preferences.js.map +1 -1
  50. package/dist/lib/run-with-core.js +2 -1
  51. package/dist/lib/run-with-core.js.map +1 -1
  52. package/dist/lib/settings.d.ts +5 -14
  53. package/dist/lib/settings.js +5 -16
  54. package/dist/lib/settings.js.map +1 -1
  55. package/dist/lib/startup-notice-gate.d.ts +21 -0
  56. package/dist/lib/startup-notice-gate.js +29 -0
  57. package/dist/lib/startup-notice-gate.js.map +1 -0
  58. package/dist/lib/telemetry-notice.js +3 -0
  59. package/dist/lib/telemetry-notice.js.map +1 -1
  60. package/dist/lib/unclaimed-warning.js +3 -0
  61. package/dist/lib/unclaimed-warning.js.map +1 -1
  62. package/dist/lib/validation/security-checks.d.ts +35 -0
  63. package/dist/lib/validation/security-checks.js +105 -0
  64. package/dist/lib/validation/security-checks.js.map +1 -0
  65. package/dist/utils/analytics.d.ts +1 -0
  66. package/dist/utils/analytics.js +5 -1
  67. package/dist/utils/analytics.js.map +1 -1
  68. package/dist/utils/help-json.js +38 -0
  69. package/dist/utils/help-json.js.map +1 -1
  70. package/dist/utils/interaction-mode.d.ts +1 -1
  71. package/dist/utils/interaction-mode.js +0 -3
  72. package/dist/utils/interaction-mode.js.map +1 -1
  73. package/dist/utils/output.d.ts +5 -3
  74. package/dist/utils/output.js +5 -5
  75. package/dist/utils/output.js.map +1 -1
  76. package/dist/utils/telemetry-types.d.ts +1 -1
  77. package/dist/utils/telemetry-types.js.map +1 -1
  78. package/dist/utils/urls.d.ts +9 -3
  79. package/dist/utils/urls.js +10 -4
  80. package/dist/utils/urls.js.map +1 -1
  81. package/package.json +12 -11
package/README.md CHANGED
@@ -663,10 +663,10 @@ In agent mode the CLI:
663
663
 
664
664
  In `ci` mode the CLI additionally refuses browser-based auth flows and prefers terse failures over recovery handoff text.
665
665
 
666
- Legacy compatibility:
666
+ Mode resolution notes:
667
667
 
668
- - `WORKOS_NO_PROMPT=1` continues to work and is treated as agent interaction behavior plus JSON output.
669
- - `WORKOS_FORCE_TTY=1` continues to force human **output** mode but does not change interaction mode.
668
+ - `WORKOS_MODE=agent` sets agent interaction behavior and forces JSON output. (This replaces the removed `WORKOS_NO_PROMPT` alias.)
669
+ - `WORKOS_FORCE_TTY=1` forces human **output** mode but does not change interaction mode.
670
670
  - Non-TTY without an explicit mode still defaults output to JSON and interaction to agent.
671
671
 
672
672
  ### Headless Installer
@@ -697,7 +697,6 @@ workos install --api-key sk_test_xxx --client-id client_xxx --no-commit 2>/dev/n
697
697
  | `WORKOS_API_KEY` | API key for management commands (bypasses stored config) |
698
698
  | `WORKOS_API_BASE_URL` | Override API base URL (set automatically by `workos dev`) |
699
699
  | `WORKOS_MODE` | Interaction mode: `human`, `agent`, or `ci` |
700
- | `WORKOS_NO_PROMPT=1` | Legacy alias: agent interaction behavior + JSON output |
701
700
  | `WORKOS_FORCE_TTY=1` | Force human (non-JSON) **output** mode even when piped |
702
701
  | `WORKOS_TELEMETRY=false` | Disable telemetry |
703
702
 
package/dist/bin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // Load .env.local for local development when --local flag is used
3
- if (process.argv.includes('--local') || process.env.INSTALLER_DEV) {
3
+ if (process.argv.includes('--local') || process.env.WORKOS_DEV) {
4
4
  const { config } = await import('dotenv');
5
5
  // bin.ts compiles to dist/bin.js, so go up one level to find .env.local
6
6
  const { fileURLToPath } = await import('node:url');
@@ -287,6 +287,34 @@ async function runCli() {
287
287
  return;
288
288
  await applyInsecureStorage(argv.insecureStorage);
289
289
  await maybeWarnUnclaimed();
290
+ })
291
+ .middleware(async (argv) => {
292
+ // One-time MCP banner (lowest-priority startup notice — runs after the
293
+ // telemetry notice + unclaimed warning so they win the one-per-run slot).
294
+ // Skip commands that manage MCP/agents directly or where the nudge is
295
+ // noise, mirroring + extending maybeWarnUnclaimed's list. Self-guarded and
296
+ // never throws.
297
+ const command = String(argv._?.[0] ?? '');
298
+ if ([
299
+ 'mcp',
300
+ 'install',
301
+ 'doctor',
302
+ 'skills',
303
+ 'auth',
304
+ 'env',
305
+ 'claim',
306
+ 'debug',
307
+ 'dashboard',
308
+ 'emulate',
309
+ 'dev',
310
+ 'migrations',
311
+ 'telemetry',
312
+ 'completion',
313
+ '',
314
+ ].includes(command))
315
+ return;
316
+ const { maybeShowMcpNotice } = await import('./lib/mcp-notice.js');
317
+ await maybeShowMcpNotice();
290
318
  })
291
319
  .command('auth', 'Manage authentication (login, logout, status)', (yargs) => {
292
320
  yargs.options(insecureStorageOption);
@@ -373,6 +401,31 @@ async function runCli() {
373
401
  });
374
402
  });
375
403
  return yargs.demandCommand(1, 'Please specify a skills subcommand').strict();
404
+ })
405
+ .command('mcp', 'Manage the WorkOS MCP server in coding agents (Claude Code, Codex, Cursor)', (yargs) => {
406
+ registerSubcommand(yargs, 'install', 'Add the WorkOS MCP server to detected coding agents', (y) => y.option('agent', {
407
+ alias: 'a',
408
+ type: 'array',
409
+ string: true,
410
+ description: 'Target specific agent(s): claude-code, codex, cursor',
411
+ }), async (argv) => {
412
+ const { runMcpInstall } = await import('./commands/mcp.js');
413
+ await runMcpInstall({ agent: argv.agent });
414
+ });
415
+ registerSubcommand(yargs, 'remove', 'Remove the WorkOS MCP server from coding agents', (y) => y.option('agent', {
416
+ alias: 'a',
417
+ type: 'array',
418
+ string: true,
419
+ description: 'Target specific agent(s): claude-code, codex, cursor',
420
+ }), async (argv) => {
421
+ const { runMcpRemove } = await import('./commands/mcp.js');
422
+ await runMcpRemove({ agent: argv.agent });
423
+ });
424
+ registerSubcommand(yargs, 'status', 'Show which coding agents have the WorkOS MCP server configured', (y) => y, async () => {
425
+ const { runMcpStatus } = await import('./commands/mcp.js');
426
+ await runMcpStatus();
427
+ });
428
+ return yargs.demandCommand(1, 'Please specify an mcp subcommand').strict();
376
429
  })
377
430
  .command('doctor', 'Diagnose WorkOS AuthKit integration issues in the current project', (yargs) => yargs.options({
378
431
  verbose: {