@isomorph.ai/app-sdk 2.0.1 → 2.1.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.
@@ -83,6 +83,14 @@ export type ComputerUseLoginInput = {
83
83
  username?: never;
84
84
  password?: never;
85
85
  };
86
+ export interface ComputerUseLiveConnection {
87
+ endpoint: string;
88
+ headers: {
89
+ 'X-aws-proxy-auth': string;
90
+ 'X-aws-proxy-port': '8080';
91
+ };
92
+ viewerPath: string;
93
+ }
86
94
  export interface ComputerUseHandoffOptions extends ComputerUseTransport {
87
95
  runKey: string;
88
96
  authorize(): Promise<boolean> | boolean;
@@ -90,6 +98,7 @@ export interface ComputerUseHandoffOptions extends ComputerUseTransport {
90
98
  export declare function createComputerUseHandoff(options: ComputerUseHandoffOptions): {
91
99
  requestTakeover(reason: string, requiredInput?: "login" | "human"): Promise<ComputerUsePause>;
92
100
  view(pauseId: string): Promise<ComputerUsePage>;
101
+ live(pauseId: string): Promise<ComputerUseLiveConnection>;
93
102
  input(pauseId: string, action: ComputerUseInputAction): Promise<ComputerUseInputResult>;
94
103
  completeLogin(pauseId: string, input: ComputerUseLoginInput): Promise<{
95
104
  status: "login_queued";
@@ -73,6 +73,9 @@ export function createComputerUseHandoff(options) {
73
73
  throw new Error('The computer use API returned an incomplete screen.');
74
74
  return { status: 'ready', screenshot: page.screenshot, url: page.url };
75
75
  },
76
+ live(pauseId) {
77
+ return post('/tasks/live', paused(pauseId));
78
+ },
76
79
  input(pauseId, action) {
77
80
  return post('/tasks/input', { ...paused(pauseId), action });
78
81
  },
package/dist/index.d.ts CHANGED
@@ -2017,6 +2017,9 @@ export declare function createClient(options?: ClientOptions): {
2017
2017
  rpc: <T = unknown>(name: string, args?: Record<string, unknown>) => Promise<T>;
2018
2018
  watch: <T = Record<string, unknown>>(build: () => QueryBuilder<T, any>, onResult: (result: WatchResult) => void, options?: WatchOptions) => (() => void);
2019
2019
  };
2020
+ computerView: {
2021
+ url(action: string, taskId: string): string;
2022
+ };
2020
2023
  files: {
2021
2024
  createUpload: (input: {
2022
2025
  path: string;
package/dist/index.js CHANGED
@@ -773,6 +773,13 @@ export function createClient(options = {}) {
773
773
  clearTimer(timer); };
774
774
  },
775
775
  },
776
+ computerView: {
777
+ url(action, taskId) {
778
+ if (!/^[A-Za-z][A-Za-z0-9_-]{0,127}$/.test(action) || !/^[A-Za-z0-9_-]{1,128}$/.test(taskId))
779
+ throw new IsomorphError('VALIDATION_FAILED', 'Computer view needs an action and task ID.');
780
+ return `${transport.baseUrl}/_harbour/computer-view/${encodeURIComponent(action)}/${encodeURIComponent(taskId)}/`;
781
+ },
782
+ },
776
783
  files: {
777
784
  createUpload: (input) => transport.json('/_harbour/files/uploads', { method: 'POST', body: JSON.stringify(input) }),
778
785
  upload,
package/dist/runtime.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare const GET_RUN_ACTION = "isomorph-jobs-get";
12
12
  export declare const CANCEL_RUN_ACTION = "isomorph-jobs-cancel";
13
13
  export declare const LIST_RUNS_ACTION = "isomorph-jobs-list";
14
14
  export interface ActionContext {
15
+ readonly computerView?: boolean;
15
16
  signal: AbortSignal;
16
17
  user: IsomorphUser;
17
18
  tenant: string;
package/dist/runtime.js CHANGED
@@ -715,7 +715,7 @@ export class Runtime {
715
715
  response.writeHead(200, { 'content-type': PROGRESS_MEDIA_TYPE, ...(requestId ? { 'x-request-id': requestId } : {}) });
716
716
  response.write(line);
717
717
  };
718
- const context = { signal: controller.signal, user, tenant, app, requestId: requestId ?? '', progress, transaction: (fn) => this.transaction(name, fn) };
718
+ const context = { computerView: header(request, 'X-Harbour-Computer-View') === '1', signal: controller.signal, user, tenant, app, requestId: requestId ?? '', progress, transaction: (fn) => this.transaction(name, fn) };
719
719
  const raw = await readBody(request);
720
720
  if (raw === undefined)
721
721
  return refuse(response, 413, 'VALIDATION_FAILED', 'the request body is larger than 1 MiB', requestId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isomorph.ai/app-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",