@onkernel/sdk 0.0.1-alpha.1 → 0.1.0-alpha.10

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 (332) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/LICENSE +201 -0
  3. package/README.md +416 -8
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +203 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +203 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +477 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +473 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/app-framework.d.mts +49 -0
  29. package/core/app-framework.d.mts.map +1 -0
  30. package/core/app-framework.d.ts +49 -0
  31. package/core/app-framework.d.ts.map +1 -0
  32. package/core/app-framework.js +105 -0
  33. package/core/app-framework.js.map +1 -0
  34. package/core/app-framework.mjs +101 -0
  35. package/core/app-framework.mjs.map +1 -0
  36. package/core/error.d.mts +46 -0
  37. package/core/error.d.mts.map +1 -0
  38. package/core/error.d.ts +46 -0
  39. package/core/error.d.ts.map +1 -0
  40. package/core/error.js +113 -0
  41. package/core/error.js.map +1 -0
  42. package/core/error.mjs +97 -0
  43. package/core/error.mjs.map +1 -0
  44. package/core/resource.d.mts +6 -0
  45. package/core/resource.d.mts.map +1 -0
  46. package/core/resource.d.ts +6 -0
  47. package/core/resource.d.ts.map +1 -0
  48. package/core/resource.js +11 -0
  49. package/core/resource.js.map +1 -0
  50. package/core/resource.mjs +7 -0
  51. package/core/resource.mjs.map +1 -0
  52. package/core/uploads.d.mts +3 -0
  53. package/core/uploads.d.mts.map +1 -0
  54. package/core/uploads.d.ts +3 -0
  55. package/core/uploads.d.ts.map +1 -0
  56. package/core/uploads.js +6 -0
  57. package/core/uploads.js.map +1 -0
  58. package/core/uploads.mjs +2 -0
  59. package/core/uploads.mjs.map +1 -0
  60. package/error.d.mts +2 -0
  61. package/error.d.mts.map +1 -0
  62. package/error.d.ts +2 -0
  63. package/error.d.ts.map +1 -0
  64. package/error.js +6 -0
  65. package/error.js.map +1 -0
  66. package/error.mjs +2 -0
  67. package/error.mjs.map +1 -0
  68. package/index.d.mts +7 -0
  69. package/index.d.mts.map +1 -0
  70. package/index.d.ts +7 -0
  71. package/index.d.ts.map +1 -0
  72. package/index.js +32 -0
  73. package/index.js.map +1 -0
  74. package/index.mjs +8 -0
  75. package/index.mjs.map +1 -0
  76. package/internal/builtin-types.d.mts +73 -0
  77. package/internal/builtin-types.d.mts.map +1 -0
  78. package/internal/builtin-types.d.ts +73 -0
  79. package/internal/builtin-types.d.ts.map +1 -0
  80. package/internal/builtin-types.js +4 -0
  81. package/internal/builtin-types.js.map +1 -0
  82. package/internal/builtin-types.mjs +3 -0
  83. package/internal/builtin-types.mjs.map +1 -0
  84. package/internal/detect-platform.d.mts +15 -0
  85. package/internal/detect-platform.d.mts.map +1 -0
  86. package/internal/detect-platform.d.ts +15 -0
  87. package/internal/detect-platform.d.ts.map +1 -0
  88. package/internal/detect-platform.js +162 -0
  89. package/internal/detect-platform.js.map +1 -0
  90. package/internal/detect-platform.mjs +157 -0
  91. package/internal/detect-platform.mjs.map +1 -0
  92. package/internal/errors.d.mts +3 -0
  93. package/internal/errors.d.mts.map +1 -0
  94. package/internal/errors.d.ts +3 -0
  95. package/internal/errors.d.ts.map +1 -0
  96. package/internal/errors.js +41 -0
  97. package/internal/errors.js.map +1 -0
  98. package/internal/errors.mjs +36 -0
  99. package/internal/errors.mjs.map +1 -0
  100. package/internal/headers.d.mts +20 -0
  101. package/internal/headers.d.mts.map +1 -0
  102. package/internal/headers.d.ts +20 -0
  103. package/internal/headers.d.ts.map +1 -0
  104. package/internal/headers.js +79 -0
  105. package/internal/headers.js.map +1 -0
  106. package/internal/headers.mjs +74 -0
  107. package/internal/headers.mjs.map +1 -0
  108. package/internal/parse.d.mts +12 -0
  109. package/internal/parse.d.mts.map +1 -0
  110. package/internal/parse.d.ts +12 -0
  111. package/internal/parse.d.ts.map +1 -0
  112. package/internal/parse.js +35 -0
  113. package/internal/parse.js.map +1 -0
  114. package/internal/parse.mjs +32 -0
  115. package/internal/parse.mjs.map +1 -0
  116. package/internal/request-options.d.mts +32 -0
  117. package/internal/request-options.d.mts.map +1 -0
  118. package/internal/request-options.d.ts +32 -0
  119. package/internal/request-options.d.ts.map +1 -0
  120. package/internal/request-options.js +14 -0
  121. package/internal/request-options.js.map +1 -0
  122. package/internal/request-options.mjs +10 -0
  123. package/internal/request-options.mjs.map +1 -0
  124. package/internal/shim-types.d.mts +28 -0
  125. package/internal/shim-types.d.ts +28 -0
  126. package/internal/shims.d.mts +20 -0
  127. package/internal/shims.d.mts.map +1 -0
  128. package/internal/shims.d.ts +20 -0
  129. package/internal/shims.d.ts.map +1 -0
  130. package/internal/shims.js +92 -0
  131. package/internal/shims.js.map +1 -0
  132. package/internal/shims.mjs +85 -0
  133. package/internal/shims.mjs.map +1 -0
  134. package/internal/to-file.d.mts +45 -0
  135. package/internal/to-file.d.mts.map +1 -0
  136. package/internal/to-file.d.ts +45 -0
  137. package/internal/to-file.d.ts.map +1 -0
  138. package/internal/to-file.js +91 -0
  139. package/internal/to-file.js.map +1 -0
  140. package/internal/to-file.mjs +88 -0
  141. package/internal/to-file.mjs.map +1 -0
  142. package/internal/tslib.js +81 -0
  143. package/internal/tslib.mjs +17 -0
  144. package/internal/types.d.mts +67 -0
  145. package/internal/types.d.mts.map +1 -0
  146. package/internal/types.d.ts +67 -0
  147. package/internal/types.d.ts.map +1 -0
  148. package/internal/types.js +4 -0
  149. package/internal/types.js.map +1 -0
  150. package/internal/types.mjs +3 -0
  151. package/internal/types.mjs.map +1 -0
  152. package/internal/uploads.d.mts +42 -0
  153. package/internal/uploads.d.mts.map +1 -0
  154. package/internal/uploads.d.ts +42 -0
  155. package/internal/uploads.d.ts.map +1 -0
  156. package/internal/uploads.js +141 -0
  157. package/internal/uploads.js.map +1 -0
  158. package/internal/uploads.mjs +131 -0
  159. package/internal/uploads.mjs.map +1 -0
  160. package/internal/utils/base64.d.mts +3 -0
  161. package/internal/utils/base64.d.mts.map +1 -0
  162. package/internal/utils/base64.d.ts +3 -0
  163. package/internal/utils/base64.d.ts.map +1 -0
  164. package/internal/utils/base64.js +38 -0
  165. package/internal/utils/base64.js.map +1 -0
  166. package/internal/utils/base64.mjs +33 -0
  167. package/internal/utils/base64.mjs.map +1 -0
  168. package/internal/utils/bytes.d.mts +4 -0
  169. package/internal/utils/bytes.d.mts.map +1 -0
  170. package/internal/utils/bytes.d.ts +4 -0
  171. package/internal/utils/bytes.d.ts.map +1 -0
  172. package/internal/utils/bytes.js +31 -0
  173. package/internal/utils/bytes.js.map +1 -0
  174. package/internal/utils/bytes.mjs +26 -0
  175. package/internal/utils/bytes.mjs.map +1 -0
  176. package/internal/utils/env.d.mts +9 -0
  177. package/internal/utils/env.d.mts.map +1 -0
  178. package/internal/utils/env.d.ts +9 -0
  179. package/internal/utils/env.d.ts.map +1 -0
  180. package/internal/utils/env.js +22 -0
  181. package/internal/utils/env.js.map +1 -0
  182. package/internal/utils/env.mjs +18 -0
  183. package/internal/utils/env.mjs.map +1 -0
  184. package/internal/utils/log.d.mts +37 -0
  185. package/internal/utils/log.d.mts.map +1 -0
  186. package/internal/utils/log.d.ts +37 -0
  187. package/internal/utils/log.d.ts.map +1 -0
  188. package/internal/utils/log.js +85 -0
  189. package/internal/utils/log.js.map +1 -0
  190. package/internal/utils/log.mjs +79 -0
  191. package/internal/utils/log.mjs.map +1 -0
  192. package/internal/utils/path.d.mts +15 -0
  193. package/internal/utils/path.d.mts.map +1 -0
  194. package/internal/utils/path.d.ts +15 -0
  195. package/internal/utils/path.d.ts.map +1 -0
  196. package/internal/utils/path.js +58 -0
  197. package/internal/utils/path.js.map +1 -0
  198. package/internal/utils/path.mjs +53 -0
  199. package/internal/utils/path.mjs.map +1 -0
  200. package/internal/utils/sleep.d.mts +2 -0
  201. package/internal/utils/sleep.d.mts.map +1 -0
  202. package/internal/utils/sleep.d.ts +2 -0
  203. package/internal/utils/sleep.d.ts.map +1 -0
  204. package/internal/utils/sleep.js +7 -0
  205. package/internal/utils/sleep.js.map +1 -0
  206. package/internal/utils/sleep.mjs +3 -0
  207. package/internal/utils/sleep.mjs.map +1 -0
  208. package/internal/utils/uuid.d.mts +5 -0
  209. package/internal/utils/uuid.d.mts.map +1 -0
  210. package/internal/utils/uuid.d.ts +5 -0
  211. package/internal/utils/uuid.d.ts.map +1 -0
  212. package/internal/utils/uuid.js +19 -0
  213. package/internal/utils/uuid.js.map +1 -0
  214. package/internal/utils/uuid.mjs +15 -0
  215. package/internal/utils/uuid.mjs.map +1 -0
  216. package/internal/utils/values.d.mts +16 -0
  217. package/internal/utils/values.d.mts.map +1 -0
  218. package/internal/utils/values.d.ts +16 -0
  219. package/internal/utils/values.d.ts.map +1 -0
  220. package/internal/utils/values.js +109 -0
  221. package/internal/utils/values.js.map +1 -0
  222. package/internal/utils/values.mjs +92 -0
  223. package/internal/utils/values.mjs.map +1 -0
  224. package/internal/utils.d.mts +7 -0
  225. package/internal/utils.d.mts.map +1 -0
  226. package/internal/utils.d.ts +7 -0
  227. package/internal/utils.d.ts.map +1 -0
  228. package/internal/utils.js +11 -0
  229. package/internal/utils.js.map +1 -0
  230. package/internal/utils.mjs +8 -0
  231. package/internal/utils.mjs.map +1 -0
  232. package/package.json +133 -42
  233. package/resource.d.mts +2 -0
  234. package/resource.d.mts.map +1 -0
  235. package/resource.d.ts +2 -0
  236. package/resource.d.ts.map +1 -0
  237. package/resource.js +6 -0
  238. package/resource.js.map +1 -0
  239. package/resource.mjs +2 -0
  240. package/resource.mjs.map +1 -0
  241. package/resources/apps.d.mts +142 -0
  242. package/resources/apps.d.mts.map +1 -0
  243. package/resources/apps.d.ts +142 -0
  244. package/resources/apps.d.ts.map +1 -0
  245. package/resources/apps.js +54 -0
  246. package/resources/apps.js.map +1 -0
  247. package/resources/apps.mjs +50 -0
  248. package/resources/apps.mjs.map +1 -0
  249. package/resources/browser.d.mts +33 -0
  250. package/resources/browser.d.mts.map +1 -0
  251. package/resources/browser.d.ts +33 -0
  252. package/resources/browser.d.ts.map +1 -0
  253. package/resources/browser.js +15 -0
  254. package/resources/browser.js.map +1 -0
  255. package/resources/browser.mjs +11 -0
  256. package/resources/browser.mjs.map +1 -0
  257. package/resources/index.d.mts +3 -0
  258. package/resources/index.d.mts.map +1 -0
  259. package/resources/index.d.ts +3 -0
  260. package/resources/index.d.ts.map +1 -0
  261. package/resources/index.js +9 -0
  262. package/resources/index.js.map +1 -0
  263. package/resources/index.mjs +4 -0
  264. package/resources/index.mjs.map +1 -0
  265. package/resources.d.mts +2 -0
  266. package/resources.d.mts.map +1 -0
  267. package/resources.d.ts +2 -0
  268. package/resources.d.ts.map +1 -0
  269. package/resources.js +5 -0
  270. package/resources.js.map +1 -0
  271. package/resources.mjs +2 -0
  272. package/resources.mjs.map +1 -0
  273. package/src/api-promise.ts +2 -0
  274. package/src/client.ts +759 -0
  275. package/src/core/README.md +3 -0
  276. package/src/core/api-promise.ts +92 -0
  277. package/src/core/app-framework.ts +137 -0
  278. package/src/core/error.ts +130 -0
  279. package/src/core/resource.ts +11 -0
  280. package/src/core/uploads.ts +2 -0
  281. package/src/error.ts +2 -0
  282. package/src/index.ts +24 -0
  283. package/src/internal/README.md +3 -0
  284. package/src/internal/builtin-types.ts +93 -0
  285. package/src/internal/detect-platform.ts +196 -0
  286. package/src/internal/errors.ts +33 -0
  287. package/src/internal/headers.ts +97 -0
  288. package/src/internal/parse.ts +50 -0
  289. package/src/internal/request-options.ts +37 -0
  290. package/src/internal/shim-types.d.ts +28 -0
  291. package/src/internal/shims.ts +107 -0
  292. package/src/internal/to-file.ts +154 -0
  293. package/src/internal/types.ts +92 -0
  294. package/src/internal/uploads.ts +187 -0
  295. package/src/internal/utils/base64.ts +40 -0
  296. package/src/internal/utils/bytes.ts +32 -0
  297. package/src/internal/utils/env.ts +18 -0
  298. package/src/internal/utils/log.ts +126 -0
  299. package/src/internal/utils/path.ts +63 -0
  300. package/src/internal/utils/sleep.ts +3 -0
  301. package/src/internal/utils/uuid.ts +17 -0
  302. package/src/internal/utils/values.ts +102 -0
  303. package/src/internal/utils.ts +8 -0
  304. package/src/lib/.keep +4 -0
  305. package/src/resource.ts +2 -0
  306. package/src/resources/apps.ts +187 -0
  307. package/src/resources/browser.ts +48 -0
  308. package/src/resources/index.ts +11 -0
  309. package/src/resources.ts +1 -0
  310. package/src/tsconfig.json +11 -0
  311. package/src/uploads.ts +2 -0
  312. package/src/version.ts +1 -0
  313. package/uploads.d.mts +2 -0
  314. package/uploads.d.mts.map +1 -0
  315. package/uploads.d.ts +2 -0
  316. package/uploads.d.ts.map +1 -0
  317. package/uploads.js +6 -0
  318. package/uploads.js.map +1 -0
  319. package/uploads.mjs +2 -0
  320. package/uploads.mjs.map +1 -0
  321. package/version.d.mts +2 -0
  322. package/version.d.mts.map +1 -0
  323. package/version.d.ts +2 -0
  324. package/version.d.ts.map +1 -0
  325. package/version.js +5 -0
  326. package/version.js.map +1 -0
  327. package/version.mjs +2 -0
  328. package/version.mjs.map +1 -0
  329. package/dist/index.cjs +0 -71
  330. package/dist/index.d.cts +0 -59
  331. package/dist/index.d.ts +0 -59
  332. package/dist/index.js +0 -68
package/README.md CHANGED
@@ -1,15 +1,423 @@
1
- # sdk
1
+ # Kernel TypeScript API Library
2
2
 
3
- To install dependencies:
3
+ [![NPM version](https://img.shields.io/npm/v/@onkernel/sdk.svg)](https://npmjs.org/package/@onkernel/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@onkernel/sdk)
4
4
 
5
- ```bash
6
- bun install
5
+ This library provides convenient access to the Kernel REST API from server-side TypeScript or JavaScript.
6
+
7
+ The REST API documentation can be found on [docs.onkernel.com](https://docs.onkernel.com). The full API of this library can be found in [api.md](api.md).
8
+
9
+ It is generated with [Stainless](https://www.stainless.com/).
10
+
11
+ ## Installation
12
+
13
+ ```sh
14
+ npm install @onkernel/sdk
7
15
  ```
8
16
 
9
- To run:
17
+ ## Usage
18
+
19
+ The full API of this library can be found in [api.md](api.md).
20
+
21
+ <!-- prettier-ignore -->
22
+ ```js
23
+ import Kernel from '@onkernel/sdk';
24
+
25
+ const client = new Kernel({
26
+ apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
27
+ environment: 'development', // defaults to 'production'
28
+ });
29
+
30
+ async function main() {
31
+ const response = await client.apps.deploy({
32
+ entrypointRelPath: 'app.py',
33
+ file: fs.createReadStream('path/to/file'),
34
+ version: 'REPLACE_ME',
35
+ });
36
+
37
+ console.log(response.apps);
38
+ }
10
39
 
11
- ```bash
12
- bun run index.ts
40
+ main();
13
41
  ```
14
42
 
15
- This project was created using `bun init` in bun v1.2.9. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
43
+ ### Request & Response types
44
+
45
+ This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
46
+
47
+ <!-- prettier-ignore -->
48
+ ```ts
49
+ import Kernel from '@onkernel/sdk';
50
+
51
+ const client = new Kernel({
52
+ apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
53
+ environment: 'development', // defaults to 'production'
54
+ });
55
+
56
+ async function main() {
57
+ const params: Kernel.AppDeployParams = {
58
+ entrypointRelPath: 'app.py',
59
+ file: fs.createReadStream('path/to/file'),
60
+ version: 'REPLACE_ME',
61
+ };
62
+ const response: Kernel.AppDeployResponse = await client.apps.deploy(params);
63
+ }
64
+
65
+ main();
66
+ ```
67
+
68
+ Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
69
+
70
+ ## File uploads
71
+
72
+ Request parameters that correspond to file uploads can be passed in many different forms:
73
+
74
+ - `File` (or an object with the same structure)
75
+ - a `fetch` `Response` (or an object with the same structure)
76
+ - an `fs.ReadStream`
77
+ - the return value of our `toFile` helper
78
+
79
+ ```ts
80
+ import fs from 'fs';
81
+ import Kernel, { toFile } from '@onkernel/sdk';
82
+
83
+ const client = new Kernel();
84
+
85
+ // If you have access to Node `fs` we recommend using `fs.createReadStream()`:
86
+ await client.apps.deploy({ entrypointRelPath: 'app.py', file: fs.createReadStream('/path/to/file') });
87
+
88
+ // Or if you have the web `File` API you can pass a `File` instance:
89
+ await client.apps.deploy({ entrypointRelPath: 'app.py', file: new File(['my bytes'], 'file') });
90
+
91
+ // You can also pass a `fetch` `Response`:
92
+ await client.apps.deploy({ entrypointRelPath: 'app.py', file: await fetch('https://somesite/file') });
93
+
94
+ // Finally, if none of the above are convenient, you can use our `toFile` helper:
95
+ await client.apps.deploy({
96
+ entrypointRelPath: 'app.py',
97
+ file: await toFile(Buffer.from('my bytes'), 'file'),
98
+ });
99
+ await client.apps.deploy({
100
+ entrypointRelPath: 'app.py',
101
+ file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
102
+ });
103
+ ```
104
+
105
+ ## Handling errors
106
+
107
+ When the library is unable to connect to the API,
108
+ or if the API returns a non-success status code (i.e., 4xx or 5xx response),
109
+ a subclass of `APIError` will be thrown:
110
+
111
+ <!-- prettier-ignore -->
112
+ ```ts
113
+ async function main() {
114
+ const response = await client.apps
115
+ .deploy({ entrypointRelPath: 'app.py', file: fs.createReadStream('path/to/file'), version: 'REPLACE_ME' })
116
+ .catch(async (err) => {
117
+ if (err instanceof Kernel.APIError) {
118
+ console.log(err.status); // 400
119
+ console.log(err.name); // BadRequestError
120
+ console.log(err.headers); // {server: 'nginx', ...}
121
+ } else {
122
+ throw err;
123
+ }
124
+ });
125
+ }
126
+
127
+ main();
128
+ ```
129
+
130
+ Error codes are as follows:
131
+
132
+ | Status Code | Error Type |
133
+ | ----------- | -------------------------- |
134
+ | 400 | `BadRequestError` |
135
+ | 401 | `AuthenticationError` |
136
+ | 403 | `PermissionDeniedError` |
137
+ | 404 | `NotFoundError` |
138
+ | 422 | `UnprocessableEntityError` |
139
+ | 429 | `RateLimitError` |
140
+ | >=500 | `InternalServerError` |
141
+ | N/A | `APIConnectionError` |
142
+
143
+ ### Retries
144
+
145
+ Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
146
+ Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
147
+ 429 Rate Limit, and >=500 Internal errors will all be retried by default.
148
+
149
+ You can use the `maxRetries` option to configure or disable this:
150
+
151
+ <!-- prettier-ignore -->
152
+ ```js
153
+ // Configure the default for all requests:
154
+ const client = new Kernel({
155
+ maxRetries: 0, // default is 2
156
+ });
157
+
158
+ // Or, configure per-request:
159
+ await client.apps.deploy({ entrypointRelPath: 'app.py', file: fs.createReadStream('path/to/file'), version: 'REPLACE_ME' }, {
160
+ maxRetries: 5,
161
+ });
162
+ ```
163
+
164
+ ### Timeouts
165
+
166
+ Requests time out after 1 minute by default. You can configure this with a `timeout` option:
167
+
168
+ <!-- prettier-ignore -->
169
+ ```ts
170
+ // Configure the default for all requests:
171
+ const client = new Kernel({
172
+ timeout: 20 * 1000, // 20 seconds (default is 1 minute)
173
+ });
174
+
175
+ // Override per-request:
176
+ await client.apps.deploy({ entrypointRelPath: 'app.py', file: fs.createReadStream('path/to/file'), version: 'REPLACE_ME' }, {
177
+ timeout: 5 * 1000,
178
+ });
179
+ ```
180
+
181
+ On timeout, an `APIConnectionTimeoutError` is thrown.
182
+
183
+ Note that requests which time out will be [retried twice by default](#retries).
184
+
185
+ ## Advanced Usage
186
+
187
+ ### Accessing raw Response data (e.g., headers)
188
+
189
+ The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
190
+ This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
191
+
192
+ You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
193
+ Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
194
+
195
+ <!-- prettier-ignore -->
196
+ ```ts
197
+ const client = new Kernel();
198
+
199
+ const response = await client.apps
200
+ .deploy({ entrypointRelPath: 'app.py', file: fs.createReadStream('path/to/file'), version: 'REPLACE_ME' })
201
+ .asResponse();
202
+ console.log(response.headers.get('X-My-Header'));
203
+ console.log(response.statusText); // access the underlying Response object
204
+
205
+ const { data: response, response: raw } = await client.apps
206
+ .deploy({ entrypointRelPath: 'app.py', file: fs.createReadStream('path/to/file'), version: 'REPLACE_ME' })
207
+ .withResponse();
208
+ console.log(raw.headers.get('X-My-Header'));
209
+ console.log(response.apps);
210
+ ```
211
+
212
+ ### Logging
213
+
214
+ > [!IMPORTANT]
215
+ > All log messages are intended for debugging only. The format and content of log messages
216
+ > may change between releases.
217
+
218
+ #### Log levels
219
+
220
+ The log level can be configured in two ways:
221
+
222
+ 1. Via the `KERNEL_LOG` environment variable
223
+ 2. Using the `logLevel` client option (overrides the environment variable if set)
224
+
225
+ ```ts
226
+ import Kernel from '@onkernel/sdk';
227
+
228
+ const client = new Kernel({
229
+ logLevel: 'debug', // Show all log messages
230
+ });
231
+ ```
232
+
233
+ Available log levels, from most to least verbose:
234
+
235
+ - `'debug'` - Show debug messages, info, warnings, and errors
236
+ - `'info'` - Show info messages, warnings, and errors
237
+ - `'warn'` - Show warnings and errors (default)
238
+ - `'error'` - Show only errors
239
+ - `'off'` - Disable all logging
240
+
241
+ At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
242
+ Some authentication-related headers are redacted, but sensitive data in request and response bodies
243
+ may still be visible.
244
+
245
+ #### Custom logger
246
+
247
+ By default, this library logs to `globalThis.console`. You can also provide a custom logger.
248
+ Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
249
+
250
+ When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
251
+ below the configured level will not be sent to your logger.
252
+
253
+ ```ts
254
+ import Kernel from '@onkernel/sdk';
255
+ import pino from 'pino';
256
+
257
+ const logger = pino();
258
+
259
+ const client = new Kernel({
260
+ logger: logger.child({ name: 'Kernel' }),
261
+ logLevel: 'debug', // Send all messages to pino, allowing it to filter
262
+ });
263
+ ```
264
+
265
+ ### Making custom/undocumented requests
266
+
267
+ This library is typed for convenient access to the documented API. If you need to access undocumented
268
+ endpoints, params, or response properties, the library can still be used.
269
+
270
+ #### Undocumented endpoints
271
+
272
+ To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
273
+ Options on the client, such as retries, will be respected when making these requests.
274
+
275
+ ```ts
276
+ await client.post('/some/path', {
277
+ body: { some_prop: 'foo' },
278
+ query: { some_query_arg: 'bar' },
279
+ });
280
+ ```
281
+
282
+ #### Undocumented request params
283
+
284
+ To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
285
+ parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
286
+ send will be sent as-is.
287
+
288
+ ```ts
289
+ client.foo.create({
290
+ foo: 'my_param',
291
+ bar: 12,
292
+ // @ts-expect-error baz is not yet public
293
+ baz: 'undocumented option',
294
+ });
295
+ ```
296
+
297
+ For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
298
+ extra param in the body.
299
+
300
+ If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
301
+ options.
302
+
303
+ #### Undocumented response properties
304
+
305
+ To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
306
+ the response object, or cast the response object to the requisite type. Like the request params, we do not
307
+ validate or strip extra properties from the response from the API.
308
+
309
+ ### Customizing the fetch client
310
+
311
+ By default, this library expects a global `fetch` function is defined.
312
+
313
+ If you want to use a different `fetch` function, you can either polyfill the global:
314
+
315
+ ```ts
316
+ import fetch from 'my-fetch';
317
+
318
+ globalThis.fetch = fetch;
319
+ ```
320
+
321
+ Or pass it to the client:
322
+
323
+ ```ts
324
+ import Kernel from '@onkernel/sdk';
325
+ import fetch from 'my-fetch';
326
+
327
+ const client = new Kernel({ fetch });
328
+ ```
329
+
330
+ ### Fetch options
331
+
332
+ If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
333
+
334
+ ```ts
335
+ import Kernel from '@onkernel/sdk';
336
+
337
+ const client = new Kernel({
338
+ fetchOptions: {
339
+ // `RequestInit` options
340
+ },
341
+ });
342
+ ```
343
+
344
+ #### Configuring proxies
345
+
346
+ To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
347
+ options to requests:
348
+
349
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
350
+
351
+ ```ts
352
+ import Kernel from '@onkernel/sdk';
353
+ import * as undici from 'undici';
354
+
355
+ const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
356
+ const client = new Kernel({
357
+ fetchOptions: {
358
+ dispatcher: proxyAgent,
359
+ },
360
+ });
361
+ ```
362
+
363
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
364
+
365
+ ```ts
366
+ import Kernel from '@onkernel/sdk';
367
+
368
+ const client = new Kernel({
369
+ fetchOptions: {
370
+ proxy: 'http://localhost:8888',
371
+ },
372
+ });
373
+ ```
374
+
375
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
376
+
377
+ ```ts
378
+ import Kernel from 'npm:@onkernel/sdk';
379
+
380
+ const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
381
+ const client = new Kernel({
382
+ fetchOptions: {
383
+ client: httpClient,
384
+ },
385
+ });
386
+ ```
387
+
388
+ ## Frequently Asked Questions
389
+
390
+ ## Semantic versioning
391
+
392
+ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
393
+
394
+ 1. Changes that only affect static types, without breaking runtime behavior.
395
+ 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
396
+ 3. Changes that we do not expect to impact the vast majority of users in practice.
397
+
398
+ We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
399
+
400
+ We are keen for your feedback; please open an [issue](https://www.github.com/onkernel/kernel-node-sdk/issues) with questions, bugs, or suggestions.
401
+
402
+ ## Requirements
403
+
404
+ TypeScript >= 4.9 is supported.
405
+
406
+ The following runtimes are supported:
407
+
408
+ - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
409
+ - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
410
+ - Deno v1.28.0 or higher.
411
+ - Bun 1.0 or later.
412
+ - Cloudflare Workers.
413
+ - Vercel Edge Runtime.
414
+ - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
415
+ - Nitro v2.6 or greater.
416
+
417
+ Note that React Native is not supported at this time.
418
+
419
+ If you are interested in other runtime environments, please open or upvote an issue on GitHub.
420
+
421
+ ## Contributing
422
+
423
+ See [the contributing documentation](./CONTRIBUTING.md).
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.mts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.js";
2
+ //# sourceMappingURL=api-promise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.ts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/api-promise.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("./internal/tslib.js");
4
+ /** @deprecated Import from ./core/api-promise instead */
5
+ tslib_1.__exportStar(require("./core/api-promise.js"), exports);
6
+ //# sourceMappingURL=api-promise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.js","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,gEAAmC"}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/client.d.mts ADDED
@@ -0,0 +1,203 @@
1
+ import type { RequestInit, RequestInfo } from "./internal/builtin-types.mjs";
2
+ import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from "./internal/types.mjs";
3
+ import { type Logger, type LogLevel } from "./internal/utils/log.mjs";
4
+ export type { Logger, LogLevel } from "./internal/utils/log.mjs";
5
+ import * as Opts from "./internal/request-options.mjs";
6
+ import * as Errors from "./core/error.mjs";
7
+ import * as Uploads from "./core/uploads.mjs";
8
+ import * as API from "./resources/index.mjs";
9
+ import { APIPromise } from "./core/api-promise.mjs";
10
+ import { type Fetch } from "./internal/builtin-types.mjs";
11
+ import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
12
+ import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
13
+ import { AppDeployParams, AppDeployResponse, AppInvokeParams, AppInvokeResponse, AppRetrieveInvocationResponse, Apps } from "./resources/apps.mjs";
14
+ import { Browser, BrowserCreateSessionParams, BrowserCreateSessionResponse } from "./resources/browser.mjs";
15
+ import { KernelApp } from "./core/app-framework.mjs";
16
+ declare const environments: {
17
+ production: string;
18
+ development: string;
19
+ };
20
+ type Environment = keyof typeof environments;
21
+ export interface ClientOptions {
22
+ /**
23
+ * Defaults to process.env['KERNEL_API_KEY'].
24
+ */
25
+ apiKey?: string | undefined;
26
+ /**
27
+ * Specifies the environment to use for the API.
28
+ *
29
+ * Each environment maps to a different base URL:
30
+ * - `production` corresponds to `https://api.onkernel.com/`
31
+ * - `development` corresponds to `https://localhost:3001/`
32
+ */
33
+ environment?: Environment | undefined;
34
+ /**
35
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
36
+ *
37
+ * Defaults to process.env['KERNEL_BASE_URL'].
38
+ */
39
+ baseURL?: string | null | undefined;
40
+ /**
41
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
42
+ * from the server before timing out a single request.
43
+ *
44
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
45
+ * much longer than this timeout before the promise succeeds or fails.
46
+ */
47
+ timeout?: number | undefined;
48
+ /**
49
+ * Additional `RequestInit` options to be passed to `fetch` calls.
50
+ * Properties will be overridden by per-request `fetchOptions`.
51
+ */
52
+ fetchOptions?: MergedRequestInit | undefined;
53
+ /**
54
+ * Specify a custom `fetch` function implementation.
55
+ *
56
+ * If not provided, we expect that `fetch` is defined globally.
57
+ */
58
+ fetch?: Fetch | undefined;
59
+ /**
60
+ * The maximum number of times that the client will retry a request in case of a
61
+ * temporary failure, like a network error or a 5XX error from the server.
62
+ *
63
+ * @default 2
64
+ */
65
+ maxRetries?: number | undefined;
66
+ /**
67
+ * Default headers to include with every request to the API.
68
+ *
69
+ * These can be removed in individual requests by explicitly setting the
70
+ * header to `null` in request options.
71
+ */
72
+ defaultHeaders?: HeadersLike | undefined;
73
+ /**
74
+ * Default query parameters to include with every request to the API.
75
+ *
76
+ * These can be removed in individual requests by explicitly setting the
77
+ * param to `undefined` in request options.
78
+ */
79
+ defaultQuery?: Record<string, string | undefined> | undefined;
80
+ /**
81
+ * Set the log level.
82
+ *
83
+ * Defaults to process.env['KERNEL_LOG'] or 'warn' if it isn't set.
84
+ */
85
+ logLevel?: LogLevel | undefined;
86
+ /**
87
+ * Set the logger.
88
+ *
89
+ * Defaults to globalThis.console.
90
+ */
91
+ logger?: Logger | undefined;
92
+ }
93
+ /**
94
+ * API Client for interfacing with the Kernel API.
95
+ */
96
+ export declare class Kernel {
97
+ #private;
98
+ apiKey: string;
99
+ baseURL: string;
100
+ maxRetries: number;
101
+ timeout: number;
102
+ logger: Logger | undefined;
103
+ logLevel: LogLevel | undefined;
104
+ fetchOptions: MergedRequestInit | undefined;
105
+ private fetch;
106
+ protected idempotencyHeader?: string;
107
+ private _options;
108
+ /**
109
+ * API Client for interfacing with the Kernel API.
110
+ *
111
+ * @param {string | undefined} [opts.apiKey=process.env['KERNEL_API_KEY'] ?? undefined]
112
+ * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
113
+ * @param {string} [opts.baseURL=process.env['KERNEL_BASE_URL'] ?? https://api.onkernel.com/] - Override the default base URL for the API.
114
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
115
+ * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
116
+ * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
117
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
118
+ * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
119
+ * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
120
+ */
121
+ constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
122
+ /**
123
+ * Create a new client instance re-using the same options given to the current client with optional overriding.
124
+ */
125
+ withOptions(options: Partial<ClientOptions>): this;
126
+ protected defaultQuery(): Record<string, string | undefined> | undefined;
127
+ protected validateHeaders({ values, nulls }: NullableHeaders): void;
128
+ protected authHeaders(opts: FinalRequestOptions): NullableHeaders | undefined;
129
+ /**
130
+ * Basic re-implementation of `qs.stringify` for primitive types.
131
+ */
132
+ protected stringifyQuery(query: Record<string, unknown>): string;
133
+ private getUserAgent;
134
+ protected defaultIdempotencyKey(): string;
135
+ protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
136
+ buildURL(path: string, query: Record<string, unknown> | null | undefined): string;
137
+ /**
138
+ * Used as a callback for mutating the given `FinalRequestOptions` object.
139
+ */
140
+ protected prepareOptions(options: FinalRequestOptions): Promise<void>;
141
+ /**
142
+ * Used as a callback for mutating the given `RequestInit` object.
143
+ *
144
+ * This is useful for cases where you want to add certain headers based off of
145
+ * the request properties, e.g. `method` or `url`.
146
+ */
147
+ protected prepareRequest(request: RequestInit, { url, options }: {
148
+ url: string;
149
+ options: FinalRequestOptions;
150
+ }): Promise<void>;
151
+ get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
152
+ post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
153
+ patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
154
+ put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
155
+ delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
156
+ private methodRequest;
157
+ request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
158
+ private makeRequest;
159
+ fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
160
+ private shouldRetry;
161
+ private retryRequest;
162
+ private calculateDefaultRetryTimeoutMillis;
163
+ buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
164
+ retryCount?: number;
165
+ }): {
166
+ req: FinalizedRequestInit;
167
+ url: string;
168
+ timeout: number;
169
+ };
170
+ private buildHeaders;
171
+ private buildBody;
172
+ /**
173
+ * Create a new KernelApp instance.
174
+ *
175
+ * @param name - The name of the app to create.
176
+ * @returns A new KernelApp instance you can attach actions to.
177
+ */
178
+ app(name: string): KernelApp;
179
+ static Kernel: typeof Kernel;
180
+ static DEFAULT_TIMEOUT: number;
181
+ static KernelError: typeof Errors.KernelError;
182
+ static APIError: typeof Errors.APIError;
183
+ static APIConnectionError: typeof Errors.APIConnectionError;
184
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
185
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
186
+ static NotFoundError: typeof Errors.NotFoundError;
187
+ static ConflictError: typeof Errors.ConflictError;
188
+ static RateLimitError: typeof Errors.RateLimitError;
189
+ static BadRequestError: typeof Errors.BadRequestError;
190
+ static AuthenticationError: typeof Errors.AuthenticationError;
191
+ static InternalServerError: typeof Errors.InternalServerError;
192
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
193
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
194
+ static toFile: typeof Uploads.toFile;
195
+ apps: API.Apps;
196
+ browser: API.Browser;
197
+ }
198
+ export declare namespace Kernel {
199
+ export type RequestOptions = Opts.RequestOptions;
200
+ export { Apps as Apps, type AppDeployResponse as AppDeployResponse, type AppInvokeResponse as AppInvokeResponse, type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse, type AppDeployParams as AppDeployParams, type AppInvokeParams as AppInvokeParams, };
201
+ export { Browser as Browser, type BrowserCreateSessionResponse as BrowserCreateSessionResponse, type BrowserCreateSessionParams as BrowserCreateSessionParams, };
202
+ }
203
+ //# sourceMappingURL=client.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW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