cloudcruise 1.2.0 → 1.2.1

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
@@ -11,7 +11,7 @@ export { RunsClient } from './runs/RunsClient.js';
11
11
  export { WebhookClient } from './webhook/WebhookClient.js';
12
12
  export type { VaultEntry, GetVaultEntriesFilters, ProxyConfig, VaultPostPutHeadersInBody, SecretProvider, SecretProviderItem, SecretProviderType } from './vault/types.js';
13
13
  export type { Workflow, WorkflowInputSchema, WorkflowMetadata } from './workflows/types.js';
14
- export type { DryRun, Metadata, RunSpecificWebhook, PayloadWebhook, StartRunRequest, StartRunResponse, UserInteractionData, VideoUrl, SignedFileUrl, SignedScreenshotUrl, RunError, WorkflowError, RunResult, GetRunResult, WebhookEvent, WebhookReplayResponse, RunHandle, RunStreamOptions, SseEventName, SseMessage, RunEventEnvelope, RunHandleEventMap } from './runs/types.js';
14
+ export type { DryRun, Metadata, RunSpecificWebhook, PayloadWebhook, StartRunRequest, StartRunResponse, UserInteractionData, VideoUrl, SignedFileUrl, SignedScreenshotUrl, RunError, WorkflowError, RunResult, GetRunResult, WebhookEvent, WebhookReplayResponse, RunHandle, RunStreamOptions, SseEventName, SseMessage, RunEventEnvelope, RunHandleEventMap, LiveViewConnection } from './runs/types.js';
15
15
  export { EventType } from './events/types.js';
16
16
  export type { WebhookMessage, RunEventMessage, AvailableAction, PopupRetry, PopupContext, InputRequiredReason, ExecutionInputRequiredPayload, AgentErrorAnalysisPayload } from './events/types.js';
17
17
  export type { WebhookVerificationOptions } from './webhook/types.js';
@@ -1,4 +1,4 @@
1
- import type { StartRunRequest, UserInteractionData, GetRunResult, WebhookReplayResponse, RunHandle, RunStreamOptions } from './types.js';
1
+ import type { StartRunRequest, UserInteractionData, GetRunResult, WebhookReplayResponse, RunHandle, RunStreamOptions, LiveViewConnection } from './types.js';
2
2
  import type { PopupContext, ExecutionInputRequiredPayload } from '../events/types.js';
3
3
  import { ConnectionManager } from '../utils/connectionManager.js';
4
4
  export declare class RunsClient {
@@ -87,6 +87,18 @@ export declare class RunsClient {
87
87
  * @returns Promise resolving to complete run results
88
88
  */
89
89
  getResults(sessionId: string): Promise<GetRunResult>;
90
+ /**
91
+ * Fetches a fresh live-view connection (viewer URL + auth token) for
92
+ * watching an active session's browser stream. The auth token is
93
+ * single-use, so reopening a previously used viewer link will fail —
94
+ * call this again to mint a new one instead.
95
+ *
96
+ * Only works while the session is still active; throws once the session
97
+ * has ended.
98
+ *
99
+ * @param sessionId - The unique identifier for the workflow execution session
100
+ */
101
+ getLiveViewConnection(sessionId: string): Promise<LiveViewConnection>;
90
102
  /**
91
103
  * Interrupts a running browser agent run
92
104
  * @param sessionId - The unique identifier for the workflow execution session
@@ -380,6 +380,21 @@ export class RunsClient {
380
380
  const path = `/run/${sessionId}`;
381
381
  return await this.makeRequest('GET', path);
382
382
  }
383
+ /**
384
+ * Fetches a fresh live-view connection (viewer URL + auth token) for
385
+ * watching an active session's browser stream. The auth token is
386
+ * single-use, so reopening a previously used viewer link will fail —
387
+ * call this again to mint a new one instead.
388
+ *
389
+ * Only works while the session is still active; throws once the session
390
+ * has ended.
391
+ *
392
+ * @param sessionId - The unique identifier for the workflow execution session
393
+ */
394
+ async getLiveViewConnection(sessionId) {
395
+ const path = `/live/sessions/${sessionId}/connection`;
396
+ return await this.makeRequest('GET', path);
397
+ }
383
398
  /**
384
399
  * Interrupts a running browser agent run
385
400
  * @param sessionId - The unique identifier for the workflow execution session
@@ -36,6 +36,11 @@ export interface VideoUrl {
36
36
  signed_screen_recording_url: string;
37
37
  signed_screen_recording_url_expires: string;
38
38
  }
39
+ export interface LiveViewConnection {
40
+ url: string;
41
+ sessionId: string;
42
+ authToken: string;
43
+ }
39
44
  export interface RunError {
40
45
  prompt?: string | null;
41
46
  message?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcruise",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "The official CloudCruise JS/TS client.",
5
5
  "homepage": "https://github.com/CloudCruise/cloudcruise-js#readme",
6
6
  "bugs": {