@b3os/sdk 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/core/util.d.ts +1 -1
  3. package/dist/cjs/core/util.js +1 -1
  4. package/dist/cjs/generated/client.d.ts +18 -0
  5. package/dist/cjs/generated/client.js +34 -0
  6. package/dist/cjs/generated/client.js.map +1 -1
  7. package/dist/cjs/generated/errors.d.ts +1 -1
  8. package/dist/cjs/generated/errors.js +120 -0
  9. package/dist/cjs/generated/errors.js.map +1 -1
  10. package/dist/cjs/generated/ids.d.ts +89 -0
  11. package/dist/cjs/generated/ids.js +22 -0
  12. package/dist/cjs/generated/ids.js.map +1 -1
  13. package/dist/cjs/generated/jobs.js +4 -0
  14. package/dist/cjs/generated/jobs.js.map +1 -1
  15. package/dist/cjs/generated/ns/actions.d.ts +267 -33
  16. package/dist/cjs/generated/ns/actions.js +375 -33
  17. package/dist/cjs/generated/ns/actions.js.map +1 -1
  18. package/dist/cjs/generated/ns/agents.d.ts +656 -0
  19. package/dist/cjs/generated/ns/agents.js +989 -0
  20. package/dist/cjs/generated/ns/agents.js.map +1 -0
  21. package/dist/cjs/generated/ns/images.d.ts +162 -0
  22. package/dist/cjs/generated/ns/images.js +246 -0
  23. package/dist/cjs/generated/ns/images.js.map +1 -0
  24. package/dist/cjs/generated/ns/infer.d.ts +71 -3
  25. package/dist/cjs/generated/ns/infer.js +98 -3
  26. package/dist/cjs/generated/ns/infer.js.map +1 -1
  27. package/dist/cjs/generated/ns/keys.d.ts +3 -1
  28. package/dist/cjs/generated/ns/keys.js +3 -1
  29. package/dist/cjs/generated/ns/keys.js.map +1 -1
  30. package/dist/cjs/generated/ns/listeners.d.ts +163 -0
  31. package/dist/cjs/generated/ns/listeners.js +268 -0
  32. package/dist/cjs/generated/ns/listeners.js.map +1 -0
  33. package/dist/cjs/generated/ns/orgs.d.ts +10 -0
  34. package/dist/cjs/generated/ns/orgs.js +26 -1
  35. package/dist/cjs/generated/ns/orgs.js.map +1 -1
  36. package/dist/cjs/generated/ns/projects.d.ts +32 -0
  37. package/dist/cjs/generated/ns/projects.js +66 -0
  38. package/dist/cjs/generated/ns/projects.js.map +1 -1
  39. package/dist/cjs/generated/ns/render.d.ts +192 -21
  40. package/dist/cjs/generated/ns/render.js +267 -24
  41. package/dist/cjs/generated/ns/render.js.map +1 -1
  42. package/dist/cjs/generated/ns/requests.d.ts +3 -1
  43. package/dist/cjs/generated/ns/requests.js +3 -1
  44. package/dist/cjs/generated/ns/requests.js.map +1 -1
  45. package/dist/cjs/generated/ns/routines.d.ts +22 -4
  46. package/dist/cjs/generated/ns/routines.js +22 -4
  47. package/dist/cjs/generated/ns/routines.js.map +1 -1
  48. package/dist/cjs/generated/ns/sandboxes.d.ts +431 -7
  49. package/dist/cjs/generated/ns/sandboxes.js +633 -6
  50. package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
  51. package/dist/cjs/generated/ns/usage.d.ts +1 -1
  52. package/dist/cjs/generated/ns/usage.js +1 -1
  53. package/dist/cjs/generated/ns/vision.d.ts +113 -17
  54. package/dist/cjs/generated/ns/vision.js +152 -21
  55. package/dist/cjs/generated/ns/vision.js.map +1 -1
  56. package/dist/cjs/generated/ns/workspaces.d.ts +225 -0
  57. package/dist/cjs/generated/ns/workspaces.js +410 -0
  58. package/dist/cjs/generated/ns/workspaces.js.map +1 -0
  59. package/dist/cjs/generated/types.d.ts +5259 -605
  60. package/dist/cjs/helpers/sandboxes.d.ts +20 -1
  61. package/dist/cjs/helpers/sandboxes.js +13 -1
  62. package/dist/cjs/helpers/sandboxes.js.map +1 -1
  63. package/dist/esm/core/util.d.ts +1 -1
  64. package/dist/esm/core/util.js +1 -1
  65. package/dist/esm/generated/client.d.ts +18 -0
  66. package/dist/esm/generated/client.js +34 -0
  67. package/dist/esm/generated/client.js.map +1 -1
  68. package/dist/esm/generated/errors.d.ts +1 -1
  69. package/dist/esm/generated/errors.js +120 -0
  70. package/dist/esm/generated/errors.js.map +1 -1
  71. package/dist/esm/generated/ids.d.ts +89 -0
  72. package/dist/esm/generated/ids.js +22 -0
  73. package/dist/esm/generated/ids.js.map +1 -1
  74. package/dist/esm/generated/jobs.js +4 -0
  75. package/dist/esm/generated/jobs.js.map +1 -1
  76. package/dist/esm/generated/ns/actions.d.ts +267 -33
  77. package/dist/esm/generated/ns/actions.js +375 -33
  78. package/dist/esm/generated/ns/actions.js.map +1 -1
  79. package/dist/esm/generated/ns/agents.d.ts +656 -0
  80. package/dist/esm/generated/ns/agents.js +985 -0
  81. package/dist/esm/generated/ns/agents.js.map +1 -0
  82. package/dist/esm/generated/ns/images.d.ts +162 -0
  83. package/dist/esm/generated/ns/images.js +242 -0
  84. package/dist/esm/generated/ns/images.js.map +1 -0
  85. package/dist/esm/generated/ns/infer.d.ts +71 -3
  86. package/dist/esm/generated/ns/infer.js +98 -3
  87. package/dist/esm/generated/ns/infer.js.map +1 -1
  88. package/dist/esm/generated/ns/keys.d.ts +3 -1
  89. package/dist/esm/generated/ns/keys.js +3 -1
  90. package/dist/esm/generated/ns/keys.js.map +1 -1
  91. package/dist/esm/generated/ns/listeners.d.ts +163 -0
  92. package/dist/esm/generated/ns/listeners.js +264 -0
  93. package/dist/esm/generated/ns/listeners.js.map +1 -0
  94. package/dist/esm/generated/ns/orgs.d.ts +10 -0
  95. package/dist/esm/generated/ns/orgs.js +26 -1
  96. package/dist/esm/generated/ns/orgs.js.map +1 -1
  97. package/dist/esm/generated/ns/projects.d.ts +32 -0
  98. package/dist/esm/generated/ns/projects.js +66 -0
  99. package/dist/esm/generated/ns/projects.js.map +1 -1
  100. package/dist/esm/generated/ns/render.d.ts +192 -21
  101. package/dist/esm/generated/ns/render.js +267 -24
  102. package/dist/esm/generated/ns/render.js.map +1 -1
  103. package/dist/esm/generated/ns/requests.d.ts +3 -1
  104. package/dist/esm/generated/ns/requests.js +3 -1
  105. package/dist/esm/generated/ns/requests.js.map +1 -1
  106. package/dist/esm/generated/ns/routines.d.ts +22 -4
  107. package/dist/esm/generated/ns/routines.js +22 -4
  108. package/dist/esm/generated/ns/routines.js.map +1 -1
  109. package/dist/esm/generated/ns/sandboxes.d.ts +431 -7
  110. package/dist/esm/generated/ns/sandboxes.js +633 -6
  111. package/dist/esm/generated/ns/sandboxes.js.map +1 -1
  112. package/dist/esm/generated/ns/usage.d.ts +1 -1
  113. package/dist/esm/generated/ns/usage.js +1 -1
  114. package/dist/esm/generated/ns/vision.d.ts +113 -17
  115. package/dist/esm/generated/ns/vision.js +152 -21
  116. package/dist/esm/generated/ns/vision.js.map +1 -1
  117. package/dist/esm/generated/ns/workspaces.d.ts +225 -0
  118. package/dist/esm/generated/ns/workspaces.js +406 -0
  119. package/dist/esm/generated/ns/workspaces.js.map +1 -0
  120. package/dist/esm/generated/types.d.ts +5259 -605
  121. package/dist/esm/helpers/sandboxes.d.ts +20 -1
  122. package/dist/esm/helpers/sandboxes.js +13 -1
  123. package/dist/esm/helpers/sandboxes.js.map +1 -1
  124. package/package.json +1 -1
  125. package/src/core/util.ts +1 -1
  126. package/src/generated/client.ts +38 -0
  127. package/src/generated/errors.ts +240 -0
  128. package/src/generated/ids.ts +22 -0
  129. package/src/generated/jobs.ts +4 -0
  130. package/src/generated/ns/actions.ts +403 -33
  131. package/src/generated/ns/agents.ts +1102 -0
  132. package/src/generated/ns/images.ts +256 -0
  133. package/src/generated/ns/infer.ts +100 -3
  134. package/src/generated/ns/keys.ts +3 -1
  135. package/src/generated/ns/listeners.ts +300 -0
  136. package/src/generated/ns/orgs.ts +27 -1
  137. package/src/generated/ns/projects.ts +74 -0
  138. package/src/generated/ns/render.ts +277 -24
  139. package/src/generated/ns/requests.ts +3 -1
  140. package/src/generated/ns/routines.ts +22 -4
  141. package/src/generated/ns/sandboxes.ts +694 -7
  142. package/src/generated/ns/usage.ts +1 -1
  143. package/src/generated/ns/vision.ts +159 -21
  144. package/src/generated/ns/workspaces.ts +448 -0
  145. package/src/generated/types.ts +5684 -601
  146. package/src/helpers/sandboxes.ts +31 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../../src/generated/ns/agents.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,gDAAwD;AACxD,0DAAoD;AAIpD,4CAAuE;AAGvE,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,YAAY;IAClB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,cAAc;CACtB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,qBAAqB;IACzB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,sBAAsB;IAC5B,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,qBAAqB,GAAO;IAChC,EAAE,EAAE,2BAA2B;IAC/B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,kBAAkB,GAAO;IAC7B,EAAE,EAAE,wBAAwB;IAC5B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,kBAAkB;I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AE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CACV,KAAa,EACb,MAAmC,EACnC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CACvB,cAAc,EACd,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAChC,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAjxBD,8BAixBC"}
@@ -0,0 +1,162 @@
1
+ import type { BinaryInput, RequestOptions } from "../../core/client.ts";
2
+ import { Namespace } from "../../core/namespace.ts";
3
+ import type { Op } from "../../core/op.ts";
4
+ import type { APIPromise } from "../../core/promise.ts";
5
+ import type * as T from "../types.ts";
6
+ /** Descriptors of every images operation, keyed by method name (for tooling and custom clients). */
7
+ export declare const imagesOps: {
8
+ readonly listImages: Op;
9
+ readonly importImage: Op;
10
+ readonly getContext: Op;
11
+ readonly putContext: Op;
12
+ readonly deleteImage: Op;
13
+ readonly getImage: Op;
14
+ readonly getImageLogs: Op;
15
+ readonly releaseImage: Op;
16
+ };
17
+ /** Public OCI images imported as templates for your project's sandboxes (`/v1/images`). */
18
+ export declare class ImagesAPI extends Namespace {
19
+ /**
20
+ * List images
21
+ *
22
+ * Lists this project's images, newest first, in every status (an `evicted` or `failed` image stays listed
23
+ * until it is deleted). Other projects' images are never listed.
24
+ *
25
+ * `GET /v1/images` · scope `sandboxes:read` · served by the node
26
+ */
27
+ listImages(options?: RequestOptions): APIPromise<T.ImageList>;
28
+ /**
29
+ * Import an image
30
+ *
31
+ * Imports a public OCI image, or builds one from a Dockerfile (`build`, with the `images.build` flag), as a
32
+ * template for this project's sandboxes. A build skips the resolve: it is queued, then `building` in a microVM
33
+ * of its own, and from the unpacking on it goes as an import does. The reference is resolved before the
34
+ * answer (a tag to its digest with one manifest `HEAD`), so the answer names the exact image: `202` with a new
35
+ * image (`status: queued`), or `200` with the project's existing image when one with the same key exists,
36
+ * ready or still importing. The key covers the project, the image's digest, the warm-up, the size and the
37
+ * node's own build inputs (guest agent, kernel, the unpacker), so the same request after a node release can be
38
+ * a new image. Watch it with `GET /v1/images/{image_id}?wait=30` until `ready` (or `failed`), then create
39
+ * sandboxes with `POST /v1/sandboxes {"image": "img_…"}`.
40
+ *
41
+ * The import runs whether or not the client stays connected. It holds `images.rootfs_max` of your
42
+ * organization's snapshot storage while it runs and then counts as one snapshot, its root file system plus its
43
+ * warm snapshot's memory, against `sandboxes.snapshots_max` and `sandboxes.snapshot_storage_max`. An
44
+ * organization runs one import at a time and a node two; more wait in the queue (`queued`). The CPU the import
45
+ * uses (the unpacking microVM and the warm-up boot) is recorded as `images.import_vcpu_ms`.
46
+ *
47
+ * `warmup.commands` run in order, each as an argument list (no shell unless you name one), as root, with no
48
+ * network, at most 300 seconds in all; what they read is in the page cache of every sandbox restored from the
49
+ * snapshot. The image's `USER`, `ENV` and `WORKDIR` apply to every command your sandboxes run. Clones of one
50
+ * warm snapshot share the in-process random state of anything the warm-up left running, within your project
51
+ * only; the kernel's random pool is reseeded for each.
52
+ *
53
+ * `size` (`vcpu`, `memory_mib`) is fixed at import: every sandbox from the image has it, and a create that asks
54
+ * for another size answers `400 invalid_request`.
55
+ *
56
+ * A private image (`images.build`) names a registry connection in `auth` (see `ImageRegistryAuth`); using it
57
+ * also needs `vault:run`. A connection of another project, or one this credential may not use, answers `404
58
+ * connection_not_found`; one that is not a registry connection for the image's registry, `422
59
+ * image_auth_invalid`; a credential the registry's token service refuses, `422 image_refused` with `reason:
60
+ * credentials`. While the flag is off, `auth` answers `400 invalid_request`. Without the flag on for your organization the answer is
61
+ * `404 feature_not_enabled`; without an image store on the node, a full store or the node's disk under its
62
+ * floor, `503 capacity_unavailable`.
63
+ *
64
+ * A `failed` image whose warm snapshot could not be rebuilt (`error.stage: rebuild`) keeps its root file
65
+ * system, and the node tries it again at its next start. The same request imports it again under its ID and
66
+ * replaces that file system, except while a running or paused sandbox, or a snapshot taken from one, uses the
67
+ * image's template: then the answer is `409 image_in_use`.
68
+ *
69
+ * `name` (with the `images.build` flag; without it the answer is `404 feature_not_enabled`) gives the image a
70
+ * name in this project, which a create resolves inside the project only: `POST /v1/sandboxes {"template":
71
+ * "py:3.11"}`. A name is unique among the project's images (`409 image_name_taken` while another image, of any
72
+ * status, has it; delete that one first) and is never a node template's (`422 image_name_reserved` for `base`,
73
+ * `base:v1` and the like). The name is part of the key: the same image under another name, or without one, is
74
+ * another image.
75
+ *
76
+ * `app` (with the `images.build` flag) asks for the image on behalf of an application, the `name` of its
77
+ * b3os.yaml: `b3os apply` sends it for `build.image` and `build.dockerfile`. The application then holds the
78
+ * image (`held_by`), new or existing: the same request from two applications is one image with two holds. An
79
+ * image asked for without `app`, even once, is `kept`: it stays until you delete it, as every image did before
80
+ * holds. An image that is not kept goes once no application holds it and no running, paused or hibernated
81
+ * sandbox and no snapshot uses its template. An application's hold ends when `b3os app down` releases it
82
+ * (`POST /v1/images/{image_id}/release`), or by itself once none of the application's sandboxes (running, or
83
+ * stopped and still listed, for 7 days) runs from the image and the application has not asked for it for
84
+ * `[images] hold_h` (7 days): a rollback can start every generation still listed from its image. When an
85
+ * import does not fit the node's image store, images that are not kept, that no sandbox or snapshot uses and
86
+ * that no application asked for in the last hour go first, least recently used first; a rollback to one of
87
+ * them imports it again by digest, or builds it again from its commit.
88
+ *
89
+ * `POST /v1/images` · scope `sandboxes:write` · served by the node
90
+ */
91
+ importImage(body: T.ImageImportRequest, options?: RequestOptions): APIPromise<T.Image>;
92
+ /**
93
+ * Check a build context tar
94
+ *
95
+ * This project's tar with this sha256 and when it expires, or `404 image_context_not_found` when it was never uploaded or has expired. A client checks before it uploads.
96
+ *
97
+ * `GET /v1/images/contexts/{sha256}` · scope `sandboxes:read` · served by the node
98
+ */
99
+ getContext(sha256: string, options?: RequestOptions): APIPromise<T.ImageContext>;
100
+ /**
101
+ * Upload a build context tar
102
+ *
103
+ * Stores the body, a tar (plain or gzip), as a build context of this project under its sha256, for
104
+ * `POST /v1/images {"build": {"context": [{"sha256": "…"}]}}`. The body's sha256 must be the one in the path
105
+ * (`400` otherwise). A tar is at most 100 MiB: split a larger context into more tars (they are unpacked in
106
+ * order, each at its `at`). It is kept 24 hours after its last upload or the last build that named it, and
107
+ * only this project can use it. Your organization's stored tars count against `images.contexts_bytes`
108
+ * (`422 limit_exceeded`). The node never unpacks a tar: only the build microVM does. Uploading the same tar
109
+ * again answers `200` and keeps it another 24 hours.
110
+ *
111
+ * `PUT /v1/images/contexts/{sha256}` · scope `sandboxes:write` · served by the node
112
+ */
113
+ putContext(sha256: string, data: BinaryInput, options?: RequestOptions): APIPromise<T.ImageContext>;
114
+ /**
115
+ * Delete an image
116
+ *
117
+ * Deletes the image, its template, its warm snapshot and its root file system. An import in progress is
118
+ * cancelled and leaves nothing behind. While a running or paused sandbox, or a snapshot taken from one, uses
119
+ * the image's template the answer is `409 image_in_use`.
120
+ *
121
+ * `DELETE /v1/images/{image_id}` · scope `sandboxes:write` · served by the node
122
+ */
123
+ deleteImage(imageId: string, options?: RequestOptions): APIPromise<T.Deleted>;
124
+ /**
125
+ * Get an image
126
+ *
127
+ * Returns one of this project's images. With `wait` (seconds, at most 30) the answer is held until the image is
128
+ * `ready`, `failed` or `evicted`, or the time passes, whichever is first; it then returns the image as it is.
129
+ * `stages_ms` times each stage the import has finished; `error` says why a `failed` image failed, with the
130
+ * last 4 KiB of output.
131
+ *
132
+ * `GET /v1/images/{image_id}` · scope `sandboxes:read` · served by the node
133
+ */
134
+ getImage(imageId: string, params?: T.ImagesGetImageParams, options?: RequestOptions): APIPromise<T.Image>;
135
+ /**
136
+ * Read an image's build log
137
+ *
138
+ * The build log of one of this project's images (a Dockerfile build's output, its last 1 MiB), as lines from
139
+ * `offset` (0 is the first), at most 1,000 per answer. `next_offset` is where the next read starts. The log is
140
+ * kept when the build microVM ends, so a build still running has no lines yet, and an import has none. With
141
+ * `wait` (seconds, at most 30) the answer is held until there are lines past `offset` or the image is `ready`,
142
+ * `failed` or `evicted`, whichever is first. To follow a build, read again from `next_offset` until `status`
143
+ * is one of those and no lines come.
144
+ *
145
+ * `GET /v1/images/{image_id}/logs` · scope `sandboxes:read` · served by the node
146
+ */
147
+ getImageLogs(imageId: string, params?: T.ImagesGetImageLogsParams, options?: RequestOptions): APIPromise<T.ImageLog>;
148
+ /**
149
+ * Release an application's hold on an image
150
+ *
151
+ * Ends `app`'s hold on the image (`held_by`), as `b3os app down` does for each image the application holds. The
152
+ * image is then removed now, as `DELETE /v1/images/{image_id}` removes it, when it is not `kept`, no other
153
+ * application holds it and no running, paused or hibernated sandbox and no snapshot uses its template
154
+ * (`removed: true`). Otherwise it stays, and the answer says why: `held_by`, `kept` or `in_use`. An image that
155
+ * stays only because something uses it goes once nothing does. Releasing a hold the application does not have
156
+ * changes nothing. An import still in progress for another holder answers `409 conflict`; release it once it
157
+ * is ready or failed.
158
+ *
159
+ * `POST /v1/images/{image_id}/release` · scope `sandboxes:write` · served by the node
160
+ */
161
+ releaseImage(imageId: string, body: T.ImageReleaseRequest, options?: RequestOptions): APIPromise<T.ImageRelease>;
162
+ }
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ // Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ImagesAPI = exports.imagesOps = void 0;
5
+ const namespace_ts_1 = require("../../core/namespace.js");
6
+ const listImagesOp = {
7
+ id: "imagesListImages",
8
+ method: "GET",
9
+ path: "/v1/images",
10
+ timeoutMs: 10000,
11
+ scope: "sandboxes:read",
12
+ };
13
+ const importImageOp = {
14
+ id: "imagesImportImage",
15
+ method: "POST",
16
+ path: "/v1/images",
17
+ body: "json",
18
+ timeoutMs: 30000,
19
+ scope: "sandboxes:write",
20
+ };
21
+ const getContextOp = {
22
+ id: "imagesGetContext",
23
+ method: "GET",
24
+ path: "/v1/images/contexts/{sha256}",
25
+ params: ["sha256"],
26
+ timeoutMs: 10000,
27
+ scope: "sandboxes:read",
28
+ };
29
+ const putContextOp = {
30
+ id: "imagesPutContext",
31
+ method: "PUT",
32
+ path: "/v1/images/contexts/{sha256}",
33
+ params: ["sha256"],
34
+ body: "bytes",
35
+ contentType: "application/octet-stream",
36
+ timeoutMs: 60000,
37
+ scope: "sandboxes:write",
38
+ };
39
+ const deleteImageOp = {
40
+ id: "imagesDeleteImage",
41
+ method: "DELETE",
42
+ path: "/v1/images/{image_id}",
43
+ params: ["image_id"],
44
+ timeoutMs: 30000,
45
+ scope: "sandboxes:write",
46
+ };
47
+ const getImageOp = {
48
+ id: "imagesGetImage",
49
+ method: "GET",
50
+ path: "/v1/images/{image_id}",
51
+ params: ["image_id"],
52
+ timeoutMs: 35000,
53
+ scope: "sandboxes:read",
54
+ };
55
+ const getImageLogsOp = {
56
+ id: "imagesGetImageLogs",
57
+ method: "GET",
58
+ path: "/v1/images/{image_id}/logs",
59
+ params: ["image_id"],
60
+ timeoutMs: 35000,
61
+ scope: "sandboxes:read",
62
+ };
63
+ const releaseImageOp = {
64
+ id: "imagesReleaseImage",
65
+ method: "POST",
66
+ path: "/v1/images/{image_id}/release",
67
+ params: ["image_id"],
68
+ body: "json",
69
+ timeoutMs: 30000,
70
+ scope: "sandboxes:write",
71
+ };
72
+ /** Descriptors of every images operation, keyed by method name (for tooling and custom clients). */
73
+ exports.imagesOps = {
74
+ listImages: listImagesOp,
75
+ importImage: importImageOp,
76
+ getContext: getContextOp,
77
+ putContext: putContextOp,
78
+ deleteImage: deleteImageOp,
79
+ getImage: getImageOp,
80
+ getImageLogs: getImageLogsOp,
81
+ releaseImage: releaseImageOp,
82
+ };
83
+ /** Public OCI images imported as templates for your project's sandboxes (`/v1/images`). */
84
+ class ImagesAPI extends namespace_ts_1.Namespace {
85
+ /**
86
+ * List images
87
+ *
88
+ * Lists this project's images, newest first, in every status (an `evicted` or `failed` image stays listed
89
+ * until it is deleted). Other projects' images are never listed.
90
+ *
91
+ * `GET /v1/images` · scope `sandboxes:read` · served by the node
92
+ */
93
+ listImages(options) {
94
+ return this._client._call(listImagesOp, {}, options);
95
+ }
96
+ /**
97
+ * Import an image
98
+ *
99
+ * Imports a public OCI image, or builds one from a Dockerfile (`build`, with the `images.build` flag), as a
100
+ * template for this project's sandboxes. A build skips the resolve: it is queued, then `building` in a microVM
101
+ * of its own, and from the unpacking on it goes as an import does. The reference is resolved before the
102
+ * answer (a tag to its digest with one manifest `HEAD`), so the answer names the exact image: `202` with a new
103
+ * image (`status: queued`), or `200` with the project's existing image when one with the same key exists,
104
+ * ready or still importing. The key covers the project, the image's digest, the warm-up, the size and the
105
+ * node's own build inputs (guest agent, kernel, the unpacker), so the same request after a node release can be
106
+ * a new image. Watch it with `GET /v1/images/{image_id}?wait=30` until `ready` (or `failed`), then create
107
+ * sandboxes with `POST /v1/sandboxes {"image": "img_…"}`.
108
+ *
109
+ * The import runs whether or not the client stays connected. It holds `images.rootfs_max` of your
110
+ * organization's snapshot storage while it runs and then counts as one snapshot, its root file system plus its
111
+ * warm snapshot's memory, against `sandboxes.snapshots_max` and `sandboxes.snapshot_storage_max`. An
112
+ * organization runs one import at a time and a node two; more wait in the queue (`queued`). The CPU the import
113
+ * uses (the unpacking microVM and the warm-up boot) is recorded as `images.import_vcpu_ms`.
114
+ *
115
+ * `warmup.commands` run in order, each as an argument list (no shell unless you name one), as root, with no
116
+ * network, at most 300 seconds in all; what they read is in the page cache of every sandbox restored from the
117
+ * snapshot. The image's `USER`, `ENV` and `WORKDIR` apply to every command your sandboxes run. Clones of one
118
+ * warm snapshot share the in-process random state of anything the warm-up left running, within your project
119
+ * only; the kernel's random pool is reseeded for each.
120
+ *
121
+ * `size` (`vcpu`, `memory_mib`) is fixed at import: every sandbox from the image has it, and a create that asks
122
+ * for another size answers `400 invalid_request`.
123
+ *
124
+ * A private image (`images.build`) names a registry connection in `auth` (see `ImageRegistryAuth`); using it
125
+ * also needs `vault:run`. A connection of another project, or one this credential may not use, answers `404
126
+ * connection_not_found`; one that is not a registry connection for the image's registry, `422
127
+ * image_auth_invalid`; a credential the registry's token service refuses, `422 image_refused` with `reason:
128
+ * credentials`. While the flag is off, `auth` answers `400 invalid_request`. Without the flag on for your organization the answer is
129
+ * `404 feature_not_enabled`; without an image store on the node, a full store or the node's disk under its
130
+ * floor, `503 capacity_unavailable`.
131
+ *
132
+ * A `failed` image whose warm snapshot could not be rebuilt (`error.stage: rebuild`) keeps its root file
133
+ * system, and the node tries it again at its next start. The same request imports it again under its ID and
134
+ * replaces that file system, except while a running or paused sandbox, or a snapshot taken from one, uses the
135
+ * image's template: then the answer is `409 image_in_use`.
136
+ *
137
+ * `name` (with the `images.build` flag; without it the answer is `404 feature_not_enabled`) gives the image a
138
+ * name in this project, which a create resolves inside the project only: `POST /v1/sandboxes {"template":
139
+ * "py:3.11"}`. A name is unique among the project's images (`409 image_name_taken` while another image, of any
140
+ * status, has it; delete that one first) and is never a node template's (`422 image_name_reserved` for `base`,
141
+ * `base:v1` and the like). The name is part of the key: the same image under another name, or without one, is
142
+ * another image.
143
+ *
144
+ * `app` (with the `images.build` flag) asks for the image on behalf of an application, the `name` of its
145
+ * b3os.yaml: `b3os apply` sends it for `build.image` and `build.dockerfile`. The application then holds the
146
+ * image (`held_by`), new or existing: the same request from two applications is one image with two holds. An
147
+ * image asked for without `app`, even once, is `kept`: it stays until you delete it, as every image did before
148
+ * holds. An image that is not kept goes once no application holds it and no running, paused or hibernated
149
+ * sandbox and no snapshot uses its template. An application's hold ends when `b3os app down` releases it
150
+ * (`POST /v1/images/{image_id}/release`), or by itself once none of the application's sandboxes (running, or
151
+ * stopped and still listed, for 7 days) runs from the image and the application has not asked for it for
152
+ * `[images] hold_h` (7 days): a rollback can start every generation still listed from its image. When an
153
+ * import does not fit the node's image store, images that are not kept, that no sandbox or snapshot uses and
154
+ * that no application asked for in the last hour go first, least recently used first; a rollback to one of
155
+ * them imports it again by digest, or builds it again from its commit.
156
+ *
157
+ * `POST /v1/images` · scope `sandboxes:write` · served by the node
158
+ */
159
+ importImage(body, options) {
160
+ return this._client._call(importImageOp, { body }, options);
161
+ }
162
+ /**
163
+ * Check a build context tar
164
+ *
165
+ * This project's tar with this sha256 and when it expires, or `404 image_context_not_found` when it was never uploaded or has expired. A client checks before it uploads.
166
+ *
167
+ * `GET /v1/images/contexts/{sha256}` · scope `sandboxes:read` · served by the node
168
+ */
169
+ getContext(sha256, options) {
170
+ return this._client._call(getContextOp, { path: [sha256] }, options);
171
+ }
172
+ /**
173
+ * Upload a build context tar
174
+ *
175
+ * Stores the body, a tar (plain or gzip), as a build context of this project under its sha256, for
176
+ * `POST /v1/images {"build": {"context": [{"sha256": "…"}]}}`. The body's sha256 must be the one in the path
177
+ * (`400` otherwise). A tar is at most 100 MiB: split a larger context into more tars (they are unpacked in
178
+ * order, each at its `at`). It is kept 24 hours after its last upload or the last build that named it, and
179
+ * only this project can use it. Your organization's stored tars count against `images.contexts_bytes`
180
+ * (`422 limit_exceeded`). The node never unpacks a tar: only the build microVM does. Uploading the same tar
181
+ * again answers `200` and keeps it another 24 hours.
182
+ *
183
+ * `PUT /v1/images/contexts/{sha256}` · scope `sandboxes:write` · served by the node
184
+ */
185
+ putContext(sha256, data, options) {
186
+ return this._client._call(putContextOp, { path: [sha256], body: data }, options);
187
+ }
188
+ /**
189
+ * Delete an image
190
+ *
191
+ * Deletes the image, its template, its warm snapshot and its root file system. An import in progress is
192
+ * cancelled and leaves nothing behind. While a running or paused sandbox, or a snapshot taken from one, uses
193
+ * the image's template the answer is `409 image_in_use`.
194
+ *
195
+ * `DELETE /v1/images/{image_id}` · scope `sandboxes:write` · served by the node
196
+ */
197
+ deleteImage(imageId, options) {
198
+ return this._client._call(deleteImageOp, { path: [imageId] }, options);
199
+ }
200
+ /**
201
+ * Get an image
202
+ *
203
+ * Returns one of this project's images. With `wait` (seconds, at most 30) the answer is held until the image is
204
+ * `ready`, `failed` or `evicted`, or the time passes, whichever is first; it then returns the image as it is.
205
+ * `stages_ms` times each stage the import has finished; `error` says why a `failed` image failed, with the
206
+ * last 4 KiB of output.
207
+ *
208
+ * `GET /v1/images/{image_id}` · scope `sandboxes:read` · served by the node
209
+ */
210
+ getImage(imageId, params, options) {
211
+ return this._client._call(getImageOp, { path: [imageId], query: params }, options);
212
+ }
213
+ /**
214
+ * Read an image's build log
215
+ *
216
+ * The build log of one of this project's images (a Dockerfile build's output, its last 1 MiB), as lines from
217
+ * `offset` (0 is the first), at most 1,000 per answer. `next_offset` is where the next read starts. The log is
218
+ * kept when the build microVM ends, so a build still running has no lines yet, and an import has none. With
219
+ * `wait` (seconds, at most 30) the answer is held until there are lines past `offset` or the image is `ready`,
220
+ * `failed` or `evicted`, whichever is first. To follow a build, read again from `next_offset` until `status`
221
+ * is one of those and no lines come.
222
+ *
223
+ * `GET /v1/images/{image_id}/logs` · scope `sandboxes:read` · served by the node
224
+ */
225
+ getImageLogs(imageId, params, options) {
226
+ return this._client._call(getImageLogsOp, { path: [imageId], query: params }, options);
227
+ }
228
+ /**
229
+ * Release an application's hold on an image
230
+ *
231
+ * Ends `app`'s hold on the image (`held_by`), as `b3os app down` does for each image the application holds. The
232
+ * image is then removed now, as `DELETE /v1/images/{image_id}` removes it, when it is not `kept`, no other
233
+ * application holds it and no running, paused or hibernated sandbox and no snapshot uses its template
234
+ * (`removed: true`). Otherwise it stays, and the answer says why: `held_by`, `kept` or `in_use`. An image that
235
+ * stays only because something uses it goes once nothing does. Releasing a hold the application does not have
236
+ * changes nothing. An import still in progress for another holder answers `409 conflict`; release it once it
237
+ * is ready or failed.
238
+ *
239
+ * `POST /v1/images/{image_id}/release` · scope `sandboxes:write` · served by the node
240
+ */
241
+ releaseImage(imageId, body, options) {
242
+ return this._client._call(releaseImageOp, { path: [imageId], body }, options);
243
+ }
244
+ }
245
+ exports.ImagesAPI = ImagesAPI;
246
+ //# sourceMappingURL=images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.js","sourceRoot":"","sources":["../../../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13,9 +13,11 @@ export declare const inferOps: {
13
13
  readonly createEmbeddings: Op;
14
14
  readonly listModels: Op;
15
15
  readonly getModel: Op;
16
+ readonly createRerank: Op;
16
17
  readonly createResponse: Op;
17
18
  readonly createMessage: Op;
18
19
  readonly countMessageTokens: Op;
20
+ readonly createRerankV2: Op;
19
21
  };
20
22
  /** Models on the node: OpenAI-compatible chat, embeddings and speech (`/v1/infer`). */
21
23
  export declare class InferAPI extends Namespace {
@@ -137,8 +139,33 @@ export declare class InferAPI extends Namespace {
137
139
  /**
138
140
  * Create embeddings
139
141
  *
140
- * The OpenAI Embeddings API, for embedding models the node serves (`b3os.kind` is `embedding`). Other models
141
- * return `404 model_not_available`; the beta node serves no embedding model yet. Bills input tokens.
142
+ * The OpenAI Embeddings API, for embedding models the node serves (`b3os.kind` is `embedding` in
143
+ * `GET /v1/infer/models`). Other models return `404 model_not_available`; the beta node serves no embedding
144
+ * model yet. An embedding model has no alias: name its own ID, so stored vectors always come from the model
145
+ * that made them.
146
+ *
147
+ * `input` is a string or 1 to 2,048 strings, none of them empty (`400 invalid_request` pointing at it). Arrays
148
+ * of token IDs are `400 unsupported_parameter`: the node reads text only, and token IDs from another tokenizer
149
+ * would give wrong vectors (LangChain's `OpenAIEmbeddings` sends them unless it is created with
150
+ * `check_embedding_ctx_length=False`). An input may have as many tokens as the model's `context_length`,
151
+ * query prompt included; a longer one is `400 context_length_exceeded` pointing at it, unless `truncate` is
152
+ * `end`, which cuts it at the end to fit.
153
+ *
154
+ * `encoding_format` is `float` (the default) or `base64` (little-endian float32, what the OpenAI SDKs ask for
155
+ * by default); both carry the same numbers. Every vector has length 1. `dimensions` shortens the vectors, from
156
+ * the model's `b3os.min_dimensions` to its `b3os.dimensions` values (`400 unsupported_parameter` outside it):
157
+ * the node cuts each vector and scales it back to length 1. `user` is accepted and ignored.
158
+ *
159
+ * B3OS extensions: `input_type: "query"` puts the model's query prompt before each input, for text you search
160
+ * with (`document`, the default, embeds the input as it is), and `instruction` replaces the task the prompt
161
+ * describes (with `input_type: "query"` only, at most 512 characters). The prompt's tokens are billed with the
162
+ * input. The node sends a large request to the model in parts of at most 8,192 tokens and answers in input
163
+ * order.
164
+ *
165
+ * Bills `infer.embed_tokens`, the tokens the model read; a request that fails is not billed. Requests are
166
+ * admitted against your organization's per-minute token and request limits on the model, and against 8
167
+ * embedding and rerank requests in flight per organization (`429 concurrency_limited`, limit
168
+ * `infer.pool.concurrent`). Embeddings are never kept by the model call log. No streaming.
142
169
  *
143
170
  * `POST /v1/infer/embeddings` · scope `infer:run` · served by the node
144
171
  *
@@ -152,7 +179,8 @@ export declare class InferAPI extends Namespace {
152
179
  * quantization, whether it supports tools, JSON Schema output and image input, the largest accepted request,
153
180
  * and your per-model token and request limits. Chat models are listed while the node's model runtime is
154
181
  * configured (one that is restarting is still listed; requests get `503` with `Retry-After`); speech models
155
- * while the voice service answers.
182
+ * while the voice service answers. Embedding and rerank models, where a node serves them, are listed the same
183
+ * way, each with its own engine.
156
184
  *
157
185
  * `GET /v1/infer/models` · scope `infer:read` · served by the node
158
186
  */
@@ -165,6 +193,34 @@ export declare class InferAPI extends Namespace {
165
193
  * `GET /v1/infer/models/{model}` · scope `infer:read` · served by the node
166
194
  */
167
195
  getModel(model: string, options?: RequestOptions): APIPromise<T.Model>;
196
+ /**
197
+ * Rerank documents
198
+ *
199
+ * Ranks documents by how well they answer a query, in the shape of Cohere's v2 rerank API, for rerank models
200
+ * the node serves (`b3os.kind` is `rerank` in `GET /v1/infer/models`). Other models return
201
+ * `404 model_not_available`; the beta node serves no rerank model yet. The same operation answers at
202
+ * `POST /v1/infer/v2/rerank`, so Cohere's SDK works with its base URL set to
203
+ * `https://beta-api.b3os.org/v1/infer`.
204
+ *
205
+ * `documents` holds 1 to 1,000 strings or `{text}` objects, none of them empty. `query` may have 2,048 tokens
206
+ * (`400 context_length_exceeded` past it). Each document is cut at the end to `max_tokens_per_doc` tokens
207
+ * (default 4,096, at most 8,000), and further where the query and the document together would pass the
208
+ * model's `context_length`. `results` lists the `top_n` best documents (default: all of them), highest
209
+ * `relevance_score` (0 to 1) first, each with its `index` in `documents`; with `return_documents: true` each
210
+ * also carries its document as sent. B3OS extension: `instruction` replaces the task the model's query prompt
211
+ * describes (at most 512 characters). The node sends a large request to the model in parts of at most 8,192
212
+ * tokens.
213
+ *
214
+ * Bills `infer.rerank_tokens`, the tokens of every query and document pair the model read
215
+ * (`usage.total_tokens`, also in `meta.billed_units.input_tokens`); a request that fails is not billed. Limits
216
+ * as for embeddings: per-minute tokens and requests on the model, and 8 embedding and rerank requests in
217
+ * flight per organization. Rerank calls are never kept by the model call log. No streaming.
218
+ *
219
+ * `POST /v1/infer/rerank` · scope `infer:run` · served by the node
220
+ *
221
+ * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
222
+ */
223
+ createRerank(body: T.RerankRequest, options?: RequestOptions): APIPromise<T.RerankList>;
168
224
  /**
169
225
  * Create a response (OpenAI Responses API)
170
226
  *
@@ -318,4 +374,16 @@ export declare class InferAPI extends Namespace {
318
374
  * `POST /v1/infer/v1/messages/count_tokens` · scope `infer:run` · served by the node
319
375
  */
320
376
  countMessageTokens(body: T.AnthropicCountTokensRequest, options?: RequestOptions): APIPromise<T.AnthropicCountTokens>;
377
+ /**
378
+ * Rerank documents at Cohere's path
379
+ *
380
+ * `POST /v1/infer/rerank` at the path Cohere's v2 SDK calls (`<base URL>/v2/rerank`), so
381
+ * `cohere.ClientV2(base_url="https://beta-api.b3os.org/v1/infer")` works unchanged. The request, the answer,
382
+ * the limits and the meter are those of `POST /v1/infer/rerank`.
383
+ *
384
+ * `POST /v1/infer/v2/rerank` · scope `infer:run` · served by the node
385
+ *
386
+ * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
387
+ */
388
+ createRerankV2(body: T.RerankRequest, options?: RequestOptions): APIPromise<T.RerankList>;
321
389
  }