agent-device 0.8.2 → 0.8.3

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/README.md CHANGED
@@ -35,56 +35,7 @@ Or use it without installing:
35
35
  npx agent-device open SampleApp
36
36
  ```
37
37
 
38
- Use the typed daemon client from application code:
39
-
40
- ```ts
41
- import { createAgentDeviceClient } from 'agent-device';
42
-
43
- const client = createAgentDeviceClient({
44
- session: 'qa-ios',
45
- lockPolicy: 'reject',
46
- lockPlatform: 'ios',
47
- });
48
-
49
- const devices = await client.devices.list({ platform: 'ios' });
50
- const ensured = await client.simulators.ensure({
51
- device: 'iPhone 16',
52
- boot: true,
53
- });
54
-
55
- await client.apps.open({
56
- app: 'com.apple.Preferences',
57
- platform: 'ios',
58
- udid: ensured.udid,
59
- runtime: {
60
- metroHost: '127.0.0.1',
61
- metroPort: 8081,
62
- },
63
- });
64
-
65
- const snapshot = await client.capture.snapshot({ interactiveOnly: true });
66
- const androidClient = createAgentDeviceClient({ session: 'qa-android' });
67
- const installed = await androidClient.apps.installFromSource({
68
- platform: 'android',
69
- retainPaths: true,
70
- retentionMs: 60_000,
71
- source: { kind: 'url', url: 'https://example.com/app.apk' },
72
- });
73
- await androidClient.apps.open({ app: installed.launchTarget, platform: 'android' });
74
- console.log(installed.installablePath, installed.materializationId);
75
- if (installed.materializationId) {
76
- await androidClient.materializations.release({
77
- materializationId: installed.materializationId,
78
- });
79
- }
80
- await client.sessions.close();
81
- await androidClient.sessions.close();
82
- ```
83
-
84
- `installFromSource` URL sources are intentionally limited:
85
- - Private and loopback hosts are blocked by default.
86
- - Archive-backed URL installs are only supported for trusted artifact services, currently GitHub Actions and EAS.
87
- - For other hosts, prefer `source: { kind: 'path', path: ... }` so the client downloads/uploads the artifact explicitly.
38
+ For the typed daemon client and `installFromSource` behavior, see [website/docs/docs/client-api.md](website/docs/docs/client-api.md).
88
39
 
89
40
  The skill is also accessible on [ClawHub](https://clawhub.ai/okwasniewski/agent-device).
90
41
  For structured exploratory QA workflows, use the dogfood skill at [skills/dogfood/SKILL.md](skills/dogfood/SKILL.md).
@@ -1,10 +1,44 @@
1
+ import { getRequestSignal } from '../request-cancel.ts';
1
2
  import { SessionStore } from '../session-store.ts';
2
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
3
+ import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
4
+ import type { MaterializeInstallSource } from '../../platforms/install-source.ts';
5
+ type PreparedIosInstallArtifact = {
6
+ archivePath?: string;
7
+ installablePath: string;
8
+ bundleId?: string;
9
+ appName?: string;
10
+ cleanup: () => Promise<void>;
11
+ };
12
+ type PreparedAndroidInstallArtifact = {
13
+ archivePath?: string;
14
+ installablePath: string;
15
+ packageName?: string;
16
+ cleanup: () => Promise<void>;
17
+ };
18
+ declare function resolveInstallDevice(params: {
19
+ session: SessionState | undefined;
20
+ flags: DaemonRequest['flags'] | undefined;
21
+ }): Promise<SessionState['device']>;
3
22
  export declare function handleInstallFromSourceCommand(params: {
4
23
  req: DaemonRequest;
5
24
  sessionName: string;
6
25
  sessionStore: SessionStore;
26
+ deps?: {
27
+ resolveInstallDevice?: typeof resolveInstallDevice;
28
+ getRequestSignal?: typeof getRequestSignal;
29
+ prepareIosInstallArtifact?: (source: MaterializeInstallSource, options?: {
30
+ signal?: AbortSignal;
31
+ }) => Promise<PreparedIosInstallArtifact>;
32
+ installIosInstallablePath?: (device: SessionState['device'], installablePath: string) => Promise<void>;
33
+ prepareAndroidInstallArtifact?: (source: MaterializeInstallSource, options?: {
34
+ signal?: AbortSignal;
35
+ resolveIdentity?: boolean;
36
+ }) => Promise<PreparedAndroidInstallArtifact>;
37
+ installAndroidInstallablePathAndResolvePackageName?: (device: SessionState['device'], installablePath: string, packageNameHint?: string) => Promise<string | undefined>;
38
+ inferAndroidAppName?: (packageName: string) => string;
39
+ };
7
40
  }): Promise<DaemonResponse>;
8
41
  export declare function handleReleaseMaterializedPathsCommand(params: {
9
42
  req: DaemonRequest;
10
43
  }): Promise<DaemonResponse>;
44
+ export {};