@jetpack-desktop/client 0.0.0-stage → 0.1.2-beta.2

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.
@@ -0,0 +1,293 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * High-level WebAssembly client for interacting with the JetPack daemon.
6
+ */
7
+ export class JetPackWasmClient {
8
+ private constructor();
9
+ free(): void;
10
+ [Symbol.dispose](): void;
11
+ /**
12
+ * Triggers a daemon self-update from the embedded Control Center, streaming
13
+ * `UpdateProgressFrame` events into `on_progress_callback` and resolving on
14
+ * `UpdateRestartingResponse` right before the daemon swaps binaries and restarts.
15
+ */
16
+ apply_update(on_progress_callback?: Function | null, expected_version?: string | null): Promise<any>;
17
+ /**
18
+ * Queries the daemon for the latest available release (`UpdateStatusResponse`).
19
+ */
20
+ check_for_updates(): Promise<any>;
21
+ /**
22
+ * Clears application-private cache/settings and resets saved folder bindings without
23
+ * deleting user files inside mounted host directories (`"app.cache.clear"`).
24
+ */
25
+ clear_app_cache(app_id: string): Promise<any>;
26
+ /**
27
+ * Closes the client WebSocket connection and cleans up session state.
28
+ */
29
+ close(): void;
30
+ /**
31
+ * Connects to `ws://127.0.0.1:<port>` and automatically executes the cryptographic handshake.
32
+ *
33
+ * Resolves when the session is established and authenticated.
34
+ */
35
+ static connect(ws_url: string, identity: WasmClientIdentity, origin?: string | null): Promise<any>;
36
+ /**
37
+ * Exports a privacy-sanitized `.zip` diagnostic bundle from the daemon
38
+ * (`{ filename, generated_at_unix, log_tail_bytes, log_truncated, redactions_applied, zip_bytes }`).
39
+ */
40
+ export_diagnostics(): Promise<any>;
41
+ /**
42
+ * Retrieves verified App Store catalog entries (`CatalogAppEntry[]`).
43
+ */
44
+ get_catalog(): Promise<any>;
45
+ /**
46
+ * Retrieves the host hardware and accelerator topology (`HardwareProfile`).
47
+ */
48
+ get_hardware_profile(): Promise<any>;
49
+ /**
50
+ * Fetches persisted daemon security settings (`DaemonSettings`).
51
+ */
52
+ get_settings(): Promise<any>;
53
+ /**
54
+ * Indicates whether the client is in the established authenticated state.
55
+ */
56
+ is_connected(): boolean;
57
+ /**
58
+ * Boots an installed application inside an OS kernel sandbox, streaming optional
59
+ * `app.launch.progress` provisioning/startup events to `on_progress_callback`.
60
+ */
61
+ launch_app(app_id: string, reset_volumes?: boolean | null, on_progress_callback?: Function | null): Promise<any>;
62
+ /**
63
+ * Lists installed applications and their runtime statuses (`AppInfo[]`).
64
+ */
65
+ list_apps(): Promise<any>;
66
+ /**
67
+ * Lists paired browser/origin clients stored in the daemon (`PairedClientSummary[]`).
68
+ */
69
+ list_paired_clients(): Promise<any>;
70
+ /**
71
+ * Registers a callback for incoming worker or unsolicited streaming events.
72
+ *
73
+ * Invokes `callback(opcode, payload, correlationId)`. Existing 2-argument
74
+ * callbacks `(opcode, payload)` remain fully backwards compatible.
75
+ */
76
+ on_worker_frame(callback: Function): void;
77
+ /**
78
+ * Registers a callback invoked when the daemon emits `"app.worker.stopped"`
79
+ * (`{ app_id, job_id, reason }`), e.g. on idle timeout, manual Stop, or worker crash.
80
+ */
81
+ on_worker_stopped(callback: Function): void;
82
+ /**
83
+ * Requests `jetpack-daemon` to open an authorized loopback URL honoring `open_in_app_window`.
84
+ */
85
+ open_url(url: string): Promise<any>;
86
+ /**
87
+ * Opens the daemon's native OS folder picker on the main thread and persists `appdata_dir`.
88
+ */
89
+ pick_appdata_dir(): Promise<any>;
90
+ /**
91
+ * Downloads and provisions a verified OCI application artifact, streaming progress notifications.
92
+ */
93
+ pull_app(image_ref: string, on_progress_callback?: Function | null, app_id?: string | null): Promise<any>;
94
+ /**
95
+ * Sends a correlated zero-copy binary hybrid frame to `target_worker` and awaits
96
+ * the matching response frame (`{ opcode, payload, correlationId }`).
97
+ *
98
+ * Rejects if the daemon/worker responds with `app.error` or `system.error`,
99
+ * or if the WebSocket closes before a response arrives.
100
+ */
101
+ request_worker_frame(target_worker: string, opcode: string, meta_js: any, raw_payload: Uint8Array): Promise<any>;
102
+ /**
103
+ * Resets persisted authorized host volumes for an application via `"app.volumes.reset"`.
104
+ */
105
+ reset_app_volumes(app_id: string, volume_name?: string | null): Promise<any>;
106
+ /**
107
+ * Resets the persisted `appdata_dir` setting back to the default `<root>/appdata` folder.
108
+ */
109
+ reset_appdata_dir(): Promise<any>;
110
+ /**
111
+ * Revokes access for a paired client UUID and/or origin and severs active sessions.
112
+ */
113
+ revoke_client(client_id?: string | null, origin?: string | null): Promise<any>;
114
+ /**
115
+ * Requests the daemon to transmit a sanitized diagnostic report JSON to its configured
116
+ * `[diagnostics] report_url` HTTP endpoint (`DiagnosticsSendOkResponse`).
117
+ */
118
+ send_diagnostics(): Promise<any>;
119
+ /**
120
+ * Dispatches a zero-copy binary hybrid frame directly to a target worker service.
121
+ */
122
+ send_worker_frame(target_worker: string, opcode: string, meta_js: any, raw_payload: Uint8Array): Promise<any>;
123
+ /**
124
+ * Updates and persists the daemon's Developer Mode (`Allow Unverified Apps`) setting.
125
+ */
126
+ set_developer_mode(enabled: boolean): Promise<any>;
127
+ /**
128
+ * Updates and persists whether interactive `jetpack-daemon` launches automatically open Control Center.
129
+ */
130
+ set_open_dashboard_on_startup(enabled: boolean): Promise<any>;
131
+ /**
132
+ * Updates and persists whether Control Center and standalone apps open in standalone Chromium `--app=` windows.
133
+ */
134
+ set_open_in_app_window(enabled: boolean): Promise<any>;
135
+ /**
136
+ * Subscribes to live sanitized daemon and worker log entries (`logs.entry`) when Developer Mode is active.
137
+ *
138
+ * Resolves with `{ buffered_count }` on success and clears the listener automatically if
139
+ * the daemon rejects the subscription (for example with `[DEV_MODE_REQUIRED]`).
140
+ */
141
+ subscribe_logs(on_entry_callback: Function): Promise<any>;
142
+ /**
143
+ * Terminates an active worker job by application ID or job UUID.
144
+ */
145
+ terminate_app(app_id_or_job_id: string): Promise<any>;
146
+ /**
147
+ * Uninstalls an application bundle (and optionally clears its app-private cache) without
148
+ * deleting user files inside mounted host directories (`"app.uninstall"`).
149
+ */
150
+ uninstall_app(app_id: string, remove_cache: boolean): Promise<any>;
151
+ /**
152
+ * Unsubscribes from live log streaming (`logs.unsubscribe`) and clears the active log listener.
153
+ */
154
+ unsubscribe_logs(): Promise<any>;
155
+ }
156
+
157
+ /**
158
+ * Client cryptographic identity managing asymmetric keys and browser persistence.
159
+ */
160
+ export class WasmClientIdentity {
161
+ free(): void;
162
+ [Symbol.dispose](): void;
163
+ /**
164
+ * Clears any persisted identity from browser `localStorage`.
165
+ */
166
+ static clear_storage(): boolean;
167
+ /**
168
+ * Returns the 32-byte `Ed25519` public key as a hex string.
169
+ */
170
+ ed25519_pubkey_hex(): string;
171
+ /**
172
+ * Generates an ephemeral in-memory client identity without reading/writing storage.
173
+ */
174
+ static generate_new_ephemeral(): WasmClientIdentity;
175
+ /**
176
+ * Formats an Out-of-Band pairing deep link: `jetpack://pair?client_id=<uuid>&pubkey=<b64>&origin=<origin>`.
177
+ *
178
+ * Validates and normalizes the web origin parameter.
179
+ */
180
+ generate_pairing_uri(origin: string): string;
181
+ /**
182
+ * Loads client identity from browser `localStorage` or generates a new one.
183
+ *
184
+ * If `localStorage` is accessible and contains valid keys, the stored identity
185
+ * is restored. Otherwise, a new cryptographic keypair and UUID are created and
186
+ * persisted. If storage is unavailable, an ephemeral in-memory identity is used.
187
+ */
188
+ constructor();
189
+ /**
190
+ * Returns the URL-safe base64 encoded 64-byte public key bundle (`Ed25519` + `X25519`).
191
+ */
192
+ public_key_bundle_base64(): string;
193
+ /**
194
+ * Returns the 32-byte `X25519` public key as a hex string.
195
+ */
196
+ x25519_pubkey_hex(): string;
197
+ /**
198
+ * Returns the client UUID as a string.
199
+ */
200
+ readonly client_id: string;
201
+ /**
202
+ * Indicates whether this identity is persisted in browser `localStorage`.
203
+ */
204
+ readonly is_stored_in_local_storage: boolean;
205
+ }
206
+
207
+ export function jetpack_version(): string;
208
+
209
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
210
+
211
+ export interface InitOutput {
212
+ readonly memory: WebAssembly.Memory;
213
+ readonly __wbg_jetpackwasmclient_free: (a: number, b: number) => void;
214
+ readonly __wbg_wasmclientidentity_free: (a: number, b: number) => void;
215
+ readonly jetpack_version: () => [number, number];
216
+ readonly jetpackwasmclient_apply_update: (a: number, b: number, c: number, d: number) => any;
217
+ readonly jetpackwasmclient_check_for_updates: (a: number) => any;
218
+ readonly jetpackwasmclient_clear_app_cache: (a: number, b: number, c: number) => any;
219
+ readonly jetpackwasmclient_close: (a: number) => void;
220
+ readonly jetpackwasmclient_connect: (a: number, b: number, c: number, d: number, e: number) => any;
221
+ readonly jetpackwasmclient_export_diagnostics: (a: number) => any;
222
+ readonly jetpackwasmclient_get_catalog: (a: number) => any;
223
+ readonly jetpackwasmclient_get_hardware_profile: (a: number) => any;
224
+ readonly jetpackwasmclient_get_settings: (a: number) => any;
225
+ readonly jetpackwasmclient_is_connected: (a: number) => number;
226
+ readonly jetpackwasmclient_launch_app: (a: number, b: number, c: number, d: number, e: number) => any;
227
+ readonly jetpackwasmclient_list_apps: (a: number) => any;
228
+ readonly jetpackwasmclient_list_paired_clients: (a: number) => any;
229
+ readonly jetpackwasmclient_on_worker_frame: (a: number, b: any) => void;
230
+ readonly jetpackwasmclient_on_worker_stopped: (a: number, b: any) => void;
231
+ readonly jetpackwasmclient_open_url: (a: number, b: number, c: number) => any;
232
+ readonly jetpackwasmclient_pick_appdata_dir: (a: number) => any;
233
+ readonly jetpackwasmclient_pull_app: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
234
+ readonly jetpackwasmclient_request_worker_frame: (a: number, b: number, c: number, d: number, e: number, f: any, g: any) => any;
235
+ readonly jetpackwasmclient_reset_app_volumes: (a: number, b: number, c: number, d: number, e: number) => any;
236
+ readonly jetpackwasmclient_reset_appdata_dir: (a: number) => any;
237
+ readonly jetpackwasmclient_revoke_client: (a: number, b: number, c: number, d: number, e: number) => any;
238
+ readonly jetpackwasmclient_send_diagnostics: (a: number) => any;
239
+ readonly jetpackwasmclient_send_worker_frame: (a: number, b: number, c: number, d: number, e: number, f: any, g: any) => any;
240
+ readonly jetpackwasmclient_set_developer_mode: (a: number, b: number) => any;
241
+ readonly jetpackwasmclient_set_open_dashboard_on_startup: (a: number, b: number) => any;
242
+ readonly jetpackwasmclient_set_open_in_app_window: (a: number, b: number) => any;
243
+ readonly jetpackwasmclient_subscribe_logs: (a: number, b: any) => any;
244
+ readonly jetpackwasmclient_terminate_app: (a: number, b: number, c: number) => any;
245
+ readonly jetpackwasmclient_uninstall_app: (a: number, b: number, c: number, d: number) => any;
246
+ readonly jetpackwasmclient_unsubscribe_logs: (a: number) => any;
247
+ readonly wasmclientidentity_clear_storage: () => [number, number, number];
248
+ readonly wasmclientidentity_client_id: (a: number) => [number, number];
249
+ readonly wasmclientidentity_ed25519_pubkey_hex: (a: number) => [number, number];
250
+ readonly wasmclientidentity_generate_new_ephemeral: () => [number, number, number];
251
+ readonly wasmclientidentity_generate_pairing_uri: (a: number, b: number, c: number) => [number, number, number, number];
252
+ readonly wasmclientidentity_is_stored_in_local_storage: (a: number) => number;
253
+ readonly wasmclientidentity_load_or_generate: () => [number, number, number];
254
+ readonly wasmclientidentity_public_key_bundle_base64: (a: number) => [number, number];
255
+ readonly wasmclientidentity_x25519_pubkey_hex: (a: number) => [number, number];
256
+ readonly wasm_bindgen_72b45424988d9356___convert__closures_____invoke___js_sys_655e32931afb3f20___Function_fn_wasm_bindgen_72b45424988d9356___JsValue_____wasm_bindgen_72b45424988d9356___sys__Undefined___js_sys_655e32931afb3f20___Function_fn_wasm_bindgen_72b45424988d9356___JsValue_____wasm_bindgen_72b45424988d9356___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
257
+ readonly wasm_bindgen_72b45424988d9356___convert__closures_____invoke___wasm_bindgen_72b45424988d9356___JsValue__core_d941ad8722425d2e___result__Result_____wasm_bindgen_72b45424988d9356___JsError___true_: (a: number, b: number, c: any) => [number, number];
258
+ readonly wasm_bindgen_72b45424988d9356___convert__closures_____invoke___web_sys_56acb6796a272af6___features__gen_CloseEvent__CloseEvent______true_: (a: number, b: number, c: any) => void;
259
+ readonly wasm_bindgen_72b45424988d9356___convert__closures_____invoke___web_sys_56acb6796a272af6___features__gen_CloseEvent__CloseEvent______true__44: (a: number, b: number, c: any) => void;
260
+ readonly wasm_bindgen_72b45424988d9356___convert__closures_____invoke___web_sys_56acb6796a272af6___features__gen_CloseEvent__CloseEvent______true__45: (a: number, b: number, c: any) => void;
261
+ readonly wasm_bindgen_72b45424988d9356___convert__closures_____invoke_______true_: (a: number, b: number) => void;
262
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
263
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
264
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
265
+ readonly __wbindgen_exn_store: (a: number) => void;
266
+ readonly __externref_table_alloc: () => number;
267
+ readonly __wbindgen_externrefs: WebAssembly.Table;
268
+ readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
269
+ readonly __externref_table_dealloc: (a: number) => void;
270
+ readonly __wbindgen_start: () => void;
271
+ }
272
+
273
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
274
+
275
+ /**
276
+ * Instantiates the given `module`, which can either be bytes or
277
+ * a precompiled `WebAssembly.Module`.
278
+ *
279
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
280
+ *
281
+ * @returns {InitOutput}
282
+ */
283
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
284
+
285
+ /**
286
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
287
+ * for everything else, calls `WebAssembly.instantiate` directly.
288
+ *
289
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
290
+ *
291
+ * @returns {Promise<InitOutput>}
292
+ */
293
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;