@limrun/api 0.79.6 → 0.80.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.
Files changed (137) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/client.d.mts +4 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/exec-client.d.mts +64 -15
  11. package/exec-client.d.mts.map +1 -1
  12. package/exec-client.d.ts +64 -15
  13. package/exec-client.d.ts.map +1 -1
  14. package/exec-client.js.map +1 -1
  15. package/exec-client.mjs.map +1 -1
  16. package/folder-sync.d.mts +2 -0
  17. package/folder-sync.d.mts.map +1 -1
  18. package/folder-sync.d.ts +2 -0
  19. package/folder-sync.d.ts.map +1 -1
  20. package/folder-sync.js +1 -1
  21. package/folder-sync.js.map +1 -1
  22. package/folder-sync.mjs +1 -1
  23. package/folder-sync.mjs.map +1 -1
  24. package/index.d.mts +2 -2
  25. package/index.d.mts.map +1 -1
  26. package/index.d.ts +2 -2
  27. package/index.d.ts.map +1 -1
  28. package/index.js.map +1 -1
  29. package/index.mjs.map +1 -1
  30. package/instance-client.d.mts +43 -3
  31. package/instance-client.d.mts.map +1 -1
  32. package/instance-client.d.ts +43 -3
  33. package/instance-client.d.ts.map +1 -1
  34. package/instance-client.js +44 -55
  35. package/instance-client.js.map +1 -1
  36. package/instance-client.mjs +43 -55
  37. package/instance-client.mjs.map +1 -1
  38. package/internal/asset-source.d.mts +11 -0
  39. package/internal/asset-source.d.mts.map +1 -0
  40. package/internal/asset-source.d.ts +11 -0
  41. package/internal/asset-source.d.ts.map +1 -0
  42. package/internal/asset-source.js +15 -0
  43. package/internal/asset-source.js.map +1 -0
  44. package/internal/asset-source.mjs +12 -0
  45. package/internal/asset-source.mjs.map +1 -0
  46. package/internal/file-transfer.d.mts +43 -0
  47. package/internal/file-transfer.d.mts.map +1 -0
  48. package/internal/file-transfer.d.ts +43 -0
  49. package/internal/file-transfer.d.ts.map +1 -0
  50. package/internal/file-transfer.js +270 -0
  51. package/internal/file-transfer.js.map +1 -0
  52. package/internal/file-transfer.mjs +261 -0
  53. package/internal/file-transfer.mjs.map +1 -0
  54. package/ios-client.d.mts +23 -4
  55. package/ios-client.d.mts.map +1 -1
  56. package/ios-client.d.ts +23 -4
  57. package/ios-client.d.ts.map +1 -1
  58. package/ios-client.js +11 -2
  59. package/ios-client.js.map +1 -1
  60. package/ios-client.mjs +11 -2
  61. package/ios-client.mjs.map +1 -1
  62. package/lib/workload-credentials.d.mts +2 -1
  63. package/lib/workload-credentials.d.mts.map +1 -1
  64. package/lib/workload-credentials.d.ts +2 -1
  65. package/lib/workload-credentials.d.ts.map +1 -1
  66. package/lib/workload-credentials.js +3 -0
  67. package/lib/workload-credentials.js.map +1 -1
  68. package/lib/workload-credentials.mjs +3 -0
  69. package/lib/workload-credentials.mjs.map +1 -1
  70. package/package.json +2 -1
  71. package/resources/access-tokens.d.mts +17 -0
  72. package/resources/access-tokens.d.mts.map +1 -1
  73. package/resources/access-tokens.d.ts +17 -0
  74. package/resources/access-tokens.d.ts.map +1 -1
  75. package/resources/access-tokens.js +39 -3
  76. package/resources/access-tokens.js.map +1 -1
  77. package/resources/access-tokens.mjs +36 -2
  78. package/resources/access-tokens.mjs.map +1 -1
  79. package/resources/assets.d.mts +6 -0
  80. package/resources/assets.d.mts.map +1 -1
  81. package/resources/assets.d.ts +6 -0
  82. package/resources/assets.d.ts.map +1 -1
  83. package/resources/index.d.mts +1 -1
  84. package/resources/index.d.mts.map +1 -1
  85. package/resources/index.d.ts +1 -1
  86. package/resources/index.d.ts.map +1 -1
  87. package/resources/index.js.map +1 -1
  88. package/resources/index.mjs.map +1 -1
  89. package/resources/macos-instances-helpers.d.mts +112 -0
  90. package/resources/macos-instances-helpers.d.mts.map +1 -1
  91. package/resources/macos-instances-helpers.d.ts +112 -0
  92. package/resources/macos-instances-helpers.d.ts.map +1 -1
  93. package/resources/macos-instances-helpers.js +105 -0
  94. package/resources/macos-instances-helpers.js.map +1 -1
  95. package/resources/macos-instances-helpers.mjs +104 -0
  96. package/resources/macos-instances-helpers.mjs.map +1 -1
  97. package/resources/scoped-tokens.d.mts +2 -2
  98. package/resources/scoped-tokens.d.mts.map +1 -1
  99. package/resources/scoped-tokens.d.ts +2 -2
  100. package/resources/scoped-tokens.d.ts.map +1 -1
  101. package/resources/scoped-tokens.js +9 -2
  102. package/resources/scoped-tokens.js.map +1 -1
  103. package/resources/scoped-tokens.mjs +9 -2
  104. package/resources/scoped-tokens.mjs.map +1 -1
  105. package/resources/session-artifacts.d.mts +7 -4
  106. package/resources/session-artifacts.d.mts.map +1 -1
  107. package/resources/session-artifacts.d.ts +7 -4
  108. package/resources/session-artifacts.d.ts.map +1 -1
  109. package/resources/xcode-instances-helpers.d.mts +33 -18
  110. package/resources/xcode-instances-helpers.d.mts.map +1 -1
  111. package/resources/xcode-instances-helpers.d.ts +33 -18
  112. package/resources/xcode-instances-helpers.d.ts.map +1 -1
  113. package/resources/xcode-instances-helpers.js +5 -2
  114. package/resources/xcode-instances-helpers.js.map +1 -1
  115. package/resources/xcode-instances-helpers.mjs +5 -2
  116. package/resources/xcode-instances-helpers.mjs.map +1 -1
  117. package/src/client.ts +5 -2
  118. package/src/exec-client.ts +77 -22
  119. package/src/folder-sync.ts +3 -1
  120. package/src/index.ts +9 -0
  121. package/src/instance-client.ts +87 -60
  122. package/src/internal/asset-source.ts +13 -0
  123. package/src/internal/file-transfer.ts +284 -0
  124. package/src/ios-client.ts +43 -6
  125. package/src/lib/workload-credentials.ts +6 -1
  126. package/src/resources/access-tokens.ts +39 -2
  127. package/src/resources/assets.ts +7 -0
  128. package/src/resources/index.ts +4 -0
  129. package/src/resources/macos-instances-helpers.ts +257 -0
  130. package/src/resources/scoped-tokens.ts +14 -3
  131. package/src/resources/session-artifacts.ts +7 -4
  132. package/src/resources/xcode-instances-helpers.ts +49 -19
  133. package/src/version.ts +1 -1
  134. package/version.d.mts +1 -1
  135. package/version.d.ts +1 -1
  136. package/version.js +1 -1
  137. package/version.mjs +1 -1
@@ -1,4 +1,5 @@
1
1
  import { LogStream } from '../log-stream';
2
+ import { assetSourceFields, type AssetSource } from '../internal/asset-source';
2
3
  import {
3
4
  openSignalingTransport,
4
5
  type ConnectionState,
@@ -41,6 +42,21 @@ import {
41
42
  type DestinationTunnelStatus,
42
43
  } from '../internal/destination-tunnel-management';
43
44
  import { deriveDestinationTunnelURL } from '../internal/destination-tunnel-url';
45
+ import { syncFolder as syncFolderImpl, type FolderSyncOptions } from '../folder-sync';
46
+ import { createIgnoreFn } from '../folder-sync-ignore';
47
+ import { deriveBasisCache, type SyncResult } from './daemon-client-shared';
48
+ import {
49
+ pullQuery,
50
+ pullTarget,
51
+ pullToLocalPath,
52
+ pushFile as pushLocalFile,
53
+ type PullResult,
54
+ } from '../internal/file-transfer';
55
+ import { nodeProxyTransport } from '../internal/proxy-transport';
56
+ import nodePath from 'path';
57
+ import { createHash } from 'crypto';
58
+
59
+ export type { PullResult } from '../internal/file-transfer';
44
60
 
45
61
  export type MacosCreateClientParams = { logLevel?: LogLevel } & (
46
62
  | { instance: MacosInstance }
@@ -89,6 +105,42 @@ export interface MacosLaunchAppOptions {
89
105
  env?: Record<string, string>;
90
106
  }
91
107
 
108
+ export interface MacosInstallAppOptions {
109
+ /** The archive's MD5. The instance checks the download against it. */
110
+ md5?: string;
111
+ /**
112
+ * Opens the app once installed. Omit it to install the app closed, for example to launch it with
113
+ * {@link MacosClient.launchApp} and its own environment. A copy that runs stops while the new
114
+ * one installs, so either mode starts the new copy.
115
+ */
116
+ launchMode?: MacosLaunchMode;
117
+ /** Defaults to 10 minutes: the instance downloads the whole archive first. */
118
+ timeoutMs?: number;
119
+ }
120
+
121
+ export interface MacosInstallAppResult {
122
+ /** Bundle ID of the installed app. */
123
+ bundleId: string;
124
+ /** The supplied URL, when installed from one. */
125
+ url?: string;
126
+ /** The supplied asset name, when installed from one. */
127
+ assetName?: string;
128
+ }
129
+
130
+ /** One app of {@link MacosClient.listApps}, in the fields iOS's listApps returns. */
131
+ export interface MacosInstalledApp {
132
+ bundleId: string;
133
+ name: string;
134
+ /** `system` for an app macOS ships, `user` for one installed in the guest. */
135
+ installType: 'system' | 'user';
136
+ /** Present while the app runs. */
137
+ pid?: number;
138
+ /** App icon as a base64-encoded 64px PNG; absent when the guest has no icon file for it. */
139
+ icon?: string;
140
+ /** When a user app arrived, as epoch milliseconds; absent for system apps. */
141
+ installedAt?: number;
142
+ }
143
+
92
144
  export interface MacosLaunchAppResult {
93
145
  bundleId: string;
94
146
  pid: number;
@@ -112,6 +164,47 @@ export interface MacosPoint {
112
164
  /** Modifier keys held while a key is pressed. */
113
165
  export type MacosModifier = 'shift' | 'control' | 'option' | 'command';
114
166
 
167
+ /** Options of {@link MacosClient.sync}. */
168
+ export interface MacosSyncOptions {
169
+ /**
170
+ * The guest folder the local folder syncs into: absolute, or relative to the guest user's
171
+ * home. Defaults to the local folder's name in the home, `~/<local folder name>`.
172
+ */
173
+ destination?: string;
174
+ /** Keep watching the local folder and sync each change. Defaults to false. */
175
+ watch?: boolean;
176
+ /**
177
+ * Directory for the client-side sync cache, which keeps a folder per destination inside it.
178
+ * Defaults to one under the OS temp directory.
179
+ */
180
+ basisCacheDir?: string;
181
+ /**
182
+ * Predicate for paths to leave out, on top of the folder's .gitignore files. Called with the
183
+ * path relative to the folder, forward slashes, and a trailing '/' for folders.
184
+ */
185
+ ignore?: (relativePath: string) => boolean;
186
+ /** Predicate for paths to sync that .gitignore would leave out, with `ignore`'s convention. */
187
+ include?: (relativePath: string) => boolean;
188
+ /** Called after every successful sync, including watch-triggered ones. */
189
+ onSyncComplete?: FolderSyncOptions['onSyncComplete'];
190
+ }
191
+
192
+ /** What {@link MacosClient.sync} did. */
193
+ export interface MacosSyncResult extends SyncResult {
194
+ /** The guest folder the files went to, as it was sent. */
195
+ destination: string;
196
+ }
197
+
198
+ /** One entry of {@link MacosClient.listFiles}. */
199
+ export interface MacosFileEntry {
200
+ name: string;
201
+ /** The listed path joined with `name`, in the form it was asked; usable with pull and deleteFile. */
202
+ path: string;
203
+ isDirectory: boolean;
204
+ /** Size in bytes of a regular file. */
205
+ size?: number;
206
+ }
207
+
115
208
  /** Where the guest's SSH server can be reached once {@link MacosClient.enableSsh} returns. */
116
209
  export interface MacosSshAccess {
117
210
  /** The guest account the key logs in as. */
@@ -166,6 +259,34 @@ export interface MacosClient {
166
259
  options?: TcpTunnelOptions & { hostname?: string },
167
260
  ): Promise<Tunnel>;
168
261
 
262
+ /**
263
+ * Upload a local folder into the guest and keep it in step: the first sync sends every file,
264
+ * later ones only what changed, as xdelta3 patches where that is smaller. Files the local
265
+ * folder no longer has are removed from the guest folder; files created in the guest folder
266
+ * are left alone. The folder's .gitignore files apply. What lands belongs to the guest user, so
267
+ * `run(..., { cwd: destination })` builds in it, and a disk snapshot keeps it.
268
+ */
269
+ sync(localFolder: string, options?: MacosSyncOptions): Promise<MacosSyncResult>;
270
+
271
+ /**
272
+ * Upload a local file to a guest path, absolute or relative to the guest user's home. Parent
273
+ * folders are created and a file already there is replaced. Resolves with the absolute path.
274
+ */
275
+ pushFile(localPath: string, remotePath: string): Promise<string>;
276
+
277
+ /**
278
+ * Download a guest file or folder to `localPath`; a folder is unpacked there, merging with
279
+ * what is already there. When `localPath` is an existing folder, the file or folder lands
280
+ * inside it under the remote's name. Defaults to the remote's name in the current directory.
281
+ */
282
+ pull(remotePath: string, localPath?: string): Promise<PullResult>;
283
+
284
+ /** List a guest folder, the guest user's home when `path` is omitted. Links are not followed. */
285
+ listFiles(path?: string): Promise<MacosFileEntry[]>;
286
+
287
+ /** Delete a guest file, or a folder with everything in it. */
288
+ deleteFile(path: string): Promise<void>;
289
+
169
290
  /** A JPEG of the screen. Its pixels are the coordinates the input methods take. */
170
291
  screenshot(): Promise<Buffer>;
171
292
 
@@ -250,6 +371,12 @@ export interface MacosClient {
250
371
  */
251
372
  stopSpeakerRecording(recordingId?: string, saveTo?: { localPath?: string }): Promise<string>;
252
373
 
374
+ /**
375
+ * The apps the guest user can open: those in /Applications, /System/Applications and the user's
376
+ * Applications folder, and any launched from elsewhere. Running apps carry their pid.
377
+ */
378
+ listApps(): Promise<MacosInstalledApp[]>;
379
+
253
380
  /**
254
381
  * Launch an app by bundle ID (`com.example.app`), name (`TextEdit`) or path
255
382
  * (`/Applications/Safari.app`) and bring it to the front. An app launched this way has its
@@ -258,6 +385,16 @@ export interface MacosClient {
258
385
  */
259
386
  launchApp(app: string, options?: MacosLaunchAppOptions): Promise<MacosLaunchAppResult>;
260
387
 
388
+ /**
389
+ * Install a Mac app into the guest user's ~/Applications from a tar.gz or zip of one `.app`
390
+ * bundle, such as the asset `lim xcode build --sdk macosx --upload` publishes. The source is a
391
+ * URL, or `{ assetName }`, which the instance resolves with its role's asset read permission.
392
+ */
393
+ installApp(source: AssetSource, options?: MacosInstallAppOptions): Promise<MacosInstallAppResult>;
394
+
395
+ /** Install an app by exact asset name using the instance role. */
396
+ installAppByName(assetName: string, options?: MacosInstallAppOptions): Promise<MacosInstallAppResult>;
397
+
261
398
  /** Stop every process of an app. Succeeds when the app is not running. */
262
399
  terminateApp(bundleId: string): Promise<void>;
263
400
 
@@ -418,9 +555,114 @@ class MacosInstancesHelpers extends MacosInstances {
418
555
  ): Promise<T> =>
419
556
  transport.request<T>(type, params, transform ?? ((() => undefined) as () => T), timeoutMs);
420
557
 
558
+ // limulator's appInstallation, which the instance takes for a Mac app.
559
+ const installApp = (
560
+ source: AssetSource,
561
+ options?: MacosInstallAppOptions,
562
+ ): Promise<MacosInstallAppResult> =>
563
+ send(
564
+ 'appInstallation',
565
+ {
566
+ ...assetSourceFields(source),
567
+ ...(options?.md5 !== undefined && { md5: options.md5 }),
568
+ ...(options?.launchMode !== undefined && { launchMode: options.launchMode }),
569
+ },
570
+ (msg): MacosInstallAppResult => ({
571
+ bundleId: msg['bundleId'],
572
+ ...(msg['url'] !== undefined && { url: msg['url'] }),
573
+ ...(msg['assetName'] !== undefined && { assetName: msg['assetName'] }),
574
+ }),
575
+ options?.timeoutMs ?? installAppTimeoutMs,
576
+ );
577
+
578
+ const filesUrl = (path: string, extra = '') =>
579
+ `${apiUrl}/files?${new URLSearchParams({ path }).toString()}${extra ? `&${extra}` : ''}`;
580
+ const checked = async (response: Response, what: string) => {
581
+ if (!response.ok) throw new Error(`${what} failed: ${response.status} ${await response.text()}`);
582
+ return response;
583
+ };
584
+
421
585
  return {
422
586
  run: createBuildRun({ apiUrl, token, log }),
423
587
 
588
+ async sync(localFolder, options = {}) {
589
+ const destination = (options.destination ?? nodePath.basename(nodePath.resolve(localFolder))).replace(
590
+ /\/+$/,
591
+ '',
592
+ );
593
+ const rootName = nodePath.posix.basename(destination);
594
+ if (!destination || rootName === '~' || rootName === '.' || rootName === '..') {
595
+ throw new Error(
596
+ `destination "${options.destination}" must name a folder of its own, such as ~/app`,
597
+ );
598
+ }
599
+ // One cache per local folder and destination, so two destinations never share a basis.
600
+ const { cacheKey, basisCacheDir } = deriveBasisCache(localFolder, options.basisCacheDir);
601
+ // A folder of its own under the cache for each destination, given or default: a basis
602
+ // describes what one guest folder holds, so two destinations never share one.
603
+ const scoped = nodePath.join(
604
+ basisCacheDir,
605
+ createHash('sha1').update(destination).digest('hex').slice(0, 8),
606
+ );
607
+ const result = await syncFolderImpl(localFolder, {
608
+ apiUrl,
609
+ token,
610
+ udid: cacheKey,
611
+ install: false,
612
+ launchMode: 'None',
613
+ url: `${apiUrl}/folder-sync?${new URLSearchParams({ path: destination }).toString()}`,
614
+ rootName,
615
+ ignoreFn: await createIgnoreFn(localFolder, {
616
+ // The whole cache, every destination's folder in it, stays out of the walk.
617
+ basisCacheDir,
618
+ log,
619
+ xcodeDefaults: false,
620
+ nestedGitignore: true,
621
+ ...(options.ignore ? { additional: options.ignore } : {}),
622
+ ...(options.include ? { include: options.include } : {}),
623
+ }),
624
+ basisCacheDir: scoped,
625
+ watch: options.watch ?? false,
626
+ log,
627
+ syncSymlinks: true,
628
+ ...(options.onSyncComplete ? { onSyncComplete: options.onSyncComplete } : {}),
629
+ });
630
+ return {
631
+ destination,
632
+ ...(result.bytesSent !== undefined ? { bytesSent: result.bytesSent } : {}),
633
+ ...(result.stopWatching ? { stopWatching: result.stopWatching } : {}),
634
+ };
635
+ },
636
+
637
+ pushFile(localPath, remotePath) {
638
+ if (!remotePath) throw new Error('remotePath must not be empty');
639
+ return pushLocalFile(filesUrl(remotePath), token, localPath, true);
640
+ },
641
+
642
+ async pull(remotePath, localPath) {
643
+ if (!remotePath) throw new Error('remotePath must not be empty');
644
+ const target = await pullTarget(remotePath, localPath);
645
+ return pullToLocalPath(filesUrl(remotePath, pullQuery()), token, remotePath, target);
646
+ },
647
+
648
+ async listFiles(path) {
649
+ const query = path ? `?${new URLSearchParams({ path }).toString()}` : '';
650
+ const response = await nodeProxyTransport.fetch(`${apiUrl}/files/list${query}`, {
651
+ headers: { Authorization: `Bearer ${token}` },
652
+ });
653
+ await checked(response as unknown as Response, `Listing of '${path ?? '~'}'`);
654
+ return ((await response.json()) as { entries: MacosFileEntry[] }).entries;
655
+ },
656
+
657
+ async deleteFile(path) {
658
+ if (!path) throw new Error('path must not be empty');
659
+ const response = await nodeProxyTransport.fetch(filesUrl(path), {
660
+ method: 'DELETE',
661
+ headers: { Authorization: `Bearer ${token}` },
662
+ });
663
+ await checked(response as unknown as Response, `Deletion of '${path}'`);
664
+ },
665
+
424
666
  disconnect: () => transport.disconnect(),
425
667
  keepAlive: () => transport.keepAlive(),
426
668
  getConnectionState: () => transport.getConnectionState(),
@@ -510,6 +752,14 @@ class MacosInstancesHelpers extends MacosInstances {
510
752
  return downloadUrl;
511
753
  },
512
754
 
755
+ listApps() {
756
+ // The instance sends the list as JSON text, as limulator does.
757
+ return send('listApps', {}, (msg): MacosInstalledApp[] => {
758
+ const apps = typeof msg['apps'] === 'string' ? JSON.parse(msg['apps']) : msg['apps'];
759
+ return Array.isArray(apps) ? apps : [];
760
+ });
761
+ },
762
+
513
763
  launchApp(app, options) {
514
764
  return send(
515
765
  'launchApp',
@@ -528,6 +778,12 @@ class MacosInstancesHelpers extends MacosInstances {
528
778
  );
529
779
  },
530
780
 
781
+ installApp,
782
+
783
+ installAppByName(assetName, options) {
784
+ return installApp({ assetName }, options);
785
+ },
786
+
531
787
  async terminateApp(bundleId) {
532
788
  await send('terminateApp', { bundleId });
533
789
  },
@@ -676,6 +932,7 @@ const captureStopTimeoutMs = 300_000;
676
932
  const recordingStopTimeoutMs = 180_000;
677
933
  // A first launch or a relaunch can take longer than the default, as on iOS.
678
934
  const launchAppTimeoutMs = 90_000;
935
+ const installAppTimeoutMs = 10 * 60_000;
679
936
 
680
937
  MacosInstances.prototype.createClient = MacosInstancesHelpers.prototype.createClient;
681
938
 
@@ -1,6 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import type { AccessTokenCreateParams } from './access-tokens';
3
+ import {
4
+ type AccessTokenCreateParams,
5
+ TOKEN_SERVICE_URL,
6
+ tokenServiceBody,
7
+ withScopes,
8
+ } from './access-tokens';
4
9
  import { APIResource } from '../core/resource';
5
10
  import { APIPromise } from '../core/api-promise';
6
11
  import { RequestOptions } from '../internal/request-options';
@@ -11,10 +16,16 @@ export class ScopedTokens extends APIResource {
11
16
  * Mint a short-lived access token whose permissions limit what the holder can do, e.g.
12
17
  * install a specific asset on a device through the registry. The token is verified
13
18
  * by services holding the signing public key. It is bound to the caller's organization.
14
- * @deprecated Use client.accessTokens.create(). This method keeps the legacy URL.
19
+ * @deprecated Use client.accessTokens.create(), which this method now calls through to.
15
20
  */
16
21
  create(body: ScopedTokenCreateParams, options?: RequestOptions): APIPromise<ScopedToken> {
17
- return this._client.post('/v1/scoped_tokens', { body, ...options });
22
+ return this._client
23
+ .post<ScopedToken & { permissions: Array<string> }>('/v1/access_tokens', {
24
+ body: tokenServiceBody(body),
25
+ defaultBaseURL: TOKEN_SERVICE_URL,
26
+ ...options,
27
+ })
28
+ ._thenUnwrap(withScopes);
18
29
  }
19
30
  }
20
31
 
@@ -107,10 +107,13 @@ export interface PerformanceThread {
107
107
 
108
108
  /**
109
109
  * One running app's resource use at one moment, the figures Xcode's debug
110
- * gauges show. iOS instances sample every running app they installed once a
111
- * second, delivered live by `streamPerformance` and stored one-per-line in
112
- * `performance` artifacts. Rates cover the second since the previous sample of
113
- * the same process, so a process's first sample has none.
110
+ * gauges show. iOS and Android instances sample every running app you
111
+ * installed once a second, delivered live by `streamPerformance`; iOS also
112
+ * stores them one-per-line in `performance` artifacts. Rates cover the second
113
+ * since the previous sample of the same process, so a process's first sample
114
+ * has none. On Android only an app's main process is sampled, the footprint is
115
+ * its anonymous and shared memory in RAM plus swap, the peak is the highest
116
+ * sampled footprint, and disk rates are absent.
114
117
  */
115
118
  export interface PerformanceSample {
116
119
  /** Epoch milliseconds, same clock as SessionLogLine. */
@@ -34,6 +34,7 @@ import {
34
34
  isTestingAction,
35
35
  observeExecLogs,
36
36
  type AppStoreUploadConfig,
37
+ type AppStoreConnectTeamKey,
37
38
  type ExecChildProcess,
38
39
  type ExecLogOptions,
39
40
  type ExecLogResult,
@@ -42,7 +43,16 @@ import {
42
43
  type XctestEvent,
43
44
  } from '../exec-client';
44
45
 
45
- export type { AppStoreUploadConfig, ExecLogOptions, ExecLogResult, WebhookConfig } from '../exec-client';
46
+ export type {
47
+ AppStoreConnectInlineKey,
48
+ AppStoreConnectKey,
49
+ AppStoreConnectKeySecret,
50
+ AppStoreConnectTeamKey,
51
+ AppStoreUploadConfig,
52
+ ExecLogOptions,
53
+ ExecLogResult,
54
+ WebhookConfig,
55
+ } from '../exec-client';
46
56
  import {
47
57
  syncFolder as syncFolderImpl,
48
58
  type AdditionalFileSyncEntry,
@@ -218,6 +228,20 @@ export type XcodeSigningConfig = {
218
228
  * are matched to bundles by the application-identifier inside them.
219
229
  */
220
230
  provisioningProfilesBase64?: string[];
231
+ /**
232
+ * Secret ID or name/<exact name> holding the signing certificate, read by
233
+ * the build itself instead of certificateP12Base64 and certificatePassword.
234
+ * The value is the JSON saved for an appleCertificate. The instance role
235
+ * needs `secret:<target>:read`. Requires a server with credential secret
236
+ * support.
237
+ */
238
+ certificateSecret?: string;
239
+ /**
240
+ * Secrets holding provisioning profiles saved for appleProvisioningProfile.
241
+ * The build adds them to provisioningProfilesBase64. The instance role
242
+ * needs `secret:<target>:read` for each.
243
+ */
244
+ provisioningProfileSecrets?: string[];
221
245
  };
222
246
 
223
247
  export type XcodeCloudSigningMethod = 'app-store-connect' | 'release-testing' | 'debugging';
@@ -230,9 +254,6 @@ export type XcodeCloudSigningMethod = 'app-store-connect' | 'release-testing' |
230
254
  export type XcodeCloudSigningConfig = {
231
255
  method: XcodeCloudSigningMethod;
232
256
  teamId: string;
233
- apiKeyId: string;
234
- apiIssuerId: string;
235
- apiPrivateKeyBase64: string;
236
257
  /**
237
258
  * Base64-encoded entitlements plists keyed by bundle id, embedded into
238
259
  * the archive so cloud signing preserves capability entitlements
@@ -242,7 +263,7 @@ export type XcodeCloudSigningConfig = {
242
263
  * limbuild servers silently ignore this field.
243
264
  */
244
265
  entitlements?: Record<string, string>;
245
- };
266
+ } & AppStoreConnectTeamKey;
246
267
 
247
268
  export type ReactNativeBuildConfig = {
248
269
  /**
@@ -318,19 +339,23 @@ export type XcodeBuildOptions = {
318
339
  */
319
340
  gitInit?: boolean;
320
341
  /**
321
- * Build a Debug iOS simulator app whose Swift code later builds can replace
322
- * while it runs. When a later build with this option changed only Swift
323
- * code, the app on the attached simulator shows the edit as the build ends
324
- * and keeps its state; any other build is installed and launched as usual.
325
- * Lines starting with "Hot reload:" in the build output say which happened.
342
+ * Build a Debug app whose Swift code later builds can replace while it runs:
343
+ * an iOS simulator app on the attached simulator or, with the macosx sdk, a
344
+ * Mac app on the attached macOS instance. When a later build with this
345
+ * option changed only Swift code, the running app shows the edit as the
346
+ * build ends and keeps its state; any other build is installed and launched
347
+ * as usual. Lines starting with "Hot reload:" in the build output say which
348
+ * happened.
326
349
  *
327
- * Needs an attached simulator; without one the build is a normal Debug
328
- * build. Only the iphonesimulator sdk and the Debug configuration are
329
- * supported, and the configuration defaults to Debug. React Native and Expo
330
- * projects are built normally: Fast Refresh already shows their JavaScript
331
- * edits. Code that already ran, such as app startup, and closures created
332
- * before a reload keep their old behavior until the app restarts. Older
333
- * limbuild servers silently ignore this option.
350
+ * Needs the simulator or macOS instance to be attached; without it the
351
+ * build is a normal Debug build. Only the iphonesimulator and macosx sdks
352
+ * and the Debug configuration are supported, and the configuration defaults
353
+ * to Debug. React Native and Expo projects are built normally: Fast Refresh
354
+ * already shows their JavaScript edits. Code that already ran, such as app
355
+ * startup, and closures created before a reload keep their old behavior
356
+ * until the app restarts. Older limbuild servers silently ignore this
357
+ * option; one that reloads simulator apps only refuses it for the macosx
358
+ * sdk.
334
359
  */
335
360
  hotReload?: boolean;
336
361
  /** How xcodebuild stdout is processed before streaming. Defaults to 'xcbeautify'. */
@@ -1118,8 +1143,13 @@ export class XcodeInstances extends GeneratedXcodeInstances {
1118
1143
  if (options?.hotReload && settings?.configuration === 'Release') {
1119
1144
  throw new Error('hotReload is only supported for Debug builds');
1120
1145
  }
1121
- if (options?.hotReload && settings?.sdk !== undefined && settings.sdk !== 'iphonesimulator') {
1122
- throw new Error('hotReload requires the iphonesimulator sdk');
1146
+ if (
1147
+ options?.hotReload &&
1148
+ settings?.sdk !== undefined &&
1149
+ settings.sdk !== 'iphonesimulator' &&
1150
+ settings.sdk !== 'macosx'
1151
+ ) {
1152
+ throw new Error('hotReload requires the iphonesimulator or macosx sdk');
1123
1153
  }
1124
1154
  if (settings?.onlyTesting?.length && settings?.skipTesting?.length) {
1125
1155
  throw new Error('onlyTesting and skipTesting are mutually exclusive; pass one');
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.79.6'; // x-release-please-version
1
+ export const VERSION = '0.80.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.79.6";
1
+ export declare const VERSION = "0.80.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.79.6";
1
+ export declare const VERSION = "0.80.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.79.6'; // x-release-please-version
4
+ exports.VERSION = '0.80.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.79.6'; // x-release-please-version
1
+ export const VERSION = '0.80.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map