workos 0.1.2 → 0.2.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 (52) hide show
  1. package/dist/src/commands/login.js +1 -1
  2. package/dist/src/commands/login.js.map +1 -1
  3. package/dist/src/lib/adapters/cli-adapter.d.ts +21 -0
  4. package/dist/src/lib/adapters/cli-adapter.js +165 -21
  5. package/dist/src/lib/adapters/cli-adapter.js.map +1 -1
  6. package/dist/src/lib/adapters/dashboard-adapter.js +13 -0
  7. package/dist/src/lib/adapters/dashboard-adapter.js.map +1 -1
  8. package/dist/src/lib/ai-content.d.ts +10 -0
  9. package/dist/src/lib/ai-content.js +68 -0
  10. package/dist/src/lib/ai-content.js.map +1 -0
  11. package/dist/src/lib/credential-discovery.d.ts +42 -0
  12. package/dist/src/lib/credential-discovery.js +100 -0
  13. package/dist/src/lib/credential-discovery.js.map +1 -0
  14. package/dist/src/lib/credentials.d.ts +22 -0
  15. package/dist/src/lib/credentials.js +29 -0
  16. package/dist/src/lib/credentials.js.map +1 -1
  17. package/dist/src/lib/device-auth.d.ts +44 -0
  18. package/dist/src/lib/device-auth.js +137 -0
  19. package/dist/src/lib/device-auth.js.map +1 -0
  20. package/dist/src/lib/events.d.ts +75 -0
  21. package/dist/src/lib/events.js.map +1 -1
  22. package/dist/src/lib/post-install.d.ts +8 -0
  23. package/dist/src/lib/post-install.js +51 -0
  24. package/dist/src/lib/post-install.js.map +1 -0
  25. package/dist/src/lib/run-with-core.js +107 -1
  26. package/dist/src/lib/run-with-core.js.map +1 -1
  27. package/dist/src/lib/staging-api.d.ts +22 -0
  28. package/dist/src/lib/staging-api.js +74 -0
  29. package/dist/src/lib/staging-api.js.map +1 -0
  30. package/dist/src/lib/wizard-core.d.ts +300 -8
  31. package/dist/src/lib/wizard-core.js +622 -27
  32. package/dist/src/lib/wizard-core.js.map +1 -1
  33. package/dist/src/lib/wizard-core.types.d.ts +64 -1
  34. package/dist/src/lib/wizard-core.types.js.map +1 -1
  35. package/dist/src/run.d.ts +1 -0
  36. package/dist/src/run.js +1 -0
  37. package/dist/src/run.js.map +1 -1
  38. package/dist/src/utils/debug.js +15 -9
  39. package/dist/src/utils/debug.js.map +1 -1
  40. package/dist/src/utils/git-utils.d.ts +23 -0
  41. package/dist/src/utils/git-utils.js +86 -0
  42. package/dist/src/utils/git-utils.js.map +1 -0
  43. package/dist/src/utils/types.d.ts +4 -0
  44. package/dist/src/utils/types.js.map +1 -1
  45. package/package.json +6 -6
  46. package/skills/workos-authkit-base/SKILL.md +24 -14
  47. package/skills/workos-authkit-nextjs/SKILL.md +12 -1
  48. package/skills/workos-authkit-react/SKILL.md +4 -4
  49. package/skills/workos-authkit-react-router/SKILL.md +11 -10
  50. package/skills/workos-authkit-tanstack-start/SKILL.md +8 -6
  51. package/skills/workos-authkit-vanilla-js/SKILL.md +10 -8
  52. package/dist/package.json +0 -87
@@ -1,6 +1,8 @@
1
1
  import { type ActorRefFrom } from 'xstate';
2
- import type { WizardMachineContext, WizardMachineInput, DetectionOutput, GitCheckOutput, AgentOutput } from './wizard-core.types.js';
2
+ import type { WizardMachineContext, WizardMachineInput, DetectionOutput, GitCheckOutput, AgentOutput, EnvFileInfo, DiscoveryResult, BranchCheckOutput } from './wizard-core.types.js';
3
3
  import type { WizardOptions } from '../utils/types.js';
4
+ import type { DeviceAuthResult, DeviceAuthResponse } from './device-auth.js';
5
+ import type { StagingCredentials } from './staging-api.js';
4
6
  export declare const wizardMachine: import("xstate").StateMachine<WizardMachineContext, {
5
7
  type: "START";
6
8
  } | {
@@ -15,6 +17,26 @@ export declare const wizardMachine: import("xstate").StateMachine<WizardMachineC
15
17
  clientId: string;
16
18
  } | {
17
19
  type: "CANCEL";
20
+ } | {
21
+ type: "ENV_SCAN_APPROVED";
22
+ } | {
23
+ type: "ENV_SCAN_DECLINED";
24
+ } | {
25
+ type: "RETRY_AUTH";
26
+ } | {
27
+ type: "BRANCH_CREATE";
28
+ } | {
29
+ type: "BRANCH_CONTINUE";
30
+ } | {
31
+ type: "BRANCH_CANCEL";
32
+ } | {
33
+ type: "COMMIT_APPROVED";
34
+ } | {
35
+ type: "COMMIT_DECLINED";
36
+ } | {
37
+ type: "PR_APPROVED";
38
+ } | {
39
+ type: "PR_DECLINED";
18
40
  }, {
19
41
  [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<boolean, {
20
42
  options: WizardOptions;
@@ -26,6 +48,39 @@ export declare const wizardMachine: import("xstate").StateMachine<WizardMachineC
26
48
  context: WizardMachineContext;
27
49
  }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<AgentOutput, {
28
50
  context: WizardMachineContext;
51
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<EnvFileInfo, {
52
+ installDir: string;
53
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<DiscoveryResult, {
54
+ installDir: string;
55
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<boolean, void, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
56
+ result: DeviceAuthResult;
57
+ deviceAuth: DeviceAuthResponse;
58
+ }, {
59
+ emitter: WizardMachineContext["emitter"];
60
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<StagingCredentials, void, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<BranchCheckOutput, void, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
61
+ branch: string;
62
+ }, {
63
+ name: string;
64
+ fallbackName: string;
65
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
66
+ hasChanges: boolean;
67
+ files: string[];
68
+ }, void, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<string, {
69
+ integration: string;
70
+ files: string[];
71
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, {
72
+ message: string;
73
+ cwd: string;
74
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<string, {
75
+ integration: string;
76
+ files: string[];
77
+ commitMessage: string;
78
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, {
79
+ cwd: string;
80
+ }, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<string, {
81
+ title: string;
82
+ body: string;
83
+ cwd: string;
29
84
  }, import("xstate").EventObject>> | undefined;
30
85
  }, {
31
86
  src: "checkAuthentication";
@@ -57,6 +112,91 @@ export declare const wizardMachine: import("xstate").StateMachine<WizardMachineC
57
112
  context: WizardMachineContext;
58
113
  }, import("xstate").EventObject>;
59
114
  id: string | undefined;
115
+ } | {
116
+ src: "detectEnvFiles";
117
+ logic: import("xstate").PromiseActorLogic<EnvFileInfo, {
118
+ installDir: string;
119
+ }, import("xstate").EventObject>;
120
+ id: string | undefined;
121
+ } | {
122
+ src: "scanEnvFiles";
123
+ logic: import("xstate").PromiseActorLogic<DiscoveryResult, {
124
+ installDir: string;
125
+ }, import("xstate").EventObject>;
126
+ id: string | undefined;
127
+ } | {
128
+ src: "checkStoredAuth";
129
+ logic: import("xstate").PromiseActorLogic<boolean, void, import("xstate").EventObject>;
130
+ id: string | undefined;
131
+ } | {
132
+ src: "runDeviceAuth";
133
+ logic: import("xstate").PromiseActorLogic<{
134
+ result: DeviceAuthResult;
135
+ deviceAuth: DeviceAuthResponse;
136
+ }, {
137
+ emitter: WizardMachineContext["emitter"];
138
+ }, import("xstate").EventObject>;
139
+ id: string | undefined;
140
+ } | {
141
+ src: "fetchStagingCredentials";
142
+ logic: import("xstate").PromiseActorLogic<StagingCredentials, void, import("xstate").EventObject>;
143
+ id: string | undefined;
144
+ } | {
145
+ src: "checkBranch";
146
+ logic: import("xstate").PromiseActorLogic<BranchCheckOutput, void, import("xstate").EventObject>;
147
+ id: string | undefined;
148
+ } | {
149
+ src: "createBranch";
150
+ logic: import("xstate").PromiseActorLogic<{
151
+ branch: string;
152
+ }, {
153
+ name: string;
154
+ fallbackName: string;
155
+ }, import("xstate").EventObject>;
156
+ id: string | undefined;
157
+ } | {
158
+ src: "detectChanges";
159
+ logic: import("xstate").PromiseActorLogic<{
160
+ hasChanges: boolean;
161
+ files: string[];
162
+ }, void, import("xstate").EventObject>;
163
+ id: string | undefined;
164
+ } | {
165
+ src: "generateCommitMessage";
166
+ logic: import("xstate").PromiseActorLogic<string, {
167
+ integration: string;
168
+ files: string[];
169
+ }, import("xstate").EventObject>;
170
+ id: string | undefined;
171
+ } | {
172
+ src: "commitChanges";
173
+ logic: import("xstate").PromiseActorLogic<void, {
174
+ message: string;
175
+ cwd: string;
176
+ }, import("xstate").EventObject>;
177
+ id: string | undefined;
178
+ } | {
179
+ src: "generatePrDescription";
180
+ logic: import("xstate").PromiseActorLogic<string, {
181
+ integration: string;
182
+ files: string[];
183
+ commitMessage: string;
184
+ }, import("xstate").EventObject>;
185
+ id: string | undefined;
186
+ } | {
187
+ src: "pushBranch";
188
+ logic: import("xstate").PromiseActorLogic<void, {
189
+ cwd: string;
190
+ }, import("xstate").EventObject>;
191
+ id: string | undefined;
192
+ } | {
193
+ src: "createPr";
194
+ logic: import("xstate").PromiseActorLogic<string, {
195
+ title: string;
196
+ body: string;
197
+ cwd: string;
198
+ }, import("xstate").EventObject>;
199
+ id: string | undefined;
60
200
  }, {
61
201
  type: "emitStateEnter";
62
202
  params: {
@@ -100,12 +240,65 @@ export declare const wizardMachine: import("xstate").StateMachine<WizardMachineC
100
240
  } | {
101
241
  type: "emitGitCancelled";
102
242
  params: unknown;
243
+ } | {
244
+ type: "emitBranchChecking";
245
+ params: unknown;
246
+ } | {
247
+ type: "emitBranchProtected";
248
+ params: unknown;
249
+ } | {
250
+ type: "emitBranchCreated";
251
+ params: {
252
+ branch: string;
253
+ };
254
+ } | {
255
+ type: "emitBranchCreateFailed";
256
+ params: unknown;
257
+ } | {
258
+ type: "assignBranchResult";
259
+ params: unknown;
103
260
  } | {
104
261
  type: "emitCredentialsGathering";
105
262
  params: unknown;
106
263
  } | {
107
264
  type: "emitCredentialsFound";
108
265
  params: unknown;
266
+ } | {
267
+ type: "emitEnvDetected";
268
+ params: unknown;
269
+ } | {
270
+ type: "emitEnvScanPrompt";
271
+ params: unknown;
272
+ } | {
273
+ type: "emitEnvScanning";
274
+ params: unknown;
275
+ } | {
276
+ type: "emitEnvCredentialsFound";
277
+ params: unknown;
278
+ } | {
279
+ type: "emitEnvNotFound";
280
+ params: unknown;
281
+ } | {
282
+ type: "emitDeviceAuthStart";
283
+ params: unknown;
284
+ } | {
285
+ type: "emitDeviceAuthSuccess";
286
+ params: unknown;
287
+ } | {
288
+ type: "emitDeviceAuthError";
289
+ params: unknown;
290
+ } | {
291
+ type: "emitDeviceTimeout";
292
+ params: unknown;
293
+ } | {
294
+ type: "emitStagingFetching";
295
+ params: unknown;
296
+ } | {
297
+ type: "emitStagingSuccess";
298
+ params: unknown;
299
+ } | {
300
+ type: "emitStagingError";
301
+ params: unknown;
109
302
  } | {
110
303
  type: "emitConfigStart";
111
304
  params: unknown;
@@ -125,22 +318,82 @@ export declare const wizardMachine: import("xstate").StateMachine<WizardMachineC
125
318
  params: unknown;
126
319
  } | {
127
320
  type: "assignDetectionResult";
128
- params: import("xstate").NonReducibleUnknown;
321
+ params: unknown;
129
322
  } | {
130
323
  type: "assignGitResult";
131
- params: import("xstate").NonReducibleUnknown;
324
+ params: unknown;
132
325
  } | {
133
326
  type: "assignCredentials";
134
- params: import("xstate").NonReducibleUnknown;
327
+ params: unknown;
135
328
  } | {
136
329
  type: "assignError";
137
- params: import("xstate").NonReducibleUnknown;
330
+ params: unknown;
138
331
  } | {
139
332
  type: "emitCancelled";
140
333
  params: unknown;
141
334
  } | {
142
335
  type: "emitError";
143
336
  params: unknown;
337
+ } | {
338
+ type: "assignChangedFiles";
339
+ params: unknown;
340
+ } | {
341
+ type: "emitChangesDetected";
342
+ params: unknown;
343
+ } | {
344
+ type: "emitNoChanges";
345
+ params: unknown;
346
+ } | {
347
+ type: "emitCommitPrompt";
348
+ params: unknown;
349
+ } | {
350
+ type: "emitGeneratingCommitMessage";
351
+ params: unknown;
352
+ } | {
353
+ type: "assignCommitMessage";
354
+ params: unknown;
355
+ } | {
356
+ type: "emitCommitting";
357
+ params: unknown;
358
+ } | {
359
+ type: "emitCommitSuccess";
360
+ params: unknown;
361
+ } | {
362
+ type: "emitCommitFailed";
363
+ params: unknown;
364
+ } | {
365
+ type: "emitPrPrompt";
366
+ params: unknown;
367
+ } | {
368
+ type: "emitGeneratingPrDescription";
369
+ params: unknown;
370
+ } | {
371
+ type: "assignPrDescription";
372
+ params: unknown;
373
+ } | {
374
+ type: "emitPushing";
375
+ params: unknown;
376
+ } | {
377
+ type: "emitPushFailed";
378
+ params: unknown;
379
+ } | {
380
+ type: "emitCreatingPr";
381
+ params: unknown;
382
+ } | {
383
+ type: "assignPrUrl";
384
+ params: unknown;
385
+ } | {
386
+ type: "emitPrCreated";
387
+ params: unknown;
388
+ } | {
389
+ type: "emitPrFailed";
390
+ params: unknown;
391
+ } | {
392
+ type: "emitManualInstructions";
393
+ params: unknown;
394
+ } | {
395
+ type: "emitComplete";
396
+ params: unknown;
144
397
  }, {
145
398
  type: "shouldSkipAuth";
146
399
  params: unknown;
@@ -153,13 +406,22 @@ export declare const wizardMachine: import("xstate").StateMachine<WizardMachineC
153
406
  } | {
154
407
  type: "hasIntegration";
155
408
  params: unknown;
409
+ } | {
410
+ type: "shouldSkipPostInstall";
411
+ params: unknown;
412
+ } | {
413
+ type: "hasGhCli";
414
+ params: unknown;
156
415
  }, never, "error" | "cancelled" | "complete" | "idle" | "authenticating" | "configuring" | "runningAgent" | {
157
416
  preparing: {
158
417
  detection: "done" | "running";
159
418
  gitCheck: "done" | "running" | "evaluating" | "awaitingConfirmation";
419
+ branchCheck: "done" | "running" | "awaitingConfirmation" | "creating";
160
420
  };
161
421
  } | {
162
- gatheringCredentials: "checking" | "prompting";
422
+ gatheringCredentials: "checkingCliFlags" | "detectingEnvFiles" | "promptingEnvScan" | "checkingStoredAuth" | "scanningEnvFiles" | "fetchingStagingCredentials" | "runningDeviceAuth" | "promptingManual";
423
+ } | {
424
+ postInstall: "done" | "checking" | "detectingChanges" | "promptingCommit" | "generatingCommitMessage" | "committing" | "checkingGhCli" | "promptingPr" | "showingManualInstructions" | "generatingPrDescription" | "pushing" | "creatingPr";
163
425
  }, string, WizardMachineInput, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
164
426
  id: "wizard";
165
427
  states: {
@@ -181,16 +443,46 @@ export declare const wizardMachine: import("xstate").StateMachine<WizardMachineC
181
443
  readonly done: {};
182
444
  };
183
445
  };
446
+ readonly branchCheck: {
447
+ states: {
448
+ readonly running: {};
449
+ readonly awaitingConfirmation: {};
450
+ readonly creating: {};
451
+ readonly done: {};
452
+ };
453
+ };
184
454
  };
185
455
  };
186
456
  readonly gatheringCredentials: {
187
457
  states: {
188
- readonly checking: {};
189
- readonly prompting: {};
458
+ readonly checkingCliFlags: {};
459
+ readonly detectingEnvFiles: {};
460
+ readonly promptingEnvScan: {};
461
+ readonly scanningEnvFiles: {};
462
+ readonly checkingStoredAuth: {};
463
+ readonly runningDeviceAuth: {};
464
+ readonly fetchingStagingCredentials: {};
465
+ readonly promptingManual: {};
190
466
  };
191
467
  };
192
468
  readonly configuring: {};
193
469
  readonly runningAgent: {};
470
+ readonly postInstall: {
471
+ states: {
472
+ readonly checking: {};
473
+ readonly detectingChanges: {};
474
+ readonly promptingCommit: {};
475
+ readonly generatingCommitMessage: {};
476
+ readonly committing: {};
477
+ readonly checkingGhCli: {};
478
+ readonly promptingPr: {};
479
+ readonly generatingPrDescription: {};
480
+ readonly pushing: {};
481
+ readonly creatingPr: {};
482
+ readonly showingManualInstructions: {};
483
+ readonly done: {};
484
+ };
485
+ };
194
486
  readonly complete: {};
195
487
  readonly cancelled: {};
196
488
  readonly error: {};