@kubb/studio 5.5.6 → 5.6.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/dist/index.d.ts CHANGED
@@ -275,16 +275,6 @@ type Client = {
275
275
  export declare function createClient({ onAuthRequired, ...options }: ClientOptions): Client;
276
276
  //#endregion
277
277
  //#region src/operations/hooks.d.ts
278
- /**
279
- * Events a host emits about its Kubb Studio session, as opposed to a generation. `kubb:` stays
280
- * reserved for generation lifecycle.
281
- */
282
- type StudioConnectingContext = {
283
- /**
284
- * The Studio instance this session is opening against.
285
- */
286
- url: string;
287
- };
288
278
  type StudioConnectedContext = {
289
279
  /**
290
280
  * The Studio instance this session attached to.
@@ -319,63 +309,65 @@ type StudioConnectedContext = {
319
309
  organizationSlug?: string;
320
310
  };
321
311
  /**
322
- * Fired once Studio confirms the `agent:connect` handshake was received and the session is fully
323
- * registered. Distinct from `studio:connected`, which only means the socket is open.
312
+ * Events a host emits about its Kubb Studio session, as opposed to a generation. `kubb:` stays
313
+ * reserved for generation lifecycle.
324
314
  */
325
- type StudioReadyContext = Record<string, never>;
326
- type StudioDisconnectedContext = {
327
- /**
328
- * Why Studio ended the session.
329
- */
330
- reason: string;
331
- };
332
- type StudioReconnectingContext = {
333
- /** Milliseconds until the next connection attempt. */
334
- delayMs: number;
335
- };
336
- type StudioCommandStartContext = {
337
- /**
338
- * The command Studio sent, without its `studio:` prefix: `generate`, `connect` or `save`.
339
- */
340
- command: string;
341
- };
342
- type StudioCommandEndContext = {
343
- /**
344
- * The command that finished, without its `studio:` prefix.
345
- */
346
- command: string;
347
- /**
348
- * What the command did, when there is something to report: `applied 2/3 edits to kubb.config.ts`.
349
- */
350
- info?: string;
351
- };
352
- type StudioWarnContext = {
353
- /**
354
- * What was refused or ignored.
355
- */
356
- message: string;
357
- /** The missing permission, if that is why, so the host can append its own remedy. */
358
- permission?: keyof AgentPermissions;
359
- };
360
- type StudioErrorContext = {
361
- /**
362
- * The failure, for the host's own output. One Studio needs to hear about goes over the socket
363
- * through the `kubb:error` generation hook instead.
364
- */
365
- error: Error;
366
- };
367
315
  declare global {
368
316
  namespace Kubb {
369
317
  interface KubbHooksRegistry {
370
- 'studio:connecting': [ctx: StudioConnectingContext];
318
+ /**
319
+ * The Studio instance this session is opening against.
320
+ */
321
+ 'studio:connecting': [ctx: {
322
+ url: string;
323
+ }];
371
324
  'studio:connected': [ctx: StudioConnectedContext];
372
- 'studio:ready': [ctx: StudioReadyContext];
373
- 'studio:disconnected': [ctx: StudioDisconnectedContext];
374
- 'studio:reconnecting': [ctx: StudioReconnectingContext];
375
- 'studio:command:start': [ctx: StudioCommandStartContext];
376
- 'studio:command:end': [ctx: StudioCommandEndContext];
377
- 'studio:warn': [ctx: StudioWarnContext];
378
- 'studio:error': [ctx: StudioErrorContext];
325
+ /**
326
+ * Fired once Studio confirms the `agent:connect` handshake was received and the session is
327
+ * fully registered. Distinct from `studio:connected`, which only means the socket is open.
328
+ */
329
+ 'studio:ready': [ctx: Record<string, never>];
330
+ /**
331
+ * Why Studio ended the session.
332
+ */
333
+ 'studio:disconnected': [ctx: {
334
+ reason: string;
335
+ }];
336
+ /**
337
+ * Milliseconds until the next connection attempt.
338
+ */
339
+ 'studio:reconnecting': [ctx: {
340
+ delayMs: number;
341
+ }];
342
+ /**
343
+ * The command Studio sent, without its `studio:` prefix: `generate`, `connect` or `save`.
344
+ */
345
+ 'studio:command:start': [ctx: {
346
+ command: string;
347
+ }];
348
+ /**
349
+ * The command that finished, with what it did when there is something to report:
350
+ * `applied 2/3 edits to kubb.config.ts`.
351
+ */
352
+ 'studio:command:end': [ctx: {
353
+ command: string;
354
+ info?: string;
355
+ }];
356
+ /**
357
+ * What was refused or ignored, and the missing permission if that is why, so the host can
358
+ * append its own remedy.
359
+ */
360
+ 'studio:warn': [ctx: {
361
+ message: string;
362
+ permission?: keyof AgentPermissions;
363
+ }];
364
+ /**
365
+ * The failure, for the host's own output. One Studio needs to hear about goes over the
366
+ * socket through the `kubb:error` generation hook instead.
367
+ */
368
+ 'studio:error': [ctx: {
369
+ error: Error;
370
+ }];
379
371
  }
380
372
  }
381
373
  }