@getsupervisor/agents-studio-sdk 1.0.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/dist/index.js ADDED
@@ -0,0 +1,282 @@
1
+ // src/errors.ts
2
+ var HttpError = class extends Error {
3
+ constructor(status, statusText, body, url) {
4
+ super(`HTTP ${status} ${statusText}`);
5
+ this.status = status;
6
+ this.statusText = statusText;
7
+ this.body = body;
8
+ this.url = url;
9
+ this.name = "HttpError";
10
+ }
11
+ };
12
+ var TimeoutError = class extends Error {
13
+ constructor(ms, url) {
14
+ super(`Timeout after ${ms}ms`);
15
+ this.ms = ms;
16
+ this.url = url;
17
+ this.name = "TimeoutError";
18
+ }
19
+ };
20
+ var NetworkError = class extends Error {
21
+ constructor(cause, url) {
22
+ super("Network error");
23
+ this.cause = cause;
24
+ this.url = url;
25
+ this.name = "NetworkError";
26
+ }
27
+ };
28
+
29
+ // src/http.ts
30
+ function sleep(ms) {
31
+ return new Promise((r) => setTimeout(r, ms));
32
+ }
33
+ async function withTimeout(p, ms, ab, url) {
34
+ return new Promise((resolve, reject) => {
35
+ const to = setTimeout(() => {
36
+ ab?.abort();
37
+ reject(new TimeoutError(ms, url));
38
+ }, ms);
39
+ p.then((v) => {
40
+ clearTimeout(to);
41
+ resolve(v);
42
+ }).catch((e) => {
43
+ clearTimeout(to);
44
+ reject(e);
45
+ });
46
+ });
47
+ }
48
+ async function withRetry(fn, policy) {
49
+ const max = policy?.maxRetries ?? 2;
50
+ const base = policy?.baseDelayMs ?? 300;
51
+ const maxDelay = policy?.maxDelayMs ?? 3e3;
52
+ const retryOn = policy?.retryOn ?? ((err) => err instanceof NetworkError || err instanceof HttpError && err.status >= 500);
53
+ let attempt = 0;
54
+ while (true) {
55
+ try {
56
+ return await fn(attempt);
57
+ } catch (e) {
58
+ if (attempt >= max || !retryOn(e, attempt)) throw e;
59
+ const delay = Math.min(maxDelay, base * 2 ** attempt) + Math.floor(Math.random() * 100);
60
+ await sleep(delay);
61
+ attempt += 1;
62
+ }
63
+ }
64
+ }
65
+ function createHttp(cfg) {
66
+ const base = cfg.baseUrl.replace(/\/$/, "");
67
+ const fx = cfg.fetchImpl ?? fetch;
68
+ const headers = cfg.headers ?? {};
69
+ const timeout = cfg.timeoutMs ?? 35e3;
70
+ const log = cfg.logger ?? {};
71
+ const retry = cfg.retry;
72
+ async function doFetch(url, init) {
73
+ const ab = new AbortController();
74
+ const req = async () => {
75
+ try {
76
+ const res = await withTimeout(
77
+ fx(url, { ...init, signal: ab.signal }),
78
+ timeout,
79
+ ab,
80
+ url
81
+ );
82
+ if (!res.ok) {
83
+ const body = await res.clone().json().catch(() => void 0);
84
+ throw new HttpError(res.status, res.statusText, body, url);
85
+ }
86
+ return res;
87
+ } catch (e) {
88
+ if (e.name === "AbortError") throw new TimeoutError(timeout, url);
89
+ if (e instanceof HttpError) throw e;
90
+ throw new NetworkError(e, url);
91
+ }
92
+ };
93
+ return withRetry(req, retry);
94
+ }
95
+ return { base, headers, timeout, log, retry, doFetch };
96
+ }
97
+
98
+ // src/api/agents.ts
99
+ function createAgentsApi(cfg) {
100
+ const { base, headers, doFetch } = createHttp(cfg);
101
+ return {
102
+ async get(agentId) {
103
+ const res = await doFetch(`${base}/v1/agents/${agentId}`, {
104
+ method: "GET",
105
+ headers
106
+ });
107
+ return res.json();
108
+ },
109
+ async delete(agentId) {
110
+ await doFetch(`${base}/v1/agents/${agentId}`, {
111
+ method: "DELETE",
112
+ headers
113
+ });
114
+ }
115
+ };
116
+ }
117
+
118
+ // src/api/agent-knowledge.ts
119
+ function createAgentKnowledgeApi(cfg) {
120
+ const { base, headers, doFetch } = createHttp(cfg);
121
+ const jsonHeaders = { "content-type": "application/json", ...headers };
122
+ return {
123
+ async upload(agentId, payload) {
124
+ const res = await doFetch(
125
+ `${base}/v1/agents/${agentId}/knowledge/upload`,
126
+ {
127
+ method: "POST",
128
+ headers: jsonHeaders,
129
+ body: JSON.stringify(payload)
130
+ }
131
+ );
132
+ return res.json();
133
+ },
134
+ async listBases(agentId) {
135
+ const res = await doFetch(
136
+ `${base}/v1/agents/${agentId}/knowledge/bases`,
137
+ {
138
+ method: "GET",
139
+ headers
140
+ }
141
+ );
142
+ return res.json();
143
+ },
144
+ async listUploads(agentId) {
145
+ const res = await doFetch(
146
+ `${base}/v1/agents/${agentId}/knowledge/uploads`,
147
+ {
148
+ method: "GET",
149
+ headers
150
+ }
151
+ );
152
+ return res.json();
153
+ }
154
+ };
155
+ }
156
+
157
+ // src/api/agent-instructions.ts
158
+ function createAgentInstructionsApi(cfg) {
159
+ const { base, headers, doFetch } = createHttp(cfg);
160
+ const jsonHeaders = { "content-type": "application/json", ...headers };
161
+ return {
162
+ async list(agentId, opts) {
163
+ const search = opts?.versionId ? `?versionId=${encodeURIComponent(opts.versionId)}` : "";
164
+ const res = await doFetch(
165
+ `${base}/v1/agents/${agentId}/instructions${search}`,
166
+ {
167
+ method: "GET",
168
+ headers
169
+ }
170
+ );
171
+ return res.json();
172
+ },
173
+ async create(agentId, payload) {
174
+ const res = await doFetch(`${base}/v1/agents/${agentId}/instructions`, {
175
+ method: "POST",
176
+ headers: jsonHeaders,
177
+ body: JSON.stringify(payload)
178
+ });
179
+ return res.json();
180
+ }
181
+ };
182
+ }
183
+
184
+ // src/api/agent-phones.ts
185
+ function createAgentPhonesApi(cfg) {
186
+ const { base, headers, doFetch } = createHttp(cfg);
187
+ const jsonHeaders = { "content-type": "application/json", ...headers };
188
+ return {
189
+ async connect(agentId, payload) {
190
+ const res = await doFetch(`${base}/v1/agents/${agentId}/phones`, {
191
+ method: "POST",
192
+ headers: jsonHeaders,
193
+ body: JSON.stringify(payload)
194
+ });
195
+ return res.json();
196
+ },
197
+ async disconnect(agentId, phoneId) {
198
+ await doFetch(`${base}/v1/agents/${agentId}/phones/${phoneId}`, {
199
+ method: "DELETE",
200
+ headers
201
+ });
202
+ }
203
+ };
204
+ }
205
+
206
+ // src/api/workspaces.ts
207
+ function createWorkspacesApi(cfg) {
208
+ const { base, headers, doFetch } = createHttp(cfg);
209
+ const jsonHeaders = { "content-type": "application/json", ...headers };
210
+ return {
211
+ async listPhones(workspaceId, opts) {
212
+ const search = opts?.channel ? `?channel=${opts.channel}` : "";
213
+ const res = await doFetch(
214
+ `${base}/v1/workspaces/${workspaceId}/phones${search}`,
215
+ {
216
+ method: "GET",
217
+ headers
218
+ }
219
+ );
220
+ return res.json();
221
+ },
222
+ async enable(workspaceId, payload) {
223
+ const res = await doFetch(`${base}/v1/workspaces/${workspaceId}/enable`, {
224
+ method: "POST",
225
+ headers: jsonHeaders,
226
+ body: JSON.stringify(payload)
227
+ });
228
+ return res.json();
229
+ }
230
+ };
231
+ }
232
+
233
+ // src/api/tools.ts
234
+ function createToolsApi(cfg) {
235
+ const { base, headers, doFetch } = createHttp(cfg);
236
+ const jsonHeaders = { "content-type": "application/json", ...headers };
237
+ return {
238
+ async list() {
239
+ const res = await doFetch(`${base}/v1/tools`, {
240
+ method: "GET",
241
+ headers
242
+ });
243
+ return res.json();
244
+ },
245
+ async execute(toolId, payload) {
246
+ const res = await doFetch(`${base}/v1/tools/${toolId}/execute`, {
247
+ method: "POST",
248
+ headers: jsonHeaders,
249
+ body: JSON.stringify(payload)
250
+ });
251
+ return res.json();
252
+ }
253
+ };
254
+ }
255
+
256
+ // src/client.ts
257
+ function createClient(cfg) {
258
+ return {
259
+ agents: {
260
+ ...createAgentsApi(cfg),
261
+ knowledge: createAgentKnowledgeApi(cfg),
262
+ instructions: createAgentInstructionsApi(cfg),
263
+ phones: createAgentPhonesApi(cfg)
264
+ },
265
+ workspaces: createWorkspacesApi(cfg),
266
+ tools: createToolsApi(cfg)
267
+ };
268
+ }
269
+ export {
270
+ HttpError,
271
+ NetworkError,
272
+ TimeoutError,
273
+ createAgentInstructionsApi,
274
+ createAgentKnowledgeApi,
275
+ createAgentPhonesApi,
276
+ createAgentsApi,
277
+ createClient,
278
+ createHttp,
279
+ createToolsApi,
280
+ createWorkspacesApi
281
+ };
282
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts","../src/http.ts","../src/api/agents.ts","../src/api/agent-knowledge.ts","../src/api/agent-instructions.ts","../src/api/agent-phones.ts","../src/api/workspaces.ts","../src/api/tools.ts","../src/client.ts"],"sourcesContent":["export class HttpError extends Error {\n constructor(\n public status: number,\n public statusText: string,\n public body?: unknown,\n public url?: string,\n ) {\n super(`HTTP ${status} ${statusText}`);\n this.name = 'HttpError';\n }\n}\n\nexport class TimeoutError extends Error {\n constructor(\n public ms: number,\n public url?: string,\n ) {\n super(`Timeout after ${ms}ms`);\n this.name = 'TimeoutError';\n }\n}\n\nexport class NetworkError extends Error {\n constructor(\n public cause?: unknown,\n public url?: string,\n ) {\n super('Network error');\n this.name = 'NetworkError';\n }\n}\n\nexport type RetryPolicy = {\n maxRetries?: number; // default 2\n baseDelayMs?: number; // default 300\n maxDelayMs?: number; // default 3000\n retryOn?: (err: unknown, attempt: number) => boolean; // default: network or 5xx\n};\n","import { ClientConfig } from './types';\nimport { HttpError, NetworkError, RetryPolicy, TimeoutError } from './errors';\n\nfunction sleep(ms: number) {\n return new Promise((r) => setTimeout(r, ms));\n}\n\nasync function withTimeout<T>(\n p: Promise<T>,\n ms: number,\n ab?: AbortController,\n url?: string,\n) {\n return new Promise<T>((resolve, reject) => {\n const to = setTimeout(() => {\n ab?.abort();\n reject(new TimeoutError(ms, url));\n }, ms);\n p.then((v) => {\n clearTimeout(to);\n resolve(v);\n }).catch((e) => {\n clearTimeout(to);\n reject(e);\n });\n });\n}\n\nasync function withRetry<T>(\n fn: (attempt: number) => Promise<T>,\n policy?: RetryPolicy,\n): Promise<T> {\n const max = policy?.maxRetries ?? 2;\n const base = policy?.baseDelayMs ?? 300;\n const maxDelay = policy?.maxDelayMs ?? 3000;\n const retryOn =\n policy?.retryOn ??\n ((err) =>\n err instanceof NetworkError ||\n (err instanceof HttpError && err.status >= 500));\n let attempt = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n try {\n return await fn(attempt);\n } catch (e) {\n if (attempt >= max || !retryOn(e, attempt)) throw e;\n const delay =\n Math.min(maxDelay, base * 2 ** attempt) +\n Math.floor(Math.random() * 100);\n await sleep(delay);\n attempt += 1;\n }\n }\n}\n\nexport function createHttp(cfg: ClientConfig & { retry?: RetryPolicy }) {\n const base = cfg.baseUrl.replace(/\\/$/, '');\n const fx = cfg.fetchImpl ?? fetch;\n const headers = cfg.headers ?? {};\n const timeout = cfg.timeoutMs ?? 35000;\n const log = cfg.logger ?? {};\n const retry = cfg.retry;\n\n async function doFetch(url: string, init: RequestInit) {\n const ab = new AbortController();\n const req = async () => {\n try {\n const res = await withTimeout(\n fx(url, { ...init, signal: ab.signal }),\n timeout,\n ab,\n url,\n );\n if (!res.ok) {\n const body = await res\n .clone()\n .json()\n .catch(() => undefined);\n throw new HttpError(res.status, res.statusText, body, url);\n }\n return res;\n } catch (e: any) {\n if (e.name === 'AbortError') throw new TimeoutError(timeout, url);\n if (e instanceof HttpError) throw e;\n throw new NetworkError(e, url);\n }\n };\n return withRetry(req, retry);\n }\n\n return { base, headers, timeout, log, retry, doFetch };\n}\n","import type { AgentDetail, ClientConfig } from '../types';\nimport type { RetryPolicy } from '../errors';\nimport { createHttp } from '../http';\n\nexport function createAgentsApi(cfg: ClientConfig & { retry?: RetryPolicy }) {\n const { base, headers, doFetch } = createHttp(cfg);\n\n return {\n async get(agentId: string): Promise<AgentDetail> {\n const res = await doFetch(`${base}/v1/agents/${agentId}`, {\n method: 'GET',\n headers,\n });\n return res.json();\n },\n async delete(agentId: string): Promise<void> {\n await doFetch(`${base}/v1/agents/${agentId}`, {\n method: 'DELETE',\n headers,\n });\n },\n };\n}\n","import type {\n AgentKnowledgeBasesResponse,\n AgentKnowledgeUploadsResponse,\n ClientConfig,\n KnowledgeUploadRequest,\n KnowledgeUploadResponse,\n} from '../types';\nimport type { RetryPolicy } from '../errors';\nimport { createHttp } from '../http';\n\nexport function createAgentKnowledgeApi(\n cfg: ClientConfig & { retry?: RetryPolicy },\n) {\n const { base, headers, doFetch } = createHttp(cfg);\n const jsonHeaders = { 'content-type': 'application/json', ...headers };\n\n return {\n async upload(\n agentId: string,\n payload: KnowledgeUploadRequest,\n ): Promise<KnowledgeUploadResponse> {\n const res = await doFetch(\n `${base}/v1/agents/${agentId}/knowledge/upload`,\n {\n method: 'POST',\n headers: jsonHeaders,\n body: JSON.stringify(payload),\n },\n );\n return res.json();\n },\n async listBases(agentId: string): Promise<AgentKnowledgeBasesResponse> {\n const res = await doFetch(\n `${base}/v1/agents/${agentId}/knowledge/bases`,\n {\n method: 'GET',\n headers,\n },\n );\n return res.json();\n },\n async listUploads(agentId: string): Promise<AgentKnowledgeUploadsResponse> {\n const res = await doFetch(\n `${base}/v1/agents/${agentId}/knowledge/uploads`,\n {\n method: 'GET',\n headers,\n },\n );\n return res.json();\n },\n };\n}\n","import type {\n AgentInstructionsResponse,\n ClientConfig,\n CreateInstructionRequest,\n InstructionCreatedResponse,\n} from '../types';\nimport type { RetryPolicy } from '../errors';\nimport { createHttp } from '../http';\n\nexport function createAgentInstructionsApi(\n cfg: ClientConfig & { retry?: RetryPolicy },\n) {\n const { base, headers, doFetch } = createHttp(cfg);\n const jsonHeaders = { 'content-type': 'application/json', ...headers };\n\n return {\n async list(\n agentId: string,\n opts?: { versionId?: string },\n ): Promise<AgentInstructionsResponse> {\n const search = opts?.versionId\n ? `?versionId=${encodeURIComponent(opts.versionId)}`\n : '';\n const res = await doFetch(\n `${base}/v1/agents/${agentId}/instructions${search}`,\n {\n method: 'GET',\n headers,\n },\n );\n return res.json();\n },\n async create(\n agentId: string,\n payload: CreateInstructionRequest,\n ): Promise<InstructionCreatedResponse> {\n const res = await doFetch(`${base}/v1/agents/${agentId}/instructions`, {\n method: 'POST',\n headers: jsonHeaders,\n body: JSON.stringify(payload),\n });\n return res.json();\n },\n };\n}\n","import type {\n ClientConfig,\n ConnectPhoneRequest,\n PhoneAssignmentResponse,\n} from '../types';\nimport type { RetryPolicy } from '../errors';\nimport { createHttp } from '../http';\n\nexport function createAgentPhonesApi(\n cfg: ClientConfig & { retry?: RetryPolicy },\n) {\n const { base, headers, doFetch } = createHttp(cfg);\n const jsonHeaders = { 'content-type': 'application/json', ...headers };\n\n return {\n async connect(\n agentId: string,\n payload: ConnectPhoneRequest,\n ): Promise<PhoneAssignmentResponse> {\n const res = await doFetch(`${base}/v1/agents/${agentId}/phones`, {\n method: 'POST',\n headers: jsonHeaders,\n body: JSON.stringify(payload),\n });\n return res.json();\n },\n async disconnect(agentId: string, phoneId: string): Promise<void> {\n await doFetch(`${base}/v1/agents/${agentId}/phones/${phoneId}`, {\n method: 'DELETE',\n headers,\n });\n },\n };\n}\n","import type {\n ClientConfig,\n WorkspaceEnableRequest,\n WorkspaceEnableResponse,\n WorkspacePhoneChannel,\n WorkspacePhonesResponse,\n} from '../types';\nimport type { RetryPolicy } from '../errors';\nimport { createHttp } from '../http';\n\nexport function createWorkspacesApi(\n cfg: ClientConfig & { retry?: RetryPolicy },\n) {\n const { base, headers, doFetch } = createHttp(cfg);\n const jsonHeaders = { 'content-type': 'application/json', ...headers };\n\n return {\n async listPhones(\n workspaceId: string,\n opts?: { channel?: WorkspacePhoneChannel },\n ): Promise<WorkspacePhonesResponse> {\n const search = opts?.channel ? `?channel=${opts.channel}` : '';\n const res = await doFetch(\n `${base}/v1/workspaces/${workspaceId}/phones${search}`,\n {\n method: 'GET',\n headers,\n },\n );\n return res.json();\n },\n async enable(\n workspaceId: string,\n payload: WorkspaceEnableRequest,\n ): Promise<WorkspaceEnableResponse> {\n const res = await doFetch(`${base}/v1/workspaces/${workspaceId}/enable`, {\n method: 'POST',\n headers: jsonHeaders,\n body: JSON.stringify(payload),\n });\n return res.json();\n },\n };\n}\n","import type {\n ClientConfig,\n ExecuteToolRequest,\n ExecuteToolResponse,\n ToolsCatalogResponse,\n} from '../types';\nimport type { RetryPolicy } from '../errors';\nimport { createHttp } from '../http';\n\nexport function createToolsApi(cfg: ClientConfig & { retry?: RetryPolicy }) {\n const { base, headers, doFetch } = createHttp(cfg);\n const jsonHeaders = { 'content-type': 'application/json', ...headers };\n\n return {\n async list(): Promise<ToolsCatalogResponse> {\n const res = await doFetch(`${base}/v1/tools`, {\n method: 'GET',\n headers,\n });\n return res.json();\n },\n async execute(\n toolId: string,\n payload: ExecuteToolRequest,\n ): Promise<ExecuteToolResponse> {\n const res = await doFetch(`${base}/v1/tools/${toolId}/execute`, {\n method: 'POST',\n headers: jsonHeaders,\n body: JSON.stringify(payload),\n });\n return res.json();\n },\n };\n}\n","import type { ClientConfig } from './types';\nimport type { RetryPolicy } from './errors';\nimport { createAgentsApi } from './api/agents';\nimport { createAgentKnowledgeApi } from './api/agent-knowledge';\nimport { createAgentInstructionsApi } from './api/agent-instructions';\nimport { createAgentPhonesApi } from './api/agent-phones';\nimport { createWorkspacesApi } from './api/workspaces';\nimport { createToolsApi } from './api/tools';\n\nexport function createClient(cfg: ClientConfig & { retry?: RetryPolicy }) {\n return {\n agents: {\n ...createAgentsApi(cfg),\n knowledge: createAgentKnowledgeApi(cfg),\n instructions: createAgentInstructionsApi(cfg),\n phones: createAgentPhonesApi(cfg),\n },\n workspaces: createWorkspacesApi(cfg),\n tools: createToolsApi(cfg),\n };\n}\n"],"mappings":";AAAO,IAAM,YAAN,cAAwB,MAAM;AAAA,EACnC,YACS,QACA,YACA,MACA,KACP;AACA,UAAM,QAAQ,MAAM,IAAI,UAAU,EAAE;AAL7B;AACA;AACA;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,eAAN,cAA2B,MAAM;AAAA,EACtC,YACS,IACA,KACP;AACA,UAAM,iBAAiB,EAAE,IAAI;AAHtB;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,eAAN,cAA2B,MAAM;AAAA,EACtC,YACS,OACA,KACP;AACA,UAAM,eAAe;AAHd;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;;;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aAAO,IAAI,KAAK;AAAA,IAClB;AAAA,EACF;AACF;;;AClCO,SAAS,eAAe,KAA6C;AAC1E,QAAM,EAAE,MAAM,SAAS,QAAQ,IAAI,WAAW,GAAG;AACjD,QAAM,cAAc,EAAE,gBAAgB,oBAAoB,GAAG,QAAQ;AAErE,SAAO;AAAA,IACL,MAAM,OAAsC;AAC1C,YAAM,MAAM,MAAM,QAAQ,GAAG,IAAI,aAAa;AAAA,QAC5C,QAAQ;AAAA,QACR;AAAA,MACF,CAAC;AACD,aAAO,IAAI,KAAK;AAAA,IAClB;AAAA,IACA,MAAM,QACJ,QACA,SAC8B;AAC9B,YAAM,MAAM,MAAM,QAAQ,GAAG,IAAI,aAAa,MAAM,YAAY;AAAA,QAC9D,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,MAAM,KAAK,UAAU,OAAO;AAAA,MAC9B,CAAC;AACD,aAAO,IAAI,KAAK;AAAA,IAClB;AAAA,EACF;AACF;;;ACxBO,SAAS,aAAa,KAA6C;AACxE,SAAO;AAAA,IACL,QAAQ;AAAA,MACN,GAAG,gBAAgB,GAAG;AAAA,MACtB,WAAW,wBAAwB,GAAG;AAAA,MACtC,cAAc,2BAA2B,GAAG;AAAA,MAC5C,QAAQ,qBAAqB,GAAG;AAAA,IAClC;AAAA,IACA,YAAY,oBAAoB,GAAG;AAAA,IACnC,OAAO,eAAe,GAAG;AAAA,EAC3B;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@getsupervisor/agents-studio-sdk",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "CHANGELOG.md"
15
+ ],
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs"
20
+ }
21
+ },
22
+ "scripts": {
23
+ "build": "tsup src/index.ts --format esm,cjs --dts --sourcemap",
24
+ "lint": "eslint \"src/**/*.{ts,tsx}\"",
25
+ "test": "vitest",
26
+ "types:gen": "npx -y openapi-typescript ../../docs/api-spec/openapi.yaml -o src/openapi-types.ts --export-type",
27
+ "release": "semantic-release"
28
+ },
29
+ "devDependencies": {
30
+ "@semantic-release/changelog": "^6.0.3",
31
+ "@semantic-release/commit-analyzer": "^13.0.1",
32
+ "@semantic-release/git": "^10.0.1",
33
+ "@semantic-release/github": "^11.0.6",
34
+ "@semantic-release/release-notes-generator": "^14.1.0",
35
+ "conventional-changelog-conventionalcommits": "^9.1.0",
36
+ "eslint": "^9.9.0",
37
+ "eventsource": "^2.0.2",
38
+ "openapi-typescript": "^6.7.0",
39
+ "semantic-release": "^24.2.9",
40
+ "tsup": "^8.0.1",
41
+ "tsx": "^4.7.0",
42
+ "typescript": "^5.6.3",
43
+ "vitest": "^2.1.1"
44
+ },
45
+ "dependencies": {}
46
+ }