@limrun/api 0.80.1 → 0.82.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.
- package/CHANGELOG.md +42 -0
- package/README.md +29 -0
- package/gradle-snapshot.d.mts +34 -0
- package/gradle-snapshot.d.mts.map +1 -1
- package/gradle-snapshot.d.ts +34 -0
- package/gradle-snapshot.d.ts.map +1 -1
- package/gradle-snapshot.js +14 -1
- package/gradle-snapshot.js.map +1 -1
- package/gradle-snapshot.mjs +12 -0
- package/gradle-snapshot.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/instance-client.d.mts +13 -0
- package/instance-client.d.mts.map +1 -1
- package/instance-client.d.ts +13 -0
- package/instance-client.d.ts.map +1 -1
- package/instance-client.js +11 -0
- package/instance-client.js.map +1 -1
- package/instance-client.mjs +12 -1
- package/instance-client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/android-instances-helpers.d.mts +4 -0
- package/resources/android-instances-helpers.d.mts.map +1 -1
- package/resources/android-instances-helpers.d.ts +4 -0
- package/resources/android-instances-helpers.d.ts.map +1 -1
- package/resources/android-instances-helpers.js +6 -0
- package/resources/android-instances-helpers.js.map +1 -1
- package/resources/android-instances-helpers.mjs +6 -0
- package/resources/android-instances-helpers.mjs.map +1 -1
- package/resources/assets.d.mts +5 -5
- package/resources/assets.d.mts.map +1 -1
- package/resources/assets.d.ts +5 -5
- package/resources/assets.d.ts.map +1 -1
- package/resources/gradle-instances-helpers.d.mts +10 -0
- package/resources/gradle-instances-helpers.d.mts.map +1 -1
- package/resources/gradle-instances-helpers.d.ts +10 -0
- package/resources/gradle-instances-helpers.d.ts.map +1 -1
- package/resources/gradle-instances-helpers.js +56 -0
- package/resources/gradle-instances-helpers.js.map +1 -1
- package/resources/gradle-instances-helpers.mjs +56 -0
- package/resources/gradle-instances-helpers.mjs.map +1 -1
- package/resources/ios-instances.d.mts +62 -0
- package/resources/ios-instances.d.mts.map +1 -1
- package/resources/ios-instances.d.ts +62 -0
- package/resources/ios-instances.d.ts.map +1 -1
- package/resources/macos-instances.d.mts +22 -0
- package/resources/macos-instances.d.mts.map +1 -1
- package/resources/macos-instances.d.ts +22 -0
- package/resources/macos-instances.d.ts.map +1 -1
- package/resources/session-artifacts.d.mts +6 -6
- package/resources/session-artifacts.d.ts +6 -6
- package/src/gradle-snapshot.ts +40 -0
- package/src/index.ts +3 -0
- package/src/instance-client.ts +46 -2
- package/src/resources/android-instances-helpers.ts +7 -0
- package/src/resources/assets.ts +5 -5
- package/src/resources/gradle-instances-helpers.ts +84 -0
- package/src/resources/ios-instances.ts +75 -0
- package/src/resources/macos-instances.ts +23 -0
- package/src/resources/session-artifacts.ts +6 -6
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -164,6 +164,15 @@ export declare namespace MacosInstanceCreateParams {
|
|
|
164
164
|
* either clue, routing uses Cloudflare visitor coordinates, then its client IP.
|
|
165
165
|
*/
|
|
166
166
|
clues?: Array<Spec.Clue>;
|
|
167
|
+
/**
|
|
168
|
+
* HTTP headers the instance adds to its own requests to the named domains, next to
|
|
169
|
+
* `Limrun-Instance-Id`, with no tunnel. The guest's network answers those names
|
|
170
|
+
* itself and decrypts their HTTPS with a certificate authority the guest trusts, so
|
|
171
|
+
* an app that pins certificates or ships its own trust store cannot reach them. A
|
|
172
|
+
* tunnel's domain takes precedence: a request both cover gets the tunnel's headers.
|
|
173
|
+
* The headers apply before the instance becomes ready.
|
|
174
|
+
*/
|
|
175
|
+
egressHeaders?: Spec.EgressHeaders;
|
|
167
176
|
/**
|
|
168
177
|
* Maximum runtime regardless of activity. Omit to use the organization's macOS
|
|
169
178
|
* default. Set to "0" to disable the hard timeout.
|
|
@@ -207,6 +216,19 @@ export declare namespace MacosInstanceCreateParams {
|
|
|
207
216
|
};
|
|
208
217
|
}
|
|
209
218
|
namespace Spec {
|
|
219
|
+
interface EgressHeaders {
|
|
220
|
+
/**
|
|
221
|
+
* One to 64 exact names such as `api.example.com`, or wildcards such as
|
|
222
|
+
* `*.example.com` that cover every subdomain but not the name itself.
|
|
223
|
+
*/
|
|
224
|
+
domains: Array<string>;
|
|
225
|
+
/**
|
|
226
|
+
* One to 16 HTTP headers, by name, to add to those requests.
|
|
227
|
+
*/
|
|
228
|
+
headers: {
|
|
229
|
+
[name: string]: string;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
210
232
|
interface Clue {
|
|
211
233
|
kind: 'ClientIP' | 'ClientLocation';
|
|
212
234
|
clientIp?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macos-instances.d.ts","sourceRoot":"","sources":["../src/resources/macos-instances.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,WAAW,EAAE,8BAA2B;AAE1E,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,yEAAyE;AACzE,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAK9F;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,uBAAuB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC;IAIlD;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAO9D,+FAA+F;IAC/F,MAAM,CAAC,E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;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -79,12 +79,12 @@ export interface PerformanceThread {
|
|
|
79
79
|
/**
|
|
80
80
|
* One running app's resource use at one moment, the figures Xcode's debug
|
|
81
81
|
* gauges show. iOS and Android instances sample every running app you
|
|
82
|
-
* installed once a second, delivered live by `streamPerformance
|
|
83
|
-
*
|
|
84
|
-
* since the previous sample of the same process, so a
|
|
85
|
-
* has none. On Android only an app's main process is
|
|
86
|
-
* its anonymous and shared memory in RAM plus swap,
|
|
87
|
-
*
|
|
82
|
+
* installed once a second, delivered live by `streamPerformance` and stored
|
|
83
|
+
* one-per-line in `performance` artifacts by a performance capture. Rates
|
|
84
|
+
* cover the second since the previous sample of the same process, so a
|
|
85
|
+
* process's first sample has none. On Android only an app's main process is
|
|
86
|
+
* sampled, the footprint is its anonymous and shared memory in RAM plus swap,
|
|
87
|
+
* and the peak is the highest sampled footprint.
|
|
88
88
|
*/
|
|
89
89
|
export interface PerformanceSample {
|
|
90
90
|
/** Epoch milliseconds, same clock as SessionLogLine. */
|
|
@@ -79,12 +79,12 @@ export interface PerformanceThread {
|
|
|
79
79
|
/**
|
|
80
80
|
* One running app's resource use at one moment, the figures Xcode's debug
|
|
81
81
|
* gauges show. iOS and Android instances sample every running app you
|
|
82
|
-
* installed once a second, delivered live by `streamPerformance
|
|
83
|
-
*
|
|
84
|
-
* since the previous sample of the same process, so a
|
|
85
|
-
* has none. On Android only an app's main process is
|
|
86
|
-
* its anonymous and shared memory in RAM plus swap,
|
|
87
|
-
*
|
|
82
|
+
* installed once a second, delivered live by `streamPerformance` and stored
|
|
83
|
+
* one-per-line in `performance` artifacts by a performance capture. Rates
|
|
84
|
+
* cover the second since the previous sample of the same process, so a
|
|
85
|
+
* process's first sample has none. On Android only an app's main process is
|
|
86
|
+
* sampled, the footprint is its anonymous and shared memory in RAM plus swap,
|
|
87
|
+
* and the peak is the highest sampled footprint.
|
|
88
88
|
*/
|
|
89
89
|
export interface PerformanceSample {
|
|
90
90
|
/** Epoch milliseconds, same clock as SessionLogLine. */
|
package/src/gradle-snapshot.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LimrunError } from './core/error';
|
|
1
2
|
import { followPhaseStream, type PhaseStreamAuth } from './internal/instance-phase-stream';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -14,6 +15,33 @@ export type GradleSnapshotConfig = {
|
|
|
14
15
|
restoreKeys?: string[];
|
|
15
16
|
};
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* What a client tells a running instance about its disk snapshot. The names and the encryption key
|
|
20
|
+
* live only in the instance's memory, never on its spec, so the instance's role must allow them:
|
|
21
|
+
* read on each restore key's asset name, and create, upload and update on `key`'s. The asset name
|
|
22
|
+
* of snapshot key `k` is `shared/k`.
|
|
23
|
+
*/
|
|
24
|
+
export type GradleSnapshotRequest = {
|
|
25
|
+
/** Save under this key at termination. Set once. Defaults to restoring this key too. */
|
|
26
|
+
key?: string;
|
|
27
|
+
/** Restore in order, trying an exact match then the newest literal-prefix match for each entry. */
|
|
28
|
+
restoreKeys?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* A base64 AES-256 key, 32 random bytes, that encrypts the save and decrypts the restore. Limrun
|
|
31
|
+
* stores no copy, so a lost key makes the snapshot unreadable. Generate one with
|
|
32
|
+
* `openssl rand -base64 32`.
|
|
33
|
+
*/
|
|
34
|
+
encryptionKey?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** A snapshot request, and how to watch the restore it starts. */
|
|
38
|
+
export type GradleSnapshotRestoreOptions = GradleSnapshotRequest & {
|
|
39
|
+
/** Called once per distinct restore state, including the state the request answers with. */
|
|
40
|
+
onUpdate?: (snapshot: GradleInstanceSnapshot) => void;
|
|
41
|
+
/** How long to wait for the restore to end. The instance bounds it at fifteen minutes. */
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
};
|
|
44
|
+
|
|
17
45
|
/**
|
|
18
46
|
* How far a restore got. `disabled` and `skipped` are not failures: they describe an ordinary
|
|
19
47
|
* cold instance, which is perfectly usable. Only `failed` means the workspace was supposed to be
|
|
@@ -113,6 +141,18 @@ export type GradleSnapshotFollowResult = {
|
|
|
113
141
|
gone: boolean;
|
|
114
142
|
};
|
|
115
143
|
|
|
144
|
+
/**
|
|
145
|
+
* The instance answered a snapshot request with 404: its image may predate snapshot requests, or
|
|
146
|
+
* it may no longer exist. It is not a NotFoundError, so a caller does not take a running instance
|
|
147
|
+
* for a gone one.
|
|
148
|
+
*/
|
|
149
|
+
export class GradleSnapshotRequestUnavailableError extends LimrunError {
|
|
150
|
+
constructor() {
|
|
151
|
+
super('Disk snapshot requests are unavailable; this instance may predate them or no longer exist.');
|
|
152
|
+
this.name = 'GradleSnapshotRequestUnavailableError';
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
116
156
|
/** The instance disappeared before reporting its disk snapshot state. */
|
|
117
157
|
export class GradleSnapshotGoneError extends Error {
|
|
118
158
|
constructor(readonly instanceId: string) {
|
package/src/index.ts
CHANGED
|
@@ -274,8 +274,11 @@ export {
|
|
|
274
274
|
isGradleSaveTerminal,
|
|
275
275
|
isGradleSnapshotTerminal,
|
|
276
276
|
GradleSnapshotGoneError,
|
|
277
|
+
GradleSnapshotRequestUnavailableError,
|
|
277
278
|
GradleSnapshotTimeoutError,
|
|
278
279
|
type GradleSnapshotConfig,
|
|
280
|
+
type GradleSnapshotRequest,
|
|
281
|
+
type GradleSnapshotRestoreOptions,
|
|
279
282
|
type GradleInstanceSnapshot,
|
|
280
283
|
type GradleSnapshotRestoreStatus,
|
|
281
284
|
type GradleSnapshotSaveStatus,
|
package/src/instance-client.ts
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import { deriveDestinationTunnelURL } from './internal/destination-tunnel-url';
|
|
28
28
|
import { androidBlockedDomainsUrl, requestBlockedDomains } from './internal/blocked-domains';
|
|
29
29
|
import { addTrustedCaCertificate, type TrustedCaCertificate } from './internal/trusted-ca';
|
|
30
|
-
import { persistFields, type PersistOption } from './internal/persist-option';
|
|
30
|
+
import { persistFields, ttlFields, type PersistOption } from './internal/persist-option';
|
|
31
31
|
import { streamSessionEntries } from './internal/session-stream';
|
|
32
32
|
import type { PerformanceSample, SessionLogLine, SessionEvent } from './resources/session-artifacts';
|
|
33
33
|
import { LogcatProcess } from './logcat-process';
|
|
@@ -350,6 +350,17 @@ export type InstanceClient = {
|
|
|
350
350
|
startEventCapture: (options?: { persist?: PersistOption }) => Promise<void>;
|
|
351
351
|
/** Stop the active event capture. */
|
|
352
352
|
stopEventCapture: () => Promise<void>;
|
|
353
|
+
/**
|
|
354
|
+
* Start saving the running apps' {@link PerformanceSample}s. The instance
|
|
355
|
+
* samples whether or not anything listens, so this capture always persists:
|
|
356
|
+
* it is uploaded to Limrun's bucket when it stops or the instance
|
|
357
|
+
* terminates, kept for `ttlSeconds` (server default 72h); list it with
|
|
358
|
+
* `androidInstances.listPerformanceCaptures`. One performance capture runs
|
|
359
|
+
* at a time; the server rejects a second start.
|
|
360
|
+
*/
|
|
361
|
+
startPerformanceCapture: (options?: { ttlSeconds?: number }) => Promise<void>;
|
|
362
|
+
/** Stop the active performance capture and upload it. */
|
|
363
|
+
stopPerformanceCapture: () => Promise<void>;
|
|
353
364
|
/**
|
|
354
365
|
* Tail the live app log stream fed by {@link startAppLogCapture}. On
|
|
355
366
|
* connect the instance replays its recent buffer (up to 1000 lines), then
|
|
@@ -1039,6 +1050,20 @@ type StopEventCaptureResultMessage = {
|
|
|
1039
1050
|
error?: CommandError;
|
|
1040
1051
|
};
|
|
1041
1052
|
|
|
1053
|
+
type StartPerformanceCaptureResultMessage = {
|
|
1054
|
+
type: 'startPerformanceCaptureResult';
|
|
1055
|
+
id: string;
|
|
1056
|
+
payload?: EmptyCommandResult;
|
|
1057
|
+
error?: CommandError;
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
type StopPerformanceCaptureResultMessage = {
|
|
1061
|
+
type: 'stopPerformanceCaptureResult';
|
|
1062
|
+
id: string;
|
|
1063
|
+
payload?: EmptyCommandResult;
|
|
1064
|
+
error?: CommandError;
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1042
1067
|
type KnownCommandResultMessage =
|
|
1043
1068
|
| ScreenshotResultMessage
|
|
1044
1069
|
| GetElementTreeResultMessage
|
|
@@ -1065,7 +1090,9 @@ type KnownCommandResultMessage =
|
|
|
1065
1090
|
| StartAppLogCaptureResultMessage
|
|
1066
1091
|
| StopAppLogCaptureResultMessage
|
|
1067
1092
|
| StartEventCaptureResultMessage
|
|
1068
|
-
| StopEventCaptureResultMessage
|
|
1093
|
+
| StopEventCaptureResultMessage
|
|
1094
|
+
| StartPerformanceCaptureResultMessage
|
|
1095
|
+
| StopPerformanceCaptureResultMessage;
|
|
1069
1096
|
|
|
1070
1097
|
type ServerMessage =
|
|
1071
1098
|
| ScreenshotResponse
|
|
@@ -1106,6 +1133,8 @@ type CommandRequestMap = {
|
|
|
1106
1133
|
stopAppLogCapture: {};
|
|
1107
1134
|
startEventCapture: { persist?: boolean; ttlSeconds?: number };
|
|
1108
1135
|
stopEventCapture: {};
|
|
1136
|
+
startPerformanceCapture: { ttlSeconds?: number };
|
|
1137
|
+
stopPerformanceCapture: {};
|
|
1109
1138
|
};
|
|
1110
1139
|
|
|
1111
1140
|
type CommandResultMap = {
|
|
@@ -1135,6 +1164,8 @@ type CommandResultMap = {
|
|
|
1135
1164
|
stopAppLogCapture: EmptyCommandResult;
|
|
1136
1165
|
startEventCapture: EmptyCommandResult;
|
|
1137
1166
|
stopEventCapture: EmptyCommandResult;
|
|
1167
|
+
startPerformanceCapture: EmptyCommandResult;
|
|
1168
|
+
stopPerformanceCapture: EmptyCommandResult;
|
|
1138
1169
|
};
|
|
1139
1170
|
|
|
1140
1171
|
type PendingRequest<T> = {
|
|
@@ -1321,6 +1352,8 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1321
1352
|
case 'stopAppLogCaptureResult':
|
|
1322
1353
|
case 'startEventCaptureResult':
|
|
1323
1354
|
case 'stopEventCaptureResult':
|
|
1355
|
+
case 'startPerformanceCaptureResult':
|
|
1356
|
+
case 'stopPerformanceCaptureResult':
|
|
1324
1357
|
return 'id' in message && typeof message.id === 'string';
|
|
1325
1358
|
default:
|
|
1326
1359
|
return false;
|
|
@@ -1604,6 +1637,8 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1604
1637
|
stopAppLogCapture,
|
|
1605
1638
|
startEventCapture,
|
|
1606
1639
|
stopEventCapture,
|
|
1640
|
+
startPerformanceCapture,
|
|
1641
|
+
stopPerformanceCapture,
|
|
1607
1642
|
streamAppLogCapture,
|
|
1608
1643
|
streamEventCapture,
|
|
1609
1644
|
streamPerformance: (handlers: PerformanceStreamHandlers) =>
|
|
@@ -1973,6 +2008,15 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
|
|
|
1973
2008
|
await sendRequest('stopEventCapture', {});
|
|
1974
2009
|
};
|
|
1975
2010
|
|
|
2011
|
+
const startPerformanceCapture = async (captureOptions?: { ttlSeconds?: number }): Promise<void> => {
|
|
2012
|
+
await sendRequest('startPerformanceCapture', ttlFields(captureOptions?.ttlSeconds));
|
|
2013
|
+
};
|
|
2014
|
+
|
|
2015
|
+
// The stop answers once the capture is uploaded, which grows with its length, as on iOS.
|
|
2016
|
+
const stopPerformanceCapture = async (): Promise<void> => {
|
|
2017
|
+
await sendRequest('stopPerformanceCapture', {}, 300_000);
|
|
2018
|
+
};
|
|
2019
|
+
|
|
1976
2020
|
const streamAppLogCapture = (handlers: {
|
|
1977
2021
|
onLine: (line: SessionLogLine) => void;
|
|
1978
2022
|
onError?: (error: Error) => void;
|
|
@@ -42,4 +42,11 @@ export class AndroidInstances extends GeneratedAndroidInstances {
|
|
|
42
42
|
listEvents(id: string, options?: RequestOptions): APIPromise<SessionArtifact[]> {
|
|
43
43
|
return this.listSessionArtifacts(id, 'eventLog', options);
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* List the instance's persisted performance captures.
|
|
48
|
+
*/
|
|
49
|
+
listPerformanceCaptures(id: string, options?: RequestOptions): APIPromise<SessionArtifact[]> {
|
|
50
|
+
return this.listSessionArtifacts(id, 'performance', options);
|
|
51
|
+
}
|
|
45
52
|
}
|
package/src/resources/assets.ts
CHANGED
|
@@ -91,13 +91,13 @@ export interface Asset {
|
|
|
91
91
|
* @deprecated Deprecated: alias of platform, always mirrors it. Use platform
|
|
92
92
|
* instead.
|
|
93
93
|
*/
|
|
94
|
-
os?: 'ios' | 'android' | 'xcode';
|
|
94
|
+
os?: 'ios' | 'android' | 'xcode' | 'macos';
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* The platform this asset is for. If not set, the asset is available for all
|
|
98
98
|
* platforms.
|
|
99
99
|
*/
|
|
100
|
-
platform?: 'ios' | 'android' | 'xcode';
|
|
100
|
+
platform?: 'ios' | 'android' | 'xcode' | 'macos';
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* The xcodebuild SDK the artifact was built against, e.g. "iphonesimulator" or
|
|
@@ -156,7 +156,7 @@ export interface AssetGetOrCreateResponse {
|
|
|
156
156
|
*/
|
|
157
157
|
md5?: string;
|
|
158
158
|
|
|
159
|
-
platform?: 'ios' | 'android' | 'xcode';
|
|
159
|
+
platform?: 'ios' | 'android' | 'xcode' | 'macos';
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export interface AssetListParams {
|
|
@@ -222,7 +222,7 @@ export interface AssetGetOrCreateParams {
|
|
|
222
222
|
|
|
223
223
|
kind?: 'App' | 'Keychain';
|
|
224
224
|
|
|
225
|
-
platform?: 'ios' | 'android' | 'xcode';
|
|
225
|
+
platform?: 'ios' | 'android' | 'xcode' | 'macos';
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* Optional time-to-live as a Go duration string (e.g. "24h"). When set, the asset
|
|
@@ -266,7 +266,7 @@ export interface AssetGetOrCreateParams {
|
|
|
266
266
|
|
|
267
267
|
export type AssetKind = 'App' | 'Keychain' | 'MacOSSnapshot';
|
|
268
268
|
|
|
269
|
-
export type AssetPlatform = 'ios' | 'android' | 'xcode';
|
|
269
|
+
export type AssetPlatform = 'ios' | 'android' | 'xcode' | 'macos';
|
|
270
270
|
|
|
271
271
|
export declare namespace Assets {
|
|
272
272
|
export {
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { DeviceDetachUnavailableError } from '../device-detach';
|
|
2
|
+
import { directInstanceHttpError } from '../internal/direct-instance-errors';
|
|
2
3
|
import { nodeProxyTransport } from '../internal/proxy-transport';
|
|
4
|
+
import {
|
|
5
|
+
GradleSnapshotRequestUnavailableError,
|
|
6
|
+
GradleSnapshotTimeoutError,
|
|
7
|
+
isGradleRestoreTerminal,
|
|
8
|
+
type GradleInstanceSnapshot,
|
|
9
|
+
type GradleSnapshotRequest,
|
|
10
|
+
type GradleSnapshotRestoreOptions,
|
|
11
|
+
} from '../gradle-snapshot';
|
|
12
|
+
import { sleep } from '../internal/utils/sleep';
|
|
3
13
|
import type { AndroidInstance } from './android-instances';
|
|
4
14
|
import { pullBuildFile } from '../internal/build-pull-file';
|
|
5
15
|
import { normalizeAssetUpload, type BuildUpload } from '../lib/asset-permissions';
|
|
@@ -115,6 +125,15 @@ export type GradleClient = {
|
|
|
115
125
|
run(commandLine: string, options?: GradleRunOptions): ExecChildProcess;
|
|
116
126
|
/** Replay an existing build's logs, optionally following it to completion. */
|
|
117
127
|
observeBuildLogs(execId: string, options?: ExecLogOptions): Promise<ExecLogResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Give the instance its disk snapshot names and encryption key, restore, and resolve with the
|
|
130
|
+
* restore's final state. Call it once the instance is ready and before syncing. The instance
|
|
131
|
+
* keeps the names for its lifetime: asking again with the same names answers with the restore
|
|
132
|
+
* that already ran, other names are refused with HTTP 409. A failed or skipped restore leaves a
|
|
133
|
+
* usable cold workspace. The restore is read from the instance itself, because these names
|
|
134
|
+
* never reach the instance's spec.
|
|
135
|
+
*/
|
|
136
|
+
restoreSnapshot(options: GradleSnapshotRestoreOptions): Promise<GradleInstanceSnapshot>;
|
|
118
137
|
};
|
|
119
138
|
|
|
120
139
|
// Machine-local or regenerable files that must never reach the build
|
|
@@ -131,6 +150,29 @@ function gradleDefaultIgnore(relativePath: string): boolean {
|
|
|
131
150
|
return segments.length === 1 && (trimmed === '.gradle' || trimmed === '.kotlin' || trimmed === 'build');
|
|
132
151
|
}
|
|
133
152
|
|
|
153
|
+
/** A restore waits past the instance's own fifteen-minute bound before giving up on it. */
|
|
154
|
+
const RESTORE_TIMEOUT_MS = 20 * 60 * 1000;
|
|
155
|
+
|
|
156
|
+
/** The build daemon's own snapshot report: its restore names the key it matched `key`. */
|
|
157
|
+
type InstanceSnapshotReport = {
|
|
158
|
+
restore: Omit<GradleInstanceSnapshot['restore'], 'phase' | 'matchedKey'> & { phase: string; key?: string };
|
|
159
|
+
save: GradleInstanceSnapshot['save'];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/** The daemon's report in the shape `getSnapshot` returns, so one set of readers handles both. */
|
|
163
|
+
function instanceSnapshot({ restore, save }: InstanceSnapshotReport): GradleInstanceSnapshot {
|
|
164
|
+
const { key, phase, ...rest } = restore;
|
|
165
|
+
return {
|
|
166
|
+
// Older images report one phase for download and extraction, which `getSnapshot` calls downloading.
|
|
167
|
+
restore: {
|
|
168
|
+
...rest,
|
|
169
|
+
phase: (phase === 'restoring' ? 'downloading' : phase) as GradleInstanceSnapshot['restore']['phase'],
|
|
170
|
+
...(key && { matchedKey: key }),
|
|
171
|
+
},
|
|
172
|
+
save,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
134
176
|
// GradleBuildLog is one persisted build record from the director's
|
|
135
177
|
// GET /v1/gradle_instances/{id}/build_logs (operationId
|
|
136
178
|
// listGradleInstanceBuildLogs). The record shape is shared with xcode; see
|
|
@@ -271,6 +313,48 @@ class GradleInstancesHelpers extends GradleInstances {
|
|
|
271
313
|
observeBuildLogs(execId: string, options?: ExecLogOptions): Promise<ExecLogResult> {
|
|
272
314
|
return observeExecLogs(execId, { apiUrl, token, log, ...options });
|
|
273
315
|
},
|
|
316
|
+
|
|
317
|
+
async restoreSnapshot({ onUpdate, timeoutMs = RESTORE_TIMEOUT_MS, key, restoreKeys, encryptionKey }) {
|
|
318
|
+
const snapshotRequest = async (body?: GradleSnapshotRequest): Promise<GradleInstanceSnapshot> => {
|
|
319
|
+
const response = await nodeProxyTransport.fetch(`${apiUrl}/snapshot`, {
|
|
320
|
+
method: body ? 'POST' : 'GET',
|
|
321
|
+
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
|
|
322
|
+
...(body ? { body: JSON.stringify(body) } : {}),
|
|
323
|
+
});
|
|
324
|
+
if (response.status === 404) {
|
|
325
|
+
await response.text().catch(() => undefined);
|
|
326
|
+
throw new GradleSnapshotRequestUnavailableError();
|
|
327
|
+
}
|
|
328
|
+
if (!response.ok) {
|
|
329
|
+
// The body is the daemon's reason, which never repeats the encryption key.
|
|
330
|
+
throw directInstanceHttpError(
|
|
331
|
+
'Disk snapshot request',
|
|
332
|
+
response.status,
|
|
333
|
+
(await response.text()).trim(),
|
|
334
|
+
response.headers,
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
return instanceSnapshot((await response.json()) as InstanceSnapshotReport);
|
|
338
|
+
};
|
|
339
|
+
const deadline = Date.now() + timeoutMs;
|
|
340
|
+
let state = await snapshotRequest({
|
|
341
|
+
...(key !== undefined && { key }),
|
|
342
|
+
...(restoreKeys !== undefined && { restoreKeys }),
|
|
343
|
+
...(encryptionKey !== undefined && { encryptionKey }),
|
|
344
|
+
});
|
|
345
|
+
let reported = '';
|
|
346
|
+
for (;;) {
|
|
347
|
+
const seen = `${state.restore.phase}/${state.restore.reason ?? ''}`;
|
|
348
|
+
if (seen !== reported) {
|
|
349
|
+
reported = seen;
|
|
350
|
+
onUpdate?.(state);
|
|
351
|
+
}
|
|
352
|
+
if (isGradleRestoreTerminal(state.restore.phase)) return state;
|
|
353
|
+
if (Date.now() >= deadline) throw new GradleSnapshotTimeoutError('restore', timeoutMs, state);
|
|
354
|
+
await sleep(1000);
|
|
355
|
+
state = await snapshotRequest();
|
|
356
|
+
}
|
|
357
|
+
},
|
|
274
358
|
};
|
|
275
359
|
}
|
|
276
360
|
}
|
|
@@ -148,6 +148,12 @@ export namespace IosInstance {
|
|
|
148
148
|
|
|
149
149
|
targetHttpPortUrlPrefix?: string;
|
|
150
150
|
|
|
151
|
+
/**
|
|
152
|
+
* How the restore of `spec.deviceState` went. Present only on the create
|
|
153
|
+
* response; get and list do not carry it.
|
|
154
|
+
*/
|
|
155
|
+
deviceState?: Status.DeviceState;
|
|
156
|
+
|
|
151
157
|
/**
|
|
152
158
|
* Machine-readable reason for instance termination. Present when state is
|
|
153
159
|
* "terminating" or "terminated". New values may be added over time, so treat any
|
|
@@ -164,6 +170,51 @@ export namespace IosInstance {
|
|
|
164
170
|
*/
|
|
165
171
|
terminationReason?: string;
|
|
166
172
|
}
|
|
173
|
+
|
|
174
|
+
export namespace Status {
|
|
175
|
+
export interface DeviceState {
|
|
176
|
+
restore: DeviceState.Restore;
|
|
177
|
+
save: DeviceState.Save;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export namespace DeviceState {
|
|
181
|
+
export interface Restore {
|
|
182
|
+
/**
|
|
183
|
+
* `restored` applied the saved state. `empty` found nothing under the key, so the
|
|
184
|
+
* simulator starts clean and the save creates the snapshot. `failed` leaves the
|
|
185
|
+
* instance ready with saving disabled, because the restore may have left partial
|
|
186
|
+
* state. `pending` has not finished; in client mode it stays pending until the
|
|
187
|
+
* caller reports the restore done.
|
|
188
|
+
*/
|
|
189
|
+
phase: 'pending' | 'restored' | 'empty' | 'failed';
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Client restore mode only: pass it to the simulator's `importDeviceState`
|
|
193
|
+
* command. An empty string means nothing is saved. It is a presigned URL, so
|
|
194
|
+
* do not log it.
|
|
195
|
+
*/
|
|
196
|
+
downloadUrl?: string;
|
|
197
|
+
|
|
198
|
+
reason?: string;
|
|
199
|
+
|
|
200
|
+
message?: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface Save {
|
|
204
|
+
/**
|
|
205
|
+
* `idle` saves when the instance is deleted. `disabled` means no key is set or the
|
|
206
|
+
* restore did not succeed. The other phases appear while the instance is deleted.
|
|
207
|
+
*/
|
|
208
|
+
phase: 'disabled' | 'idle' | 'requested' | 'saved' | 'skipped' | 'failed' | 'timed_out';
|
|
209
|
+
|
|
210
|
+
reason?: string;
|
|
211
|
+
|
|
212
|
+
message?: string;
|
|
213
|
+
|
|
214
|
+
sizeBytes?: number;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
167
218
|
}
|
|
168
219
|
|
|
169
220
|
export interface IosInstanceUpdateParams {
|
|
@@ -226,6 +277,14 @@ export namespace IosInstanceCreateParams {
|
|
|
226
277
|
*/
|
|
227
278
|
clues?: Array<Spec.Clue>;
|
|
228
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Restores the simulator snapshot saved under this key and saves back to it when
|
|
282
|
+
* the instance is deleted. A snapshot holds installed user apps, their data, app
|
|
283
|
+
* group containers, the keychain and supported privacy permissions. Keys are shared
|
|
284
|
+
* by the whole organization and the last save wins.
|
|
285
|
+
*/
|
|
286
|
+
deviceState?: Spec.DeviceState;
|
|
287
|
+
|
|
229
288
|
/**
|
|
230
289
|
* Keeps this app in the foreground after it is first observed there. This does not
|
|
231
290
|
* launch the app when the simulator starts. Once armed, closing or backgrounding
|
|
@@ -321,6 +380,22 @@ export namespace IosInstanceCreateParams {
|
|
|
321
380
|
}
|
|
322
381
|
|
|
323
382
|
export namespace Spec {
|
|
383
|
+
export interface DeviceState {
|
|
384
|
+
/**
|
|
385
|
+
* Snapshot key, up to 128 characters: a letter or digit, followed by letters,
|
|
386
|
+
* digits or `._-@:+`. A new key starts clean and the first save creates it.
|
|
387
|
+
*/
|
|
388
|
+
key: string;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* `server` (the default) restores before the instance becomes ready. `client`
|
|
392
|
+
* returns `status.deviceState.restore.downloadUrl` and leaves the restore to the
|
|
393
|
+
* caller, who must then call `POST /v1/ios_instances/{id}/device_state/ready`
|
|
394
|
+
* before the instance can save.
|
|
395
|
+
*/
|
|
396
|
+
restoreMode?: 'server' | 'client';
|
|
397
|
+
}
|
|
398
|
+
|
|
324
399
|
export interface Clue {
|
|
325
400
|
kind: 'ClientIP' | 'ClientLocation' | 'OSVersion';
|
|
326
401
|
|
|
@@ -229,6 +229,16 @@ export namespace MacosInstanceCreateParams {
|
|
|
229
229
|
*/
|
|
230
230
|
clues?: Array<Spec.Clue>;
|
|
231
231
|
|
|
232
|
+
/**
|
|
233
|
+
* HTTP headers the instance adds to its own requests to the named domains, next to
|
|
234
|
+
* `Limrun-Instance-Id`, with no tunnel. The guest's network answers those names
|
|
235
|
+
* itself and decrypts their HTTPS with a certificate authority the guest trusts, so
|
|
236
|
+
* an app that pins certificates or ships its own trust store cannot reach them. A
|
|
237
|
+
* tunnel's domain takes precedence: a request both cover gets the tunnel's headers.
|
|
238
|
+
* The headers apply before the instance becomes ready.
|
|
239
|
+
*/
|
|
240
|
+
egressHeaders?: Spec.EgressHeaders;
|
|
241
|
+
|
|
232
242
|
/**
|
|
233
243
|
* Maximum runtime regardless of activity. Omit to use the organization's macOS
|
|
234
244
|
* default. Set to "0" to disable the hard timeout.
|
|
@@ -277,6 +287,19 @@ export namespace MacosInstanceCreateParams {
|
|
|
277
287
|
}
|
|
278
288
|
|
|
279
289
|
export namespace Spec {
|
|
290
|
+
export interface EgressHeaders {
|
|
291
|
+
/**
|
|
292
|
+
* One to 64 exact names such as `api.example.com`, or wildcards such as
|
|
293
|
+
* `*.example.com` that cover every subdomain but not the name itself.
|
|
294
|
+
*/
|
|
295
|
+
domains: Array<string>;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* One to 16 HTTP headers, by name, to add to those requests.
|
|
299
|
+
*/
|
|
300
|
+
headers: { [name: string]: string };
|
|
301
|
+
}
|
|
302
|
+
|
|
280
303
|
export interface Clue {
|
|
281
304
|
kind: 'ClientIP' | 'ClientLocation';
|
|
282
305
|
|
|
@@ -108,12 +108,12 @@ export interface PerformanceThread {
|
|
|
108
108
|
/**
|
|
109
109
|
* One running app's resource use at one moment, the figures Xcode's debug
|
|
110
110
|
* gauges show. iOS and Android instances sample every running app you
|
|
111
|
-
* installed once a second, delivered live by `streamPerformance
|
|
112
|
-
*
|
|
113
|
-
* since the previous sample of the same process, so a
|
|
114
|
-
* has none. On Android only an app's main process is
|
|
115
|
-
* its anonymous and shared memory in RAM plus swap,
|
|
116
|
-
*
|
|
111
|
+
* installed once a second, delivered live by `streamPerformance` and stored
|
|
112
|
+
* one-per-line in `performance` artifacts by a performance capture. Rates
|
|
113
|
+
* cover the second since the previous sample of the same process, so a
|
|
114
|
+
* process's first sample has none. On Android only an app's main process is
|
|
115
|
+
* sampled, the footprint is its anonymous and shared memory in RAM plus swap,
|
|
116
|
+
* and the peak is the highest sampled footprint.
|
|
117
117
|
*/
|
|
118
118
|
export interface PerformanceSample {
|
|
119
119
|
/** Epoch milliseconds, same clock as SessionLogLine. */
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.82.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.82.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.82.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.82.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|