@kubb/studio 5.3.4 → 5.3.6
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 +32 -11
- package/dist/index.cjs +508 -490
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +19 -5
- package/dist/index.js +472 -480
- package/dist/index.js.map +1 -1
- package/dist/protocol.cjs +33 -41
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.ts +144 -220
- package/dist/protocol.js +32 -35
- package/dist/protocol.js.map +1 -1
- package/package.json +6 -4
- package/dist/rolldown-runtime-qbf5tadS.cjs +0 -38
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-CRm0XQPb.js";
|
|
2
|
-
import { AgentPermissions, ClientInfo,
|
|
2
|
+
import { AgentApi, AgentPermissions, ClientInfo, ConfigEdit, ConnectMessagePayload, GenerateInput, GenerateResult, GenerationEvent, GenerationEventPayloads, GenerationEventType, GenerationRun, PublishSnapshotInput, PublishSnapshotResult, RpcConnection, RpcConnector, StudioApi, generationEventTypes } from "./protocol.js";
|
|
3
3
|
import { Config, Hookable, KubbHooks } from "@kubb/core";
|
|
4
4
|
import { Storage } from "unstorage";
|
|
5
5
|
//#region src/api.d.ts
|
|
@@ -14,7 +14,7 @@ export declare class InvalidAgentTokenError extends Error {
|
|
|
14
14
|
/**
|
|
15
15
|
* Status values returned by Studio's jobs API.
|
|
16
16
|
*/
|
|
17
|
-
type StudioJobStatus = 'queued' | 'running' | 'success' | 'failed';
|
|
17
|
+
type StudioJobStatus = 'queued' | 'running' | 'success' | 'failed' | 'canceled';
|
|
18
18
|
/**
|
|
19
19
|
* Package view returned on a successful snapshot job from Studio.
|
|
20
20
|
*/
|
|
@@ -57,7 +57,7 @@ type StudioJob = {
|
|
|
57
57
|
*/
|
|
58
58
|
id: string;
|
|
59
59
|
/**
|
|
60
|
-
* Current status. Poll until `success` or `
|
|
60
|
+
* Current status. Poll until `success`, `failed`, or `canceled`.
|
|
61
61
|
*/
|
|
62
62
|
status: StudioJobStatus;
|
|
63
63
|
/**
|
|
@@ -98,7 +98,7 @@ export declare function createJob({ studioUrl, token, type, agentId, name, versi
|
|
|
98
98
|
config?: Record<string, unknown>;
|
|
99
99
|
}): Promise<StudioJob>;
|
|
100
100
|
/**
|
|
101
|
-
* Polls `GET /api/jobs/{id}` until the job reaches
|
|
101
|
+
* Polls `GET /api/jobs/{id}` until the job reaches a terminal status, waiting
|
|
102
102
|
* {@link INITIAL_POLL_DELAY_MS} first and doubling up to {@link MAX_POLL_INTERVAL_MS} so a long
|
|
103
103
|
* job stays inside the API key's rate limit.
|
|
104
104
|
*
|
|
@@ -151,6 +151,7 @@ export declare function createAgent({ studioUrl, token, name, machineToken }: {
|
|
|
151
151
|
//#endregion
|
|
152
152
|
//#region src/StudioSession.d.ts
|
|
153
153
|
type StudioSessionOptions = {
|
|
154
|
+
connector?: RpcConnector;
|
|
154
155
|
token: string;
|
|
155
156
|
studioUrl?: string;
|
|
156
157
|
configPath: string;
|
|
@@ -526,5 +527,18 @@ type PollOptions = {
|
|
|
526
527
|
*/
|
|
527
528
|
export declare function pollForPairingToken({ studioUrl, session, signal }: PollOptions): Promise<PairingResult>;
|
|
528
529
|
//#endregion
|
|
529
|
-
|
|
530
|
+
//#region src/rpc.d.ts
|
|
531
|
+
/**
|
|
532
|
+
* Opens an authenticated Cap'n Web session to Studio over a WebSocket. Rejects an unencrypted URL
|
|
533
|
+
* before opening the socket, so a bearer token never reaches a plaintext host.
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
* ```ts
|
|
537
|
+
* const rpc = await connectWebSocketRpc({ url: 'wss://studio.kubb.dev/s/1', token, local: session })
|
|
538
|
+
* await rpc.studio.ping()
|
|
539
|
+
* ```
|
|
540
|
+
*/
|
|
541
|
+
export declare const connectWebSocketRpc: RpcConnector;
|
|
542
|
+
//#endregion
|
|
543
|
+
export { type AgentApi, type Client, type ClientOptions, type ConfigEdit, type ConnectMessagePayload, type ConnectionOptions, type GenerateInput, type GenerateResult, type GenerationEvent, type GenerationEventPayloads, type GenerationEventType, type GenerationRun, type PublishSnapshotInput, type PublishSnapshotResult, type RpcConnection, type RpcConnector, type StudioAgent, type StudioApi, type StudioConnectedContext, type StudioJob, type StudioJobStatus, type StudioSnapshot, generationEventTypes };
|
|
530
544
|
//# sourceMappingURL=index.d.ts.map
|