@kazzle/app 0.1.929 → 0.1.930

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/sdk.d.ts CHANGED
@@ -1 +1 @@
1
- export * from 'kazzle';
1
+ export * from './vendor/kazzle/index.js';
package/dist/sdk.js CHANGED
@@ -4,7 +4,10 @@
4
4
  // (server/apps/apps.runtime-env.ts), so `new Kazzle()` needs no arguments
5
5
  // there: the key scopes every call to the app's space.
6
6
  //
7
- // The implementation lives in the `kazzle` package (packages/kazzle-sdk) — an
8
- // optional peer dependency, so apps that do not drive computers or browsers do
9
- // not install it.
10
- export * from 'kazzle';
7
+ // The implementation lives in the `kazzle` package (packages/kazzle-sdk). In
8
+ // the monorepo this resolves to the workspace package; the PUBLISHED build
9
+ // vendors the SDK's dist under dist/vendor/kazzle and rewrites this entry to
10
+ // point at it (scripts/build.ts), so app code installed from npm never needs a
11
+ // separate `kazzle` install.
12
+ // Published build: the SDK is vendored (see scripts/build.ts).
13
+ export * from './vendor/kazzle/index.js';
@@ -0,0 +1,56 @@
1
+ import { type KazzleHttp } from './http';
2
+ import { TabsApi } from './browsers.tabs';
3
+ import { ProfilesApi } from './browsers.profiles';
4
+ import type { ActionResult, BrowserCreateOptions, BrowserCreateResponse, BrowserRow, BrowserState, ListResponse, TabOpenResponse, TabRow } from './sdk.types';
5
+ /**
6
+ * Handle for one browser session, bound to the first tab from the create
7
+ * response. Use `kazzle.browsers.tabs.*` with other tab ids for multi-tab work.
8
+ */
9
+ export declare class Browser {
10
+ private readonly api;
11
+ /** Browser session id. */
12
+ readonly id: string;
13
+ /** The session's first tab — the target of nav()/screenshot() below. */
14
+ readonly tabId: string;
15
+ /** Host computer, or null for a stealth cloud browser. */
16
+ readonly computerId: string | null;
17
+ readonly provider: string;
18
+ /** Open this URL in a browser of your own to watch the session live. */
19
+ readonly liveViewUrl: string | null;
20
+ constructor(api: BrowsersApi, created: BrowserCreateResponse);
21
+ /** Navigate the first tab. */
22
+ nav(url: string): Promise<ActionResult>;
23
+ /** Screenshot the first tab. Returns PNG (or JPEG) bytes. */
24
+ screenshot(): Promise<Uint8Array>;
25
+ /** Any tab action on the first tab by its URL segment, e.g. action('click', { ref }). */
26
+ action(segment: string, body?: Record<string, unknown>): Promise<ActionResult>;
27
+ /** List the session's open tabs. */
28
+ tabs(): Promise<ListResponse<TabRow>>;
29
+ /** Open another tab. The new tab id is the response's tab_id. */
30
+ openTab(options?: {
31
+ url?: string;
32
+ }): Promise<TabOpenResponse>;
33
+ /** Close the browser session. The profile (logins, cookies) survives. */
34
+ close(): Promise<ActionResult>;
35
+ }
36
+ export declare class BrowsersApi {
37
+ private readonly http;
38
+ readonly tabs: TabsApi;
39
+ readonly profiles: ProfilesApi;
40
+ constructor(http: KazzleHttp);
41
+ /**
42
+ * Open a browser session. No options means a stealth cloud browser
43
+ * (anti-bot, proxies) for the real web; pass computerId for that computer's
44
+ * built-in browser (its own pages: app previews, localhost). Returns a
45
+ * Browser handle bound to the first tab.
46
+ */
47
+ create(options?: BrowserCreateOptions): Promise<Browser>;
48
+ /** List browser sessions in the API key's space. */
49
+ list(options?: {
50
+ computerId?: string;
51
+ }): Promise<ListResponse<BrowserRow>>;
52
+ /** State of a browser session plus its live_view_url and tabs. */
53
+ get(browserId: string): Promise<BrowserState>;
54
+ /** Close the browser session and delete its tabs. The profile survives. */
55
+ close(browserId: string): Promise<ActionResult>;
56
+ }
@@ -0,0 +1,88 @@
1
+ // kazzle.browsers.* — browser sessions (/browsers). A browser id is a session
2
+ // id; the durable identity is the profile. create() returns a Browser handle
3
+ // bound to the session's first tab for the common drive-one-page flow.
4
+ import { apiPath } from './http';
5
+ import { TabsApi } from './browsers.tabs';
6
+ import { ProfilesApi } from './browsers.profiles';
7
+ /**
8
+ * Handle for one browser session, bound to the first tab from the create
9
+ * response. Use `kazzle.browsers.tabs.*` with other tab ids for multi-tab work.
10
+ */
11
+ export class Browser {
12
+ api;
13
+ /** Browser session id. */
14
+ id;
15
+ /** The session's first tab — the target of nav()/screenshot() below. */
16
+ tabId;
17
+ /** Host computer, or null for a stealth cloud browser. */
18
+ computerId;
19
+ provider;
20
+ /** Open this URL in a browser of your own to watch the session live. */
21
+ liveViewUrl;
22
+ constructor(api, created) {
23
+ this.api = api;
24
+ this.id = created.id;
25
+ this.tabId = created.tab_id;
26
+ this.computerId = created.computer_id;
27
+ this.provider = created.provider;
28
+ this.liveViewUrl = created.live_view_url;
29
+ }
30
+ /** Navigate the first tab. */
31
+ nav(url) {
32
+ return this.api.tabs.nav(this.id, this.tabId, { url });
33
+ }
34
+ /** Screenshot the first tab. Returns PNG (or JPEG) bytes. */
35
+ screenshot() {
36
+ return this.api.tabs.screenshot(this.id, this.tabId);
37
+ }
38
+ /** Any tab action on the first tab by its URL segment, e.g. action('click', { ref }). */
39
+ action(segment, body = {}) {
40
+ return this.api.tabs.action(this.id, this.tabId, segment, body);
41
+ }
42
+ /** List the session's open tabs. */
43
+ tabs() {
44
+ return this.api.tabs.list(this.id);
45
+ }
46
+ /** Open another tab. The new tab id is the response's tab_id. */
47
+ openTab(options = {}) {
48
+ return this.api.tabs.open(this.id, options);
49
+ }
50
+ /** Close the browser session. The profile (logins, cookies) survives. */
51
+ close() {
52
+ return this.api.close(this.id);
53
+ }
54
+ }
55
+ export class BrowsersApi {
56
+ http;
57
+ tabs;
58
+ profiles;
59
+ constructor(http) {
60
+ this.http = http;
61
+ this.tabs = new TabsApi(http);
62
+ this.profiles = new ProfilesApi(http);
63
+ }
64
+ /**
65
+ * Open a browser session. No options means a stealth cloud browser
66
+ * (anti-bot, proxies) for the real web; pass computerId for that computer's
67
+ * built-in browser (its own pages: app previews, localhost). Returns a
68
+ * Browser handle bound to the first tab.
69
+ */
70
+ async create(options = {}) {
71
+ const created = await this.http.json('POST', '/browsers', options);
72
+ return new Browser(this, created);
73
+ }
74
+ /** List browser sessions in the API key's space. */
75
+ list(options = {}) {
76
+ return this.http.json('GET', '/browsers', undefined, {
77
+ computer_id: options.computerId,
78
+ });
79
+ }
80
+ /** State of a browser session plus its live_view_url and tabs. */
81
+ get(browserId) {
82
+ return this.http.json('GET', apiPath `/browsers/${browserId}`);
83
+ }
84
+ /** Close the browser session and delete its tabs. The profile survives. */
85
+ close(browserId) {
86
+ return this.http.json('DELETE', apiPath `/browsers/${browserId}`);
87
+ }
88
+ }
@@ -0,0 +1,16 @@
1
+ import { type KazzleHttp } from './http';
2
+ import type { ListResponse, OkResponse, ProfileCreateOptions, ProfileCreateResponse, ProfileRow } from './sdk.types';
3
+ export declare class ProfilesApi {
4
+ private readonly http;
5
+ constructor(http: KazzleHttp);
6
+ /**
7
+ * Ensure the durable profile for a browser backend. No computerId means the
8
+ * space's stealth profile. Idempotent: an existing profile comes back with
9
+ * `created: false`.
10
+ */
11
+ create(options?: ProfileCreateOptions): Promise<ProfileCreateResponse>;
12
+ /** List the browser profiles in the API key's space. */
13
+ list(): Promise<ListResponse<ProfileRow>>;
14
+ /** Delete a profile. Cascades its sessions and tabs; saved logins and cookies are gone. */
15
+ delete(profileId: string): Promise<OkResponse>;
16
+ }
@@ -0,0 +1,26 @@
1
+ // kazzle.browsers.profiles.* — durable browsing identities (/browsers/profiles).
2
+ // Profiles hold logins and cookies; they outlive browser sessions and are
3
+ // shared across them.
4
+ import { apiPath } from './http';
5
+ export class ProfilesApi {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ /**
11
+ * Ensure the durable profile for a browser backend. No computerId means the
12
+ * space's stealth profile. Idempotent: an existing profile comes back with
13
+ * `created: false`.
14
+ */
15
+ create(options = {}) {
16
+ return this.http.json('POST', '/browsers/profiles', options);
17
+ }
18
+ /** List the browser profiles in the API key's space. */
19
+ list() {
20
+ return this.http.json('GET', '/browsers/profiles');
21
+ }
22
+ /** Delete a profile. Cascades its sessions and tabs; saved logins and cookies are gone. */
23
+ delete(profileId) {
24
+ return this.http.json('DELETE', apiPath `/browsers/profiles/${profileId}`);
25
+ }
26
+ }
@@ -0,0 +1,62 @@
1
+ import { type KazzleHttp } from './http';
2
+ import type { ActionResult, ListResponse, TabOpenResponse, TabRow } from './sdk.types';
3
+ type Body = Record<string, unknown>;
4
+ export declare class TabsApi {
5
+ private readonly http;
6
+ constructor(http: KazzleHttp);
7
+ /** List the open tabs of a browser session. */
8
+ list(browserId: string): Promise<ListResponse<TabRow>>;
9
+ /** Open a new tab. The new tab id is the response's tab_id. */
10
+ open(browserId: string, options?: {
11
+ url?: string;
12
+ }): Promise<TabOpenResponse>;
13
+ /** POST one tab action by its URL segment. The named methods below all funnel through this. */
14
+ action(browserId: string, tabId: string, segment: string, body?: Body): Promise<ActionResult>;
15
+ private binary;
16
+ nav(browserId: string, tabId: string, body: {
17
+ url: string;
18
+ }): Promise<ActionResult>;
19
+ back(browserId: string, tabId: string): Promise<ActionResult>;
20
+ forward(browserId: string, tabId: string): Promise<ActionResult>;
21
+ reload(browserId: string, tabId: string): Promise<ActionResult>;
22
+ /** Returns PNG (or JPEG) bytes. */
23
+ screenshot(browserId: string, tabId: string, body?: Body): Promise<Uint8Array>;
24
+ /** Returns PDF bytes. */
25
+ pdf(browserId: string, tabId: string, body?: Body): Promise<Uint8Array>;
26
+ /** Accessibility snapshot. Element refs from it target later click/type calls. */
27
+ snapshot(browserId: string, tabId: string, body?: Body): Promise<ActionResult>;
28
+ eval(browserId: string, tabId: string, body: {
29
+ function: string;
30
+ arguments?: unknown[];
31
+ timeoutSeconds?: number;
32
+ }): Promise<ActionResult>;
33
+ click(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
34
+ type(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
35
+ select(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
36
+ fillForm(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
37
+ check(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
38
+ uncheck(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
39
+ hover(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
40
+ drag(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
41
+ upload(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
42
+ dialog(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
43
+ key(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
44
+ scroll(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
45
+ content(browserId: string, tabId: string, body?: Body): Promise<ActionResult>;
46
+ dom(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
47
+ extract(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
48
+ find(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
49
+ options(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
50
+ console(browserId: string, tabId: string, body?: Body): Promise<ActionResult>;
51
+ network(browserId: string, tabId: string, body?: Body): Promise<ActionResult>;
52
+ wait(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
53
+ status(browserId: string, tabId: string, body?: Body): Promise<ActionResult>;
54
+ download(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
55
+ /** Live view URL for the tab. */
56
+ live(browserId: string, tabId: string, body?: Body): Promise<ActionResult>;
57
+ focus(browserId: string, tabId: string): Promise<ActionResult>;
58
+ move(browserId: string, tabId: string, body: Body): Promise<ActionResult>;
59
+ /** Close the tab (DELETE /browsers/{id}/tabs/{tid}; POST .../close does the same). */
60
+ close(browserId: string, tabId: string): Promise<ActionResult>;
61
+ }
62
+ export {};
@@ -0,0 +1,132 @@
1
+ // kazzle.browsers.tabs.* — tab-scoped browser actions
2
+ // (/browsers/{id}/tabs/{tid}/{action}). Each method maps to exactly one
3
+ // endpoint; action() is the generic escape hatch for the same set.
4
+ import { apiPath } from './http';
5
+ export class TabsApi {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ /** List the open tabs of a browser session. */
11
+ list(browserId) {
12
+ return this.http.json('GET', apiPath `/browsers/${browserId}/tabs`);
13
+ }
14
+ /** Open a new tab. The new tab id is the response's tab_id. */
15
+ open(browserId, options = {}) {
16
+ return this.http.json('POST', apiPath `/browsers/${browserId}/tabs`, options);
17
+ }
18
+ /** POST one tab action by its URL segment. The named methods below all funnel through this. */
19
+ action(browserId, tabId, segment, body = {}) {
20
+ return this.http.json('POST', `${apiPath `/browsers/${browserId}/tabs/${tabId}/`}${segment}`, body);
21
+ }
22
+ binary(browserId, tabId, segment, body) {
23
+ return this.http.binary(`${apiPath `/browsers/${browserId}/tabs/${tabId}/`}${segment}`, body);
24
+ }
25
+ nav(browserId, tabId, body) {
26
+ return this.action(browserId, tabId, 'nav', body);
27
+ }
28
+ back(browserId, tabId) {
29
+ return this.action(browserId, tabId, 'back');
30
+ }
31
+ forward(browserId, tabId) {
32
+ return this.action(browserId, tabId, 'forward');
33
+ }
34
+ reload(browserId, tabId) {
35
+ return this.action(browserId, tabId, 'reload');
36
+ }
37
+ /** Returns PNG (or JPEG) bytes. */
38
+ screenshot(browserId, tabId, body = {}) {
39
+ return this.binary(browserId, tabId, 'screenshot', body);
40
+ }
41
+ /** Returns PDF bytes. */
42
+ pdf(browserId, tabId, body = {}) {
43
+ return this.binary(browserId, tabId, 'pdf', body);
44
+ }
45
+ /** Accessibility snapshot. Element refs from it target later click/type calls. */
46
+ snapshot(browserId, tabId, body = {}) {
47
+ return this.action(browserId, tabId, 'snapshot', body);
48
+ }
49
+ eval(browserId, tabId, body) {
50
+ return this.action(browserId, tabId, 'eval', body);
51
+ }
52
+ click(browserId, tabId, body) {
53
+ return this.action(browserId, tabId, 'click', body);
54
+ }
55
+ type(browserId, tabId, body) {
56
+ return this.action(browserId, tabId, 'type', body);
57
+ }
58
+ select(browserId, tabId, body) {
59
+ return this.action(browserId, tabId, 'select', body);
60
+ }
61
+ fillForm(browserId, tabId, body) {
62
+ return this.action(browserId, tabId, 'fill_form', body);
63
+ }
64
+ check(browserId, tabId, body) {
65
+ return this.action(browserId, tabId, 'check', body);
66
+ }
67
+ uncheck(browserId, tabId, body) {
68
+ return this.action(browserId, tabId, 'uncheck', body);
69
+ }
70
+ hover(browserId, tabId, body) {
71
+ return this.action(browserId, tabId, 'hover', body);
72
+ }
73
+ drag(browserId, tabId, body) {
74
+ return this.action(browserId, tabId, 'drag', body);
75
+ }
76
+ upload(browserId, tabId, body) {
77
+ return this.action(browserId, tabId, 'upload', body);
78
+ }
79
+ dialog(browserId, tabId, body) {
80
+ return this.action(browserId, tabId, 'dialog', body);
81
+ }
82
+ key(browserId, tabId, body) {
83
+ return this.action(browserId, tabId, 'key', body);
84
+ }
85
+ scroll(browserId, tabId, body) {
86
+ return this.action(browserId, tabId, 'scroll', body);
87
+ }
88
+ content(browserId, tabId, body = {}) {
89
+ return this.action(browserId, tabId, 'content', body);
90
+ }
91
+ dom(browserId, tabId, body) {
92
+ return this.action(browserId, tabId, 'dom', body);
93
+ }
94
+ extract(browserId, tabId, body) {
95
+ return this.action(browserId, tabId, 'extract', body);
96
+ }
97
+ find(browserId, tabId, body) {
98
+ return this.action(browserId, tabId, 'find', body);
99
+ }
100
+ options(browserId, tabId, body) {
101
+ return this.action(browserId, tabId, 'options', body);
102
+ }
103
+ console(browserId, tabId, body = {}) {
104
+ return this.action(browserId, tabId, 'console', body);
105
+ }
106
+ network(browserId, tabId, body = {}) {
107
+ return this.action(browserId, tabId, 'network', body);
108
+ }
109
+ wait(browserId, tabId, body) {
110
+ return this.action(browserId, tabId, 'wait', body);
111
+ }
112
+ status(browserId, tabId, body = {}) {
113
+ return this.action(browserId, tabId, 'status', body);
114
+ }
115
+ download(browserId, tabId, body) {
116
+ return this.action(browserId, tabId, 'download', body);
117
+ }
118
+ /** Live view URL for the tab. */
119
+ live(browserId, tabId, body = {}) {
120
+ return this.action(browserId, tabId, 'live', body);
121
+ }
122
+ focus(browserId, tabId) {
123
+ return this.action(browserId, tabId, 'focus');
124
+ }
125
+ move(browserId, tabId, body) {
126
+ return this.action(browserId, tabId, 'move', body);
127
+ }
128
+ /** Close the tab (DELETE /browsers/{id}/tabs/{tid}; POST .../close does the same). */
129
+ close(browserId, tabId) {
130
+ return this.http.json('DELETE', apiPath `/browsers/${browserId}/tabs/${tabId}`);
131
+ }
132
+ }
@@ -0,0 +1,35 @@
1
+ import { type KazzleHttp } from './http';
2
+ import { ExecStream } from './sse';
3
+ import { FsApi } from './computers.fs';
4
+ import { TerminalsApi } from './computers.terminals';
5
+ import { DesktopApi } from './computers.desktop';
6
+ import type { ComputerCreateResponse, ComputerRow, ExecOptions, ListResponse, OkResponse } from './sdk.types';
7
+ export declare class ComputersApi {
8
+ private readonly http;
9
+ readonly fs: FsApi;
10
+ readonly terminals: TerminalsApi;
11
+ readonly desktop: DesktopApi;
12
+ constructor(http: KazzleHttp);
13
+ /** Create a cloud computer. It boots with a persistent disk; state is "offline" until it comes up. */
14
+ create(): Promise<ComputerCreateResponse>;
15
+ /** List the computers in the API key's space. */
16
+ list(): Promise<ListResponse<ComputerRow>>;
17
+ get(computerId: string): Promise<ComputerRow>;
18
+ /** Resume a suspended computer from its snapshot. Wakes take seconds; the disk is preserved. */
19
+ wake(computerId: string): Promise<OkResponse & {
20
+ id: string;
21
+ }>;
22
+ /** Suspend the computer. The disk is kept; wake it later to resume. */
23
+ stop(computerId: string): Promise<OkResponse>;
24
+ /** Re-provision a computer whose sandbox is missing or wedged. The persistent volume is reattached. */
25
+ repair(computerId: string): Promise<OkResponse>;
26
+ /** Destroy the computer and delete its disk. Permanent; use stop() to keep the files. */
27
+ destroy(computerId: string): Promise<OkResponse>;
28
+ /**
29
+ * Run one command and stream the result. Returns an ExecStream: iterate the
30
+ * SSE events (`stdout`/`error`/`exit`), or call `.text()` for the joined
31
+ * stdout and exit code. stderr is merged into stdout (PTY). For long-running
32
+ * processes use terminals instead.
33
+ */
34
+ exec(computerId: string, options: ExecOptions): ExecStream;
35
+ }
@@ -0,0 +1,152 @@
1
+ import { type KazzleHttp } from './http';
2
+ import type { ActionResult, ListResponse } from './sdk.types';
3
+ declare class DesktopSessionsApi {
4
+ private readonly http;
5
+ constructor(http: KazzleHttp);
6
+ /** Create a live desktop session (virtual display) for input actions. */
7
+ create(computerId: string, options?: {
8
+ name?: string;
9
+ resolution?: string;
10
+ }): Promise<ActionResult>;
11
+ list(computerId: string): Promise<ListResponse<Record<string, unknown>> & ActionResult>;
12
+ close(computerId: string, sessionId: string): Promise<ActionResult>;
13
+ }
14
+ /** Mouse and keyboard input inside a live session. Every body carries the sessionId. */
15
+ declare class DesktopInputApi {
16
+ private readonly http;
17
+ constructor(http: KazzleHttp);
18
+ private post;
19
+ click(computerId: string, body: {
20
+ sessionId: string;
21
+ x: number;
22
+ y: number;
23
+ button?: string;
24
+ }): Promise<ActionResult>;
25
+ doubleClick(computerId: string, body: {
26
+ sessionId: string;
27
+ x: number;
28
+ y: number;
29
+ }): Promise<ActionResult>;
30
+ mouseDown(computerId: string, body: {
31
+ sessionId: string;
32
+ x: number;
33
+ y: number;
34
+ button?: string;
35
+ }): Promise<ActionResult>;
36
+ mouseUp(computerId: string, body: {
37
+ sessionId: string;
38
+ x: number;
39
+ y: number;
40
+ button?: string;
41
+ }): Promise<ActionResult>;
42
+ move(computerId: string, body: {
43
+ sessionId: string;
44
+ x: number;
45
+ y: number;
46
+ }): Promise<ActionResult>;
47
+ drag(computerId: string, body: {
48
+ sessionId: string;
49
+ x: number;
50
+ y: number;
51
+ toX: number;
52
+ toY: number;
53
+ }): Promise<ActionResult>;
54
+ scroll(computerId: string, body: {
55
+ sessionId: string;
56
+ deltaX?: number;
57
+ deltaY?: number;
58
+ x?: number;
59
+ y?: number;
60
+ }): Promise<ActionResult>;
61
+ type(computerId: string, body: {
62
+ sessionId: string;
63
+ text: string;
64
+ }): Promise<ActionResult>;
65
+ /** Press a key combo, e.g. "ctrl+c". */
66
+ key(computerId: string, body: {
67
+ sessionId: string;
68
+ key: string;
69
+ }): Promise<ActionResult>;
70
+ }
71
+ /** Structured control of applications (attach, inspect the UI tree, press elements). */
72
+ declare class DesktopAppsApi {
73
+ private readonly http;
74
+ constructor(http: KazzleHttp);
75
+ private post;
76
+ /** List the applications available on the computer with their bundle ids. */
77
+ list(computerId: string): Promise<ActionResult>;
78
+ /** Start (attach to) an application. The result row carries controlled_app_session_id. */
79
+ start(computerId: string, body: {
80
+ bundleId: string;
81
+ windowTitle?: string;
82
+ physicalInput?: boolean;
83
+ }): Promise<ActionResult>;
84
+ stop(computerId: string, body: {
85
+ controlledAppSessionId: string;
86
+ }): Promise<ActionResult>;
87
+ status(computerId: string, body: {
88
+ controlledAppSessionId: string;
89
+ }): Promise<ActionResult>;
90
+ /** Accessibility-tree inspection of the controlled application. */
91
+ inspect(computerId: string, body: {
92
+ controlledAppSessionId: string;
93
+ depth?: number;
94
+ }): Promise<ActionResult>;
95
+ press(computerId: string, body: {
96
+ controlledAppSessionId: string;
97
+ elementPath: string;
98
+ }): Promise<ActionResult>;
99
+ setValue(computerId: string, body: {
100
+ controlledAppSessionId: string;
101
+ elementPath: string;
102
+ value: string;
103
+ }): Promise<ActionResult>;
104
+ /** Screenshot the controlled application's window. Returns PNG bytes. */
105
+ capture(computerId: string, body: {
106
+ controlledAppSessionId: string;
107
+ }): Promise<Uint8Array>;
108
+ }
109
+ declare class DesktopWindowsApi {
110
+ private readonly http;
111
+ constructor(http: KazzleHttp);
112
+ /** The active window in a live session. */
113
+ active(computerId: string, body: {
114
+ sessionId: string;
115
+ }): Promise<ActionResult>;
116
+ /** Raise a window of a controlled application. */
117
+ raise(computerId: string, body: {
118
+ controlledAppSessionId: string;
119
+ windowPath: string;
120
+ }): Promise<ActionResult>;
121
+ /** Move/resize a window inside a live session. */
122
+ place(computerId: string, body: {
123
+ sessionId: string;
124
+ x: number;
125
+ y: number;
126
+ width: number;
127
+ height: number;
128
+ controlledAppSessionId?: string;
129
+ windowPath?: string;
130
+ }): Promise<ActionResult>;
131
+ }
132
+ export declare class DesktopApi {
133
+ private readonly http;
134
+ readonly sessions: DesktopSessionsApi;
135
+ readonly input: DesktopInputApi;
136
+ readonly apps: DesktopAppsApi;
137
+ readonly windows: DesktopWindowsApi;
138
+ constructor(http: KazzleHttp);
139
+ /** Screenshot a display. Omit displayId for the primary display. Returns PNG bytes. */
140
+ capture(computerId: string, options?: {
141
+ displayId?: string;
142
+ }): Promise<Uint8Array>;
143
+ /** List the computer's displays with ids for capture(). */
144
+ displays(computerId: string): Promise<ActionResult>;
145
+ /** Check screen-recording / input permissions on the computer. */
146
+ permissions(computerId: string): Promise<ActionResult>;
147
+ /** Screen geometry for a live session. */
148
+ screen(computerId: string, body: {
149
+ sessionId: string;
150
+ }): Promise<ActionResult>;
151
+ }
152
+ export {};