@anyharness/sdk 0.1.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.
@@ -0,0 +1,23 @@
1
+ import type { HealthResponse, AgentSummary, InstallAgentRequest, InstallAgentResponse, StartAgentLoginResponse, ProblemDetails } from "./types.js";
2
+ export interface AnyHarnessClientOptions {
3
+ baseUrl: string;
4
+ fetch?: typeof globalThis.fetch;
5
+ }
6
+ export declare class AnyHarnessError extends Error {
7
+ readonly problem: ProblemDetails;
8
+ constructor(problem: ProblemDetails, options?: ErrorOptions);
9
+ }
10
+ export declare class AnyHarnessClient {
11
+ private readonly baseUrl;
12
+ private readonly fetch;
13
+ constructor(options: AnyHarnessClientOptions);
14
+ getHealth(): Promise<HealthResponse>;
15
+ listAgents(): Promise<AgentSummary[]>;
16
+ getAgent(kind: string): Promise<AgentSummary>;
17
+ installAgent(kind: string, request?: InstallAgentRequest): Promise<InstallAgentResponse>;
18
+ startAgentLogin(kind: string): Promise<StartAgentLoginResponse>;
19
+ private get;
20
+ private post;
21
+ private handleResponse;
22
+ }
23
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC;AAED,qBAAa,eAAgB,SAAQ,KAAK;aAEtB,OAAO,EAAE,cAAc;gBAAvB,OAAO,EAAE,cAAc,EACvC,OAAO,CAAC,EAAE,YAAY;CAKzB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;gBAEpC,OAAO,EAAE,uBAAuB;IAStC,SAAS,IAAI,OAAO,CAAC,cAAc,CAAC;IAQpC,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAIrC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI7C,YAAY,CAChB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,oBAAoB,CAAC;IAO1B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;YAWvD,GAAG;YAQH,IAAI;YAYJ,cAAc;CAgB7B"}
package/dist/client.js ADDED
@@ -0,0 +1,76 @@
1
+ export class AnyHarnessError extends Error {
2
+ problem;
3
+ constructor(problem, options) {
4
+ super(problem.detail ?? problem.title, options);
5
+ this.problem = problem;
6
+ this.name = "AnyHarnessError";
7
+ }
8
+ }
9
+ export class AnyHarnessClient {
10
+ baseUrl;
11
+ fetch;
12
+ constructor(options) {
13
+ this.baseUrl = options.baseUrl.replace(/\/+$/, "");
14
+ this.fetch = options.fetch ?? globalThis.fetch.bind(globalThis);
15
+ }
16
+ // -----------------------------------------------------------------------
17
+ // Health
18
+ // -----------------------------------------------------------------------
19
+ async getHealth() {
20
+ return this.get("/health");
21
+ }
22
+ // -----------------------------------------------------------------------
23
+ // Agents
24
+ // -----------------------------------------------------------------------
25
+ async listAgents() {
26
+ return this.get("/v1/agents");
27
+ }
28
+ async getAgent(kind) {
29
+ return this.get(`/v1/agents/${encodeURIComponent(kind)}`);
30
+ }
31
+ async installAgent(kind, request = {}) {
32
+ return this.post(`/v1/agents/${encodeURIComponent(kind)}/install`, request);
33
+ }
34
+ async startAgentLogin(kind) {
35
+ return this.post(`/v1/agents/${encodeURIComponent(kind)}/login/start`, {});
36
+ }
37
+ // -----------------------------------------------------------------------
38
+ // Internal
39
+ // -----------------------------------------------------------------------
40
+ async get(path) {
41
+ const res = await this.fetch(`${this.baseUrl}${path}`, {
42
+ method: "GET",
43
+ headers: { accept: "application/json" },
44
+ });
45
+ return this.handleResponse(res);
46
+ }
47
+ async post(path, body) {
48
+ const res = await this.fetch(`${this.baseUrl}${path}`, {
49
+ method: "POST",
50
+ headers: {
51
+ "content-type": "application/json",
52
+ accept: "application/json",
53
+ },
54
+ body: JSON.stringify(body),
55
+ });
56
+ return this.handleResponse(res);
57
+ }
58
+ async handleResponse(res) {
59
+ if (!res.ok) {
60
+ let problem;
61
+ try {
62
+ problem = (await res.json());
63
+ }
64
+ catch {
65
+ problem = {
66
+ type: "about:blank",
67
+ title: res.statusText || "Request failed",
68
+ status: res.status,
69
+ };
70
+ }
71
+ throw new AnyHarnessError(problem);
72
+ }
73
+ return (await res.json());
74
+ }
75
+ }
76
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAEtB;IADlB,YACkB,OAAuB,EACvC,OAAsB;QAEtB,KAAK,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAHhC,YAAO,GAAP,OAAO,CAAgB;QAIvC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,MAAM,OAAO,gBAAgB;IACV,OAAO,CAAS;IAChB,KAAK,CAA0B;IAEhD,YAAY,OAAgC;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClE,CAAC;IAED,0EAA0E;IAC1E,SAAS;IACT,0EAA0E;IAE1E,KAAK,CAAC,SAAS;QACb,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AAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3B,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,cAAc,CAAI,GAAG,CAAC,CAAC;IACrC,CAAC;IAEO,KAAK,CAAC,cAAc,CAAI,GAAa;QAC3C,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,IAAI,OAAuB,CAAC;YAC5B,IAAI,CAAC;gBACH,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAmB,CAAC;YACjD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,GAAG;oBACR,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,GAAG,CAAC,UAAU,IAAI,gBAAgB;oBACzC,MAAM,EAAE,GAAG,CAAC,MAAM;iBACnB,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAM,CAAC;IACjC,CAAC;CACF"}
@@ -0,0 +1,335 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export interface paths {
6
+ "/health": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ get: operations["get_health"];
14
+ put?: never;
15
+ post?: never;
16
+ delete?: never;
17
+ options?: never;
18
+ head?: never;
19
+ patch?: never;
20
+ trace?: never;
21
+ };
22
+ "/v1/agents": {
23
+ parameters: {
24
+ query?: never;
25
+ header?: never;
26
+ path?: never;
27
+ cookie?: never;
28
+ };
29
+ get: operations["list_agents"];
30
+ put?: never;
31
+ post?: never;
32
+ delete?: never;
33
+ options?: never;
34
+ head?: never;
35
+ patch?: never;
36
+ trace?: never;
37
+ };
38
+ "/v1/agents/{kind}": {
39
+ parameters: {
40
+ query?: never;
41
+ header?: never;
42
+ path?: never;
43
+ cookie?: never;
44
+ };
45
+ get: operations["get_agent"];
46
+ put?: never;
47
+ post?: never;
48
+ delete?: never;
49
+ options?: never;
50
+ head?: never;
51
+ patch?: never;
52
+ trace?: never;
53
+ };
54
+ "/v1/agents/{kind}/install": {
55
+ parameters: {
56
+ query?: never;
57
+ header?: never;
58
+ path?: never;
59
+ cookie?: never;
60
+ };
61
+ get?: never;
62
+ put?: never;
63
+ post: operations["install_agent"];
64
+ delete?: never;
65
+ options?: never;
66
+ head?: never;
67
+ patch?: never;
68
+ trace?: never;
69
+ };
70
+ "/v1/agents/{kind}/login/start": {
71
+ parameters: {
72
+ query?: never;
73
+ header?: never;
74
+ path?: never;
75
+ cookie?: never;
76
+ };
77
+ get?: never;
78
+ put?: never;
79
+ post: operations["start_agent_login"];
80
+ delete?: never;
81
+ options?: never;
82
+ head?: never;
83
+ patch?: never;
84
+ trace?: never;
85
+ };
86
+ }
87
+ export type webhooks = Record<string, never>;
88
+ export interface components {
89
+ schemas: {
90
+ /** @enum {string} */
91
+ AgentCredentialState: "ready" | "missing_env" | "login_required" | "unknown";
92
+ /** @enum {string} */
93
+ AgentInstallState: "installed" | "install_required" | "installing" | "failed";
94
+ /** @enum {string} */
95
+ AgentReadinessState: "ready" | "install_required" | "credentials_required" | "login_required" | "unsupported" | "error";
96
+ AgentSummary: {
97
+ agentProcess: components["schemas"]["ArtifactStatus"];
98
+ credentialState: components["schemas"]["AgentCredentialState"];
99
+ displayName: string;
100
+ docsUrl?: string | null;
101
+ expectedEnvVars: string[];
102
+ kind: string;
103
+ message?: string | null;
104
+ native?: null | components["schemas"]["ArtifactStatus"];
105
+ nativeRequired: boolean;
106
+ readiness: components["schemas"]["AgentReadinessState"];
107
+ supportsLogin: boolean;
108
+ };
109
+ ArtifactStatus: {
110
+ installed: boolean;
111
+ message?: string | null;
112
+ path?: string | null;
113
+ role: string;
114
+ source?: string | null;
115
+ version?: string | null;
116
+ };
117
+ HealthResponse: {
118
+ runtimeHome: string;
119
+ status: string;
120
+ version: string;
121
+ };
122
+ InstallAgentRequest: {
123
+ agentProcessVersion?: string | null;
124
+ nativeVersion?: string | null;
125
+ reinstall?: boolean;
126
+ };
127
+ InstallAgentResponse: {
128
+ agent: components["schemas"]["AgentSummary"];
129
+ alreadyInstalled: boolean;
130
+ installedArtifacts: components["schemas"]["ArtifactStatus"][];
131
+ };
132
+ LoginCommand: {
133
+ args: string[];
134
+ program: string;
135
+ };
136
+ ProblemDetails: {
137
+ code?: string | null;
138
+ detail?: string | null;
139
+ instance?: string | null;
140
+ /** Format: int32 */
141
+ status: number;
142
+ title: string;
143
+ type: string;
144
+ };
145
+ StartAgentLoginRequest: Record<string, never>;
146
+ StartAgentLoginResponse: {
147
+ command: components["schemas"]["LoginCommand"];
148
+ kind: string;
149
+ label: string;
150
+ message?: string | null;
151
+ mode: string;
152
+ reusesUserState: boolean;
153
+ };
154
+ };
155
+ responses: never;
156
+ parameters: never;
157
+ requestBodies: never;
158
+ headers: never;
159
+ pathItems: never;
160
+ }
161
+ export type $defs = Record<string, never>;
162
+ export interface operations {
163
+ get_health: {
164
+ parameters: {
165
+ query?: never;
166
+ header?: never;
167
+ path?: never;
168
+ cookie?: never;
169
+ };
170
+ requestBody?: never;
171
+ responses: {
172
+ /** @description Runtime health check */
173
+ 200: {
174
+ headers: {
175
+ [name: string]: unknown;
176
+ };
177
+ content: {
178
+ "application/json": components["schemas"]["HealthResponse"];
179
+ };
180
+ };
181
+ };
182
+ };
183
+ list_agents: {
184
+ parameters: {
185
+ query?: never;
186
+ header?: never;
187
+ path?: never;
188
+ cookie?: never;
189
+ };
190
+ requestBody?: never;
191
+ responses: {
192
+ /** @description List all supported agents with readiness state */
193
+ 200: {
194
+ headers: {
195
+ [name: string]: unknown;
196
+ };
197
+ content: {
198
+ "application/json": components["schemas"]["AgentSummary"][];
199
+ };
200
+ };
201
+ };
202
+ };
203
+ get_agent: {
204
+ parameters: {
205
+ query?: never;
206
+ header?: never;
207
+ path: {
208
+ /** @description Agent kind identifier */
209
+ kind: string;
210
+ };
211
+ cookie?: never;
212
+ };
213
+ requestBody?: never;
214
+ responses: {
215
+ /** @description Agent readiness summary */
216
+ 200: {
217
+ headers: {
218
+ [name: string]: unknown;
219
+ };
220
+ content: {
221
+ "application/json": components["schemas"]["AgentSummary"];
222
+ };
223
+ };
224
+ /** @description Agent not found */
225
+ 404: {
226
+ headers: {
227
+ [name: string]: unknown;
228
+ };
229
+ content: {
230
+ "application/json": components["schemas"]["ProblemDetails"];
231
+ };
232
+ };
233
+ };
234
+ };
235
+ install_agent: {
236
+ parameters: {
237
+ query?: never;
238
+ header?: never;
239
+ path: {
240
+ /** @description Agent kind identifier */
241
+ kind: string;
242
+ };
243
+ cookie?: never;
244
+ };
245
+ requestBody: {
246
+ content: {
247
+ "application/json": components["schemas"]["InstallAgentRequest"];
248
+ };
249
+ };
250
+ responses: {
251
+ /** @description Agent installed successfully */
252
+ 200: {
253
+ headers: {
254
+ [name: string]: unknown;
255
+ };
256
+ content: {
257
+ "application/json": components["schemas"]["InstallAgentResponse"];
258
+ };
259
+ };
260
+ /** @description Agent not installable or not found */
261
+ 400: {
262
+ headers: {
263
+ [name: string]: unknown;
264
+ };
265
+ content: {
266
+ "application/json": components["schemas"]["ProblemDetails"];
267
+ };
268
+ };
269
+ /** @description Install failed */
270
+ 500: {
271
+ headers: {
272
+ [name: string]: unknown;
273
+ };
274
+ content: {
275
+ "application/json": components["schemas"]["ProblemDetails"];
276
+ };
277
+ };
278
+ /** @description Download or registry failed */
279
+ 502: {
280
+ headers: {
281
+ [name: string]: unknown;
282
+ };
283
+ content: {
284
+ "application/json": components["schemas"]["ProblemDetails"];
285
+ };
286
+ };
287
+ };
288
+ };
289
+ start_agent_login: {
290
+ parameters: {
291
+ query?: never;
292
+ header?: never;
293
+ path: {
294
+ /** @description Agent kind identifier */
295
+ kind: string;
296
+ };
297
+ cookie?: never;
298
+ };
299
+ requestBody: {
300
+ content: {
301
+ "application/json": components["schemas"]["StartAgentLoginRequest"];
302
+ };
303
+ };
304
+ responses: {
305
+ /** @description Login instructions returned */
306
+ 200: {
307
+ headers: {
308
+ [name: string]: unknown;
309
+ };
310
+ content: {
311
+ "application/json": components["schemas"]["StartAgentLoginResponse"];
312
+ };
313
+ };
314
+ /** @description Login not supported */
315
+ 400: {
316
+ headers: {
317
+ [name: string]: unknown;
318
+ };
319
+ content: {
320
+ "application/json": components["schemas"]["ProblemDetails"];
321
+ };
322
+ };
323
+ /** @description Agent not found */
324
+ 404: {
325
+ headers: {
326
+ [name: string]: unknown;
327
+ };
328
+ content: {
329
+ "application/json": components["schemas"]["ProblemDetails"];
330
+ };
331
+ };
332
+ };
333
+ };
334
+ }
335
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/generated/openapi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,KAAK;IAClB,SAAS,EAAE;QACP,UAAU,EAAE;YACR,KAAK,CAAC,EAAE,KAAK,CAAC;YACd,MAAM,CAAC,EAAE,KAAK,CAAC;YACf,IAAI,CAAC,EAAE,KAAK,CAAC;YACb,MAAM,CAAC,EAAE,KAAK,CAAC;SAClB,CAAC;QACF,GAAG,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;QAC9B,GAAG,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,CAAC,EAAE,KAAK,CAAC;QACb,MAAM,CAAC,EAAE,KAAK,CAAC;QACf,OAAO,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,CAAC,EAAE,KAAK,CAAC;QACb,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;KACjB,CAAC;IACF,YAAY,EAAE;QACV,UAAU,EAAE;YACR,KAAK,CAAC,EAAE,KAAK,CAAC;YACd,MAAM,CAAC,EAAE,KAAK,CAAC;YACf,IAAI,CAAC,EAAE,KAAK,CAAC;YACb,MAAM,CAAC,EAAE,KAAK,C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ACL,CAAC;CACL"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=openapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.js","sourceRoot":"","sources":["../../src/generated/openapi.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,4 @@
1
+ export { AnyHarnessClient, AnyHarnessError } from "./client.js";
2
+ export type { AnyHarnessClientOptions } from "./client.js";
3
+ export type { HealthResponse, AgentInstallState, AgentCredentialState, AgentReadinessState, ArtifactStatus, AgentSummary, InstallAgentRequest, InstallAgentResponse, LoginCommand, StartAgentLoginResponse, ProblemDetails, } from "./types.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,cAAc,GACf,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { AnyHarnessClient, AnyHarnessError } from "./client.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Public contract types for the AnyHarness runtime API.
3
+ *
4
+ * These are thin aliases over the generated OpenAPI schema types so the
5
+ * public SDK surface stays stable even if the generated module shape
6
+ * changes. The Rust `anyharness-contract` crate is the source of truth;
7
+ * run `pnpm generate` to regenerate.
8
+ */
9
+ import type { components } from "./generated/openapi.js";
10
+ export type HealthResponse = components["schemas"]["HealthResponse"];
11
+ export type AgentInstallState = components["schemas"]["AgentInstallState"];
12
+ export type AgentCredentialState = components["schemas"]["AgentCredentialState"];
13
+ export type AgentReadinessState = components["schemas"]["AgentReadinessState"];
14
+ export type ArtifactStatus = components["schemas"]["ArtifactStatus"];
15
+ export type AgentSummary = components["schemas"]["AgentSummary"];
16
+ export type InstallAgentRequest = components["schemas"]["InstallAgentRequest"];
17
+ export type InstallAgentResponse = components["schemas"]["InstallAgentResponse"];
18
+ export type LoginCommand = components["schemas"]["LoginCommand"];
19
+ export type StartAgentLoginResponse = components["schemas"]["StartAgentLoginResponse"];
20
+ export type ProblemDetails = components["schemas"]["ProblemDetails"];
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMzD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAMrE,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,CAAC;AAM/E,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAMrE,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC;AAMjE,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAMjF,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC;AACjE,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,yBAAyB,CAAC,CAAC;AAMvF,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Public contract types for the AnyHarness runtime API.
3
+ *
4
+ * These are thin aliases over the generated OpenAPI schema types so the
5
+ * public SDK surface stays stable even if the generated module shape
6
+ * changes. The Rust `anyharness-contract` crate is the source of truth;
7
+ * run `pnpm generate` to regenerate.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,520 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "AnyHarness Runtime API",
5
+ "description": "Local sidecar runtime for managing coding agent installations, credentials, and ACP sessions.",
6
+ "license": {
7
+ "name": "Apache-2.0",
8
+ "identifier": "Apache-2.0"
9
+ },
10
+ "version": "0.1.0"
11
+ },
12
+ "paths": {
13
+ "/health": {
14
+ "get": {
15
+ "tags": [
16
+ "health"
17
+ ],
18
+ "operationId": "get_health",
19
+ "responses": {
20
+ "200": {
21
+ "description": "Runtime health check",
22
+ "content": {
23
+ "application/json": {
24
+ "schema": {
25
+ "$ref": "#/components/schemas/HealthResponse"
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
31
+ }
32
+ },
33
+ "/v1/agents": {
34
+ "get": {
35
+ "tags": [
36
+ "agents"
37
+ ],
38
+ "operationId": "list_agents",
39
+ "responses": {
40
+ "200": {
41
+ "description": "List all supported agents with readiness state",
42
+ "content": {
43
+ "application/json": {
44
+ "schema": {
45
+ "type": "array",
46
+ "items": {
47
+ "$ref": "#/components/schemas/AgentSummary"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "/v1/agents/{kind}": {
57
+ "get": {
58
+ "tags": [
59
+ "agents"
60
+ ],
61
+ "operationId": "get_agent",
62
+ "parameters": [
63
+ {
64
+ "name": "kind",
65
+ "in": "path",
66
+ "description": "Agent kind identifier",
67
+ "required": true,
68
+ "schema": {
69
+ "type": "string"
70
+ }
71
+ }
72
+ ],
73
+ "responses": {
74
+ "200": {
75
+ "description": "Agent readiness summary",
76
+ "content": {
77
+ "application/json": {
78
+ "schema": {
79
+ "$ref": "#/components/schemas/AgentSummary"
80
+ }
81
+ }
82
+ }
83
+ },
84
+ "404": {
85
+ "description": "Agent not found",
86
+ "content": {
87
+ "application/json": {
88
+ "schema": {
89
+ "$ref": "#/components/schemas/ProblemDetails"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "/v1/agents/{kind}/install": {
98
+ "post": {
99
+ "tags": [
100
+ "agents"
101
+ ],
102
+ "operationId": "install_agent",
103
+ "parameters": [
104
+ {
105
+ "name": "kind",
106
+ "in": "path",
107
+ "description": "Agent kind identifier",
108
+ "required": true,
109
+ "schema": {
110
+ "type": "string"
111
+ }
112
+ }
113
+ ],
114
+ "requestBody": {
115
+ "content": {
116
+ "application/json": {
117
+ "schema": {
118
+ "$ref": "#/components/schemas/InstallAgentRequest"
119
+ }
120
+ }
121
+ },
122
+ "required": true
123
+ },
124
+ "responses": {
125
+ "200": {
126
+ "description": "Agent installed successfully",
127
+ "content": {
128
+ "application/json": {
129
+ "schema": {
130
+ "$ref": "#/components/schemas/InstallAgentResponse"
131
+ }
132
+ }
133
+ }
134
+ },
135
+ "400": {
136
+ "description": "Agent not installable or not found",
137
+ "content": {
138
+ "application/json": {
139
+ "schema": {
140
+ "$ref": "#/components/schemas/ProblemDetails"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "500": {
146
+ "description": "Install failed",
147
+ "content": {
148
+ "application/json": {
149
+ "schema": {
150
+ "$ref": "#/components/schemas/ProblemDetails"
151
+ }
152
+ }
153
+ }
154
+ },
155
+ "502": {
156
+ "description": "Download or registry failed",
157
+ "content": {
158
+ "application/json": {
159
+ "schema": {
160
+ "$ref": "#/components/schemas/ProblemDetails"
161
+ }
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ },
168
+ "/v1/agents/{kind}/login/start": {
169
+ "post": {
170
+ "tags": [
171
+ "agents"
172
+ ],
173
+ "operationId": "start_agent_login",
174
+ "parameters": [
175
+ {
176
+ "name": "kind",
177
+ "in": "path",
178
+ "description": "Agent kind identifier",
179
+ "required": true,
180
+ "schema": {
181
+ "type": "string"
182
+ }
183
+ }
184
+ ],
185
+ "requestBody": {
186
+ "content": {
187
+ "application/json": {
188
+ "schema": {
189
+ "$ref": "#/components/schemas/StartAgentLoginRequest"
190
+ }
191
+ }
192
+ },
193
+ "required": true
194
+ },
195
+ "responses": {
196
+ "200": {
197
+ "description": "Login instructions returned",
198
+ "content": {
199
+ "application/json": {
200
+ "schema": {
201
+ "$ref": "#/components/schemas/StartAgentLoginResponse"
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "400": {
207
+ "description": "Login not supported",
208
+ "content": {
209
+ "application/json": {
210
+ "schema": {
211
+ "$ref": "#/components/schemas/ProblemDetails"
212
+ }
213
+ }
214
+ }
215
+ },
216
+ "404": {
217
+ "description": "Agent not found",
218
+ "content": {
219
+ "application/json": {
220
+ "schema": {
221
+ "$ref": "#/components/schemas/ProblemDetails"
222
+ }
223
+ }
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
229
+ },
230
+ "components": {
231
+ "schemas": {
232
+ "AgentCredentialState": {
233
+ "type": "string",
234
+ "enum": [
235
+ "ready",
236
+ "missing_env",
237
+ "login_required",
238
+ "unknown"
239
+ ]
240
+ },
241
+ "AgentInstallState": {
242
+ "type": "string",
243
+ "enum": [
244
+ "installed",
245
+ "install_required",
246
+ "installing",
247
+ "failed"
248
+ ]
249
+ },
250
+ "AgentReadinessState": {
251
+ "type": "string",
252
+ "enum": [
253
+ "ready",
254
+ "install_required",
255
+ "credentials_required",
256
+ "login_required",
257
+ "unsupported",
258
+ "error"
259
+ ]
260
+ },
261
+ "AgentSummary": {
262
+ "type": "object",
263
+ "required": [
264
+ "kind",
265
+ "displayName",
266
+ "nativeRequired",
267
+ "agentProcess",
268
+ "credentialState",
269
+ "readiness",
270
+ "supportsLogin",
271
+ "expectedEnvVars"
272
+ ],
273
+ "properties": {
274
+ "agentProcess": {
275
+ "$ref": "#/components/schemas/ArtifactStatus"
276
+ },
277
+ "credentialState": {
278
+ "$ref": "#/components/schemas/AgentCredentialState"
279
+ },
280
+ "displayName": {
281
+ "type": "string"
282
+ },
283
+ "docsUrl": {
284
+ "type": [
285
+ "string",
286
+ "null"
287
+ ]
288
+ },
289
+ "expectedEnvVars": {
290
+ "type": "array",
291
+ "items": {
292
+ "type": "string"
293
+ }
294
+ },
295
+ "kind": {
296
+ "type": "string"
297
+ },
298
+ "message": {
299
+ "type": [
300
+ "string",
301
+ "null"
302
+ ]
303
+ },
304
+ "native": {
305
+ "oneOf": [
306
+ {
307
+ "type": "null"
308
+ },
309
+ {
310
+ "$ref": "#/components/schemas/ArtifactStatus"
311
+ }
312
+ ]
313
+ },
314
+ "nativeRequired": {
315
+ "type": "boolean"
316
+ },
317
+ "readiness": {
318
+ "$ref": "#/components/schemas/AgentReadinessState"
319
+ },
320
+ "supportsLogin": {
321
+ "type": "boolean"
322
+ }
323
+ }
324
+ },
325
+ "ArtifactStatus": {
326
+ "type": "object",
327
+ "required": [
328
+ "role",
329
+ "installed"
330
+ ],
331
+ "properties": {
332
+ "installed": {
333
+ "type": "boolean"
334
+ },
335
+ "message": {
336
+ "type": [
337
+ "string",
338
+ "null"
339
+ ]
340
+ },
341
+ "path": {
342
+ "type": [
343
+ "string",
344
+ "null"
345
+ ]
346
+ },
347
+ "role": {
348
+ "type": "string"
349
+ },
350
+ "source": {
351
+ "type": [
352
+ "string",
353
+ "null"
354
+ ]
355
+ },
356
+ "version": {
357
+ "type": [
358
+ "string",
359
+ "null"
360
+ ]
361
+ }
362
+ }
363
+ },
364
+ "HealthResponse": {
365
+ "type": "object",
366
+ "required": [
367
+ "status",
368
+ "version",
369
+ "runtimeHome"
370
+ ],
371
+ "properties": {
372
+ "runtimeHome": {
373
+ "type": "string"
374
+ },
375
+ "status": {
376
+ "type": "string"
377
+ },
378
+ "version": {
379
+ "type": "string"
380
+ }
381
+ }
382
+ },
383
+ "InstallAgentRequest": {
384
+ "type": "object",
385
+ "properties": {
386
+ "agentProcessVersion": {
387
+ "type": [
388
+ "string",
389
+ "null"
390
+ ]
391
+ },
392
+ "nativeVersion": {
393
+ "type": [
394
+ "string",
395
+ "null"
396
+ ]
397
+ },
398
+ "reinstall": {
399
+ "type": "boolean"
400
+ }
401
+ }
402
+ },
403
+ "InstallAgentResponse": {
404
+ "type": "object",
405
+ "required": [
406
+ "agent",
407
+ "alreadyInstalled",
408
+ "installedArtifacts"
409
+ ],
410
+ "properties": {
411
+ "agent": {
412
+ "$ref": "#/components/schemas/AgentSummary"
413
+ },
414
+ "alreadyInstalled": {
415
+ "type": "boolean"
416
+ },
417
+ "installedArtifacts": {
418
+ "type": "array",
419
+ "items": {
420
+ "$ref": "#/components/schemas/ArtifactStatus"
421
+ }
422
+ }
423
+ }
424
+ },
425
+ "LoginCommand": {
426
+ "type": "object",
427
+ "required": [
428
+ "program",
429
+ "args"
430
+ ],
431
+ "properties": {
432
+ "args": {
433
+ "type": "array",
434
+ "items": {
435
+ "type": "string"
436
+ }
437
+ },
438
+ "program": {
439
+ "type": "string"
440
+ }
441
+ }
442
+ },
443
+ "ProblemDetails": {
444
+ "type": "object",
445
+ "required": [
446
+ "type",
447
+ "title",
448
+ "status"
449
+ ],
450
+ "properties": {
451
+ "code": {
452
+ "type": [
453
+ "string",
454
+ "null"
455
+ ]
456
+ },
457
+ "detail": {
458
+ "type": [
459
+ "string",
460
+ "null"
461
+ ]
462
+ },
463
+ "instance": {
464
+ "type": [
465
+ "string",
466
+ "null"
467
+ ]
468
+ },
469
+ "status": {
470
+ "type": "integer",
471
+ "format": "int32",
472
+ "minimum": 0
473
+ },
474
+ "title": {
475
+ "type": "string"
476
+ },
477
+ "type": {
478
+ "type": "string"
479
+ }
480
+ }
481
+ },
482
+ "StartAgentLoginRequest": {
483
+ "type": "object"
484
+ },
485
+ "StartAgentLoginResponse": {
486
+ "type": "object",
487
+ "required": [
488
+ "kind",
489
+ "label",
490
+ "mode",
491
+ "command",
492
+ "reusesUserState"
493
+ ],
494
+ "properties": {
495
+ "command": {
496
+ "$ref": "#/components/schemas/LoginCommand"
497
+ },
498
+ "kind": {
499
+ "type": "string"
500
+ },
501
+ "label": {
502
+ "type": "string"
503
+ },
504
+ "message": {
505
+ "type": [
506
+ "string",
507
+ "null"
508
+ ]
509
+ },
510
+ "mode": {
511
+ "type": "string"
512
+ },
513
+ "reusesUserState": {
514
+ "type": "boolean"
515
+ }
516
+ }
517
+ }
518
+ }
519
+ }
520
+ }
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@anyharness/sdk",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript SDK for the AnyHarness runtime API",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "generated/openapi.json"
17
+ ],
18
+ "scripts": {
19
+ "generate:openapi": "cd ../.. && cargo run -- print-openapi > packages/sdk-ts/generated/openapi.json",
20
+ "generate:types": "npx openapi-typescript generated/openapi.json -o src/generated/openapi.ts",
21
+ "generate": "npm run generate:openapi && npm run generate:types",
22
+ "build": "tsc",
23
+ "typecheck": "tsc --noEmit"
24
+ },
25
+ "license": "Apache-2.0",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/nicobailon/anyharness",
29
+ "directory": "packages/sdk-ts"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "devDependencies": {
35
+ "openapi-typescript": "^7.13.0",
36
+ "typescript": "^5.7.0"
37
+ }
38
+ }