@kubb/studio 5.3.17 → 5.3.18
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 +8 -0
- package/dist/index.cjs +365 -344
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +17 -12
- package/dist/index.js +365 -344
- package/dist/index.js.map +1 -1
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.ts +3 -8
- package/dist/protocol.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { t as __name } from "./rolldown-runtime-CRm0XQPb.js";
|
|
|
2
2
|
import { AGENT_INSTANCE_HEADER, AgentApi, AgentCapacity, AgentCloseCode, AgentLoad, AgentPermissions, AgentRegisterInput, AgentRegisterResponse, ConfigEdit, ConnectMessagePayload, GenerateInput, GenerateResult, GenerationEvent, GenerationEventPayloads, GenerationEventType, GenerationRun, PublishSnapshotInput, PublishSnapshotResult, RpcClose, RpcConnection, RpcConnector, StudioApi, generationEventTypes } from "./protocol.js";
|
|
3
3
|
import { Config, Hookable, KubbHooks } from "@kubb/core";
|
|
4
4
|
import { Storage } from "unstorage";
|
|
5
|
-
//#region src/api.d.ts
|
|
5
|
+
//#region src/operations/api.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Thrown when Studio rejects the agent token itself (401). Retrying cannot help: the token was
|
|
8
8
|
* revoked, or the agent it belonged to was deleted in the Studio UI. Hosts catch this to forget
|
|
@@ -117,7 +117,7 @@ type StudioJob = {
|
|
|
117
117
|
* const finished = await waitForJob({ studioUrl, token, id: job.id })
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
|
-
export declare function createJob({ studioUrl, token, type, agentId, name, version, commit, baseId, config, timeoutMs, signal }: {
|
|
120
|
+
export declare function createJob({ studioUrl, token, type, agentId, name, version, commit, baseId, config, instanceId, timeoutMs, signal }: {
|
|
121
121
|
studioUrl: string;
|
|
122
122
|
token: string;
|
|
123
123
|
type: 'generation' | 'snapshot';
|
|
@@ -129,6 +129,11 @@ export declare function createJob({ studioUrl, token, type, agentId, name, versi
|
|
|
129
129
|
/** The `id` another CI agent's runs register under, such as the base branch's; this snapshot is also compared with its latest one. */
|
|
130
130
|
baseId?: string;
|
|
131
131
|
config?: Record<string, unknown>;
|
|
132
|
+
/**
|
|
133
|
+
* The agent process to run the job on, the `instanceId` its client connected with. A CI run passes
|
|
134
|
+
* its own, so an overlapping pipeline under the same CI agent never builds its checkout.
|
|
135
|
+
*/
|
|
136
|
+
instanceId?: string;
|
|
132
137
|
/**
|
|
133
138
|
* How long to keep retrying a busy or queue-full response before giving up, in milliseconds.
|
|
134
139
|
*
|
|
@@ -190,7 +195,7 @@ export declare function createAgent({ studioUrl, token, name, machineToken }: {
|
|
|
190
195
|
machineToken: string;
|
|
191
196
|
}): Promise<StudioAgent>;
|
|
192
197
|
//#endregion
|
|
193
|
-
//#region src/StudioSession.d.ts
|
|
198
|
+
//#region src/runtime/StudioSession.d.ts
|
|
194
199
|
type StudioSessionOptions = {
|
|
195
200
|
connector?: RpcConnector;
|
|
196
201
|
token: string;
|
|
@@ -230,7 +235,7 @@ type StudioSessionOptions = {
|
|
|
230
235
|
heartbeatInterval?: number;
|
|
231
236
|
/**
|
|
232
237
|
* What this agent process can take on, reported to Studio at registration. Unset fields come from
|
|
233
|
-
* `KUBB_AGENT_MAX_CONCURRENT
|
|
238
|
+
* `KUBB_AGENT_MAX_CONCURRENT`.
|
|
234
239
|
*/
|
|
235
240
|
capacity?: Partial<AgentCapacity>;
|
|
236
241
|
/**
|
|
@@ -259,8 +264,8 @@ type StudioSessionOptions = {
|
|
|
259
264
|
onTokenRejected?: (error: InvalidAgentTokenError) => void;
|
|
260
265
|
};
|
|
261
266
|
//#endregion
|
|
262
|
-
//#region src/client.d.ts
|
|
263
|
-
type ClientOptions = Omit<StudioSessionOptions, 'signal' | 'onTokenRejected' | '
|
|
267
|
+
//#region src/runtime/client.d.ts
|
|
268
|
+
type ClientOptions = Omit<StudioSessionOptions, 'signal' | 'onTokenRejected' | 'reconnectAttempt'> & {
|
|
264
269
|
/**
|
|
265
270
|
* Called once when the token is rejected during a background reconnect (401: revoked, or the
|
|
266
271
|
* agent was deleted). The client is already stopped by the time this fires, so a host only needs
|
|
@@ -297,7 +302,7 @@ type Client = {
|
|
|
297
302
|
*/
|
|
298
303
|
export declare function createClient({ onAuthRequired, ...options }: ClientOptions): Client;
|
|
299
304
|
//#endregion
|
|
300
|
-
//#region src/hooks.d.ts
|
|
305
|
+
//#region src/operations/hooks.d.ts
|
|
301
306
|
/**
|
|
302
307
|
* Events a host emits about its Kubb Studio session, as opposed to a generation. `kubb:` stays
|
|
303
308
|
* reserved for generation lifecycle.
|
|
@@ -403,14 +408,14 @@ declare global {
|
|
|
403
408
|
}
|
|
404
409
|
}
|
|
405
410
|
//#endregion
|
|
406
|
-
//#region src/constants.d.ts
|
|
411
|
+
//#region src/operations/constants.d.ts
|
|
407
412
|
/**
|
|
408
413
|
* Hosted Kubb Studio URL. Exported so credential stores can bind tokens to the resolved instance,
|
|
409
414
|
* not whatever default the client would pick on its own.
|
|
410
415
|
*/
|
|
411
416
|
export declare const defaultStudioUrl = "https://kubb.studio";
|
|
412
417
|
//#endregion
|
|
413
|
-
//#region src/machine.d.ts
|
|
418
|
+
//#region src/operations/machine.d.ts
|
|
414
419
|
/**
|
|
415
420
|
* Installs the storage driver the runtime persists to. Call once, before connecting.
|
|
416
421
|
*/
|
|
@@ -426,7 +431,7 @@ export declare function createFileStorage(base: string): Storage;
|
|
|
426
431
|
*/
|
|
427
432
|
export declare function machineTokenFrom(secret: string): string;
|
|
428
433
|
//#endregion
|
|
429
|
-
//#region src/runConnection.d.ts
|
|
434
|
+
//#region src/runtime/runConnection.d.ts
|
|
430
435
|
/**
|
|
431
436
|
* Why a connection ended: the host asked it to stop through its `signal`, or the host declined to
|
|
432
437
|
* replace a rejected token.
|
|
@@ -494,7 +499,7 @@ export declare function runConnection<TCredentials extends {
|
|
|
494
499
|
token: string;
|
|
495
500
|
}>({ credentials, clientOptions, onTokenRejected, signal }: ConnectionOptions<TCredentials>): Promise<ConnectionOutcome>;
|
|
496
501
|
//#endregion
|
|
497
|
-
//#region src/pair.d.ts
|
|
502
|
+
//#region src/operations/pair.d.ts
|
|
498
503
|
/**
|
|
499
504
|
* RFC 8628 device-authorization response from Studio's `/api/auth/device/code` endpoint.
|
|
500
505
|
* Field names match the RFC; the CLI polls with `device_code` and shows `user_code` to the user.
|
|
@@ -609,7 +614,7 @@ type PairAgentOptions = StartPairingOptions & {
|
|
|
609
614
|
*/
|
|
610
615
|
export declare function pairAgent({ onCode, onRetry, maxAttempts, ...options }: PairAgentOptions): Promise<PairingResult>;
|
|
611
616
|
//#endregion
|
|
612
|
-
//#region src/rpc.d.ts
|
|
617
|
+
//#region src/operations/rpc.d.ts
|
|
613
618
|
/**
|
|
614
619
|
* Opens an authenticated Cap'n Web session to Studio over a WebSocket. Rejects an unencrypted URL
|
|
615
620
|
* before opening the socket, so a bearer token never reaches a plaintext host.
|