agent-device 0.11.10 → 0.11.12
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/src/113.js +3 -0
- package/dist/src/320.js +1 -0
- package/dist/src/818.js +3 -0
- package/dist/src/957.js +2 -0
- package/dist/src/974.js +2 -0
- package/dist/src/995.js +1 -3
- package/dist/src/bin.js +59 -61
- package/dist/src/contracts.d.ts +135 -0
- package/dist/src/contracts.js +1 -0
- package/dist/src/daemon.js +43 -43
- package/dist/src/index.d.ts +65 -39
- package/dist/src/index.js +2 -4
- package/dist/src/metro-companion.js +1 -0
- package/dist/src/metro.d.ts +197 -0
- package/dist/src/metro.js +1 -0
- package/dist/src/remote-config.d.ts +49 -0
- package/dist/src/remote-config.js +1 -0
- package/dist/src/update-check-entry.js +1 -0
- package/package.json +13 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export declare type DaemonArtifact = {
|
|
2
|
+
field: string;
|
|
3
|
+
artifactId?: string;
|
|
4
|
+
fileName?: string;
|
|
5
|
+
localPath?: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export declare const daemonCommandRequestSchema: RuntimeSchema<DaemonRequest>;
|
|
10
|
+
|
|
11
|
+
export declare type DaemonError = {
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
hint?: string;
|
|
15
|
+
diagnosticId?: string;
|
|
16
|
+
logPath?: string;
|
|
17
|
+
details?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export declare type DaemonInstallSource = {
|
|
21
|
+
kind: 'url';
|
|
22
|
+
url: string;
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'path';
|
|
26
|
+
path: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export declare type DaemonLockPolicy = 'reject' | 'strip';
|
|
30
|
+
|
|
31
|
+
export declare type DaemonRequest = {
|
|
32
|
+
token?: string;
|
|
33
|
+
session?: string;
|
|
34
|
+
command: string;
|
|
35
|
+
positionals: string[];
|
|
36
|
+
flags?: Record<string, unknown>;
|
|
37
|
+
runtime?: SessionRuntimeHints;
|
|
38
|
+
meta?: DaemonRequestMeta;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export declare type DaemonRequestMeta = {
|
|
42
|
+
requestId?: string;
|
|
43
|
+
debug?: boolean;
|
|
44
|
+
cwd?: string;
|
|
45
|
+
tenantId?: string;
|
|
46
|
+
runId?: string;
|
|
47
|
+
leaseId?: string;
|
|
48
|
+
leaseTtlMs?: number;
|
|
49
|
+
leaseBackend?: LeaseBackend;
|
|
50
|
+
sessionIsolation?: 'none' | 'tenant';
|
|
51
|
+
uploadedArtifactId?: string;
|
|
52
|
+
clientArtifactPaths?: Record<string, string>;
|
|
53
|
+
installSource?: DaemonInstallSource;
|
|
54
|
+
retainMaterializedPaths?: boolean;
|
|
55
|
+
materializedPathRetentionMs?: number;
|
|
56
|
+
materializationId?: string;
|
|
57
|
+
lockPolicy?: DaemonLockPolicy;
|
|
58
|
+
lockPlatform?: 'ios' | 'macos' | 'android' | 'linux' | 'apple';
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export declare type DaemonResponse = {
|
|
62
|
+
ok: true;
|
|
63
|
+
data?: DaemonResponseData;
|
|
64
|
+
} | {
|
|
65
|
+
ok: false;
|
|
66
|
+
error: DaemonError;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export declare type DaemonResponseData = Record<string, unknown> & {
|
|
70
|
+
artifacts?: DaemonArtifact[];
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export declare const daemonRuntimeSchema: RuntimeSchema<SessionRuntimeHints>;
|
|
74
|
+
|
|
75
|
+
export declare type JsonRpcId = string | number | null;
|
|
76
|
+
|
|
77
|
+
export declare type JsonRpcRequestEnvelope<TParams = unknown> = {
|
|
78
|
+
jsonrpc?: string;
|
|
79
|
+
id?: JsonRpcId;
|
|
80
|
+
method?: string;
|
|
81
|
+
params?: TParams;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export declare const jsonRpcRequestSchema: RuntimeSchema<JsonRpcRequestEnvelope<unknown>>;
|
|
85
|
+
|
|
86
|
+
export declare type LeaseAllocatePayload = {
|
|
87
|
+
token?: string;
|
|
88
|
+
session?: string;
|
|
89
|
+
tenantId?: string;
|
|
90
|
+
tenant?: string;
|
|
91
|
+
runId?: string;
|
|
92
|
+
ttlMs?: number;
|
|
93
|
+
backend?: LeaseBackend;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export declare const leaseAllocateSchema: RuntimeSchema<LeaseAllocatePayload>;
|
|
97
|
+
|
|
98
|
+
export declare type LeaseBackend = 'ios-simulator' | 'ios-instance' | 'android-instance';
|
|
99
|
+
|
|
100
|
+
export declare type LeaseHeartbeatPayload = {
|
|
101
|
+
token?: string;
|
|
102
|
+
session?: string;
|
|
103
|
+
tenantId?: string;
|
|
104
|
+
tenant?: string;
|
|
105
|
+
runId?: string;
|
|
106
|
+
leaseId?: string;
|
|
107
|
+
ttlMs?: number;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export declare const leaseHeartbeatSchema: RuntimeSchema<LeaseHeartbeatPayload>;
|
|
111
|
+
|
|
112
|
+
export declare type LeaseReleasePayload = {
|
|
113
|
+
token?: string;
|
|
114
|
+
session?: string;
|
|
115
|
+
tenantId?: string;
|
|
116
|
+
tenant?: string;
|
|
117
|
+
runId?: string;
|
|
118
|
+
leaseId?: string;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export declare const leaseReleaseSchema: RuntimeSchema<LeaseReleasePayload>;
|
|
122
|
+
|
|
123
|
+
declare type RuntimeSchema<T> = {
|
|
124
|
+
parse(input: unknown): T;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export declare type SessionRuntimeHints = {
|
|
128
|
+
platform?: 'ios' | 'android';
|
|
129
|
+
metroHost?: string;
|
|
130
|
+
metroPort?: number;
|
|
131
|
+
bundleUrl?: string;
|
|
132
|
+
launchUrl?: string;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return{parse:t=>e(t,"$")}}function t(e,t){throw Error(`${e}: ${t}`)}function n(e,n){return(!e||"object"!=typeof e||Array.isArray(e))&&t(n,"Expected an object"),e}function a(e,n){return"string"!=typeof e&&t(n,"Expected a string"),e}function o(e,t,n){let o=e[t];return void 0===o?void 0:a(o,`${n}.${t}`)}function r(e,n,a){let o=e[n];if(void 0!==o)return"boolean"!=typeof o&&t(`${a}.${n}`,"Expected a boolean"),o}function i(e,n,a){var o;let r=e[n];return void 0===r?void 0:(o=`${a}.${n}`,Number.isInteger(r)||t(o,"Expected an integer"),r)}function s(e,t,a){let o=e[t];return void 0===o?void 0:n(o,`${a}.${t}`)}function l(e,n,a,o){let r=e[n];if(void 0!==r)return"string"==typeof r&&a.includes(r)||t(`${o}.${n}`,`Expected one of: ${a.join(", ")}`),r}function d(e,t){let o=n(e,t),r={};for(let[e,n]of Object.entries(o))r[e]=a(n,`${t}.${e}`);return r}let c=e((e,t)=>{let a=n(e,t);return{platform:l(a,"platform",["ios","android"],t),metroHost:o(a,"metroHost",t),metroPort:i(a,"metroPort",t),bundleUrl:o(a,"bundleUrl",t),launchUrl:o(a,"launchUrl",t)}}),u=e((e,u)=>{var m,$;let p=n(e,u),f=(m=p.positionals,$=`${u}.positionals`,Array.isArray(m)||t($,"Expected an array"),m),I=s(p,"meta",u);return{token:o(p,"token",u),session:o(p,"session",u),command:a(p.command,`${u}.command`),positionals:f.map((e,t)=>a(e,`${u}.positionals[${String(t)}]`)),flags:s(p,"flags",u),runtime:void 0===p.runtime?void 0:c.parse(p.runtime),meta:void 0===I?void 0:{requestId:o(I,"requestId",`${u}.meta`),debug:r(I,"debug",`${u}.meta`),cwd:o(I,"cwd",`${u}.meta`),tenantId:o(I,"tenantId",`${u}.meta`),runId:o(I,"runId",`${u}.meta`),leaseId:o(I,"leaseId",`${u}.meta`),leaseTtlMs:i(I,"leaseTtlMs",`${u}.meta`),leaseBackend:l(I,"leaseBackend",["ios-simulator","ios-instance","android-instance"],`${u}.meta`),sessionIsolation:l(I,"sessionIsolation",["none","tenant"],`${u}.meta`),uploadedArtifactId:o(I,"uploadedArtifactId",`${u}.meta`),clientArtifactPaths:void 0===I.clientArtifactPaths?void 0:d(I.clientArtifactPaths,`${u}.meta.clientArtifactPaths`),installSource:void 0===I.installSource?void 0:function(e,o){let r=n(e,o),i=a(r.kind,`${o}.kind`);if("url"===i){let e=a(r.url,`${o}.url`),t=void 0===r.headers?void 0:d(r.headers,`${o}.headers`);return t?{kind:i,url:e,headers:t}:{kind:i,url:e}}if("path"===i)return{kind:i,path:a(r.path,`${o}.path`)};t(`${o}.kind`,'Expected "url" or "path"')}(I.installSource,`${u}.meta.installSource`),retainMaterializedPaths:r(I,"retainMaterializedPaths",`${u}.meta`),materializedPathRetentionMs:i(I,"materializedPathRetentionMs",`${u}.meta`),materializationId:o(I,"materializationId",`${u}.meta`),lockPolicy:l(I,"lockPolicy",["reject","strip"],`${u}.meta`),lockPlatform:l(I,"lockPlatform",["ios","macos","android","linux","apple"],`${u}.meta`)}}}),m=e((e,t)=>{let a=n(e,t);return{token:o(a,"token",t),session:o(a,"session",t),tenantId:o(a,"tenantId",t),tenant:o(a,"tenant",t),runId:o(a,"runId",t),ttlMs:i(a,"ttlMs",t),backend:l(a,"backend",["ios-simulator","ios-instance","android-instance"],t)}}),$=e((e,t)=>{let a,r={token:o(a=n(e,t),"token",t),session:o(a,"session",t),leaseId:o(a,"leaseId",t),ttlMs:i(a,"ttlMs",t)},s=n(e,t);return{token:r.token,session:r.session,tenantId:o(s,"tenantId",t),tenant:o(s,"tenant",t),runId:o(s,"runId",t),leaseId:r.leaseId,ttlMs:r.ttlMs}}),p=e((e,a)=>{let r=n(e,a);return void 0!==r.ttlMs&&t(`${a}.ttlMs`,"Unexpected field"),{token:o(r,"token",a),session:o(r,"session",a),tenantId:o(r,"tenantId",a),tenant:o(r,"tenant",a),runId:o(r,"runId",a),leaseId:o(r,"leaseId",a)}}),f=e((e,a)=>{let r,i=n(e,a);return{jsonrpc:o(i,"jsonrpc",a),id:(null==(r=i.id)||"string"!=typeof r&&"number"!=typeof r&&t(`${a}.id`,"Expected a string, number, or null"),r),method:o(i,"method",a),params:i.params}});export{u as daemonCommandRequestSchema,c as daemonRuntimeSchema,f as jsonRpcRequestSchema,m as leaseAllocateSchema,$ as leaseHeartbeatSchema,p as leaseReleaseSchema};
|