@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.
- package/README.md +1 -1
- package/dist/cjs/core/util.d.ts +1 -1
- package/dist/cjs/core/util.js +1 -1
- package/dist/cjs/generated/client.d.ts +18 -0
- package/dist/cjs/generated/client.js +34 -0
- package/dist/cjs/generated/client.js.map +1 -1
- package/dist/cjs/generated/errors.d.ts +1 -1
- package/dist/cjs/generated/errors.js +120 -0
- package/dist/cjs/generated/errors.js.map +1 -1
- package/dist/cjs/generated/ids.d.ts +89 -0
- package/dist/cjs/generated/ids.js +22 -0
- package/dist/cjs/generated/ids.js.map +1 -1
- package/dist/cjs/generated/jobs.js +4 -0
- package/dist/cjs/generated/jobs.js.map +1 -1
- package/dist/cjs/generated/ns/actions.d.ts +267 -33
- package/dist/cjs/generated/ns/actions.js +375 -33
- package/dist/cjs/generated/ns/actions.js.map +1 -1
- package/dist/cjs/generated/ns/agents.d.ts +656 -0
- package/dist/cjs/generated/ns/agents.js +989 -0
- package/dist/cjs/generated/ns/agents.js.map +1 -0
- package/dist/cjs/generated/ns/images.d.ts +162 -0
- package/dist/cjs/generated/ns/images.js +246 -0
- package/dist/cjs/generated/ns/images.js.map +1 -0
- package/dist/cjs/generated/ns/infer.d.ts +71 -3
- package/dist/cjs/generated/ns/infer.js +98 -3
- package/dist/cjs/generated/ns/infer.js.map +1 -1
- package/dist/cjs/generated/ns/keys.d.ts +3 -1
- package/dist/cjs/generated/ns/keys.js +3 -1
- package/dist/cjs/generated/ns/keys.js.map +1 -1
- package/dist/cjs/generated/ns/listeners.d.ts +163 -0
- package/dist/cjs/generated/ns/listeners.js +268 -0
- package/dist/cjs/generated/ns/listeners.js.map +1 -0
- package/dist/cjs/generated/ns/orgs.d.ts +10 -0
- package/dist/cjs/generated/ns/orgs.js +26 -1
- package/dist/cjs/generated/ns/orgs.js.map +1 -1
- package/dist/cjs/generated/ns/projects.d.ts +32 -0
- package/dist/cjs/generated/ns/projects.js +66 -0
- package/dist/cjs/generated/ns/projects.js.map +1 -1
- package/dist/cjs/generated/ns/render.d.ts +192 -21
- package/dist/cjs/generated/ns/render.js +267 -24
- package/dist/cjs/generated/ns/render.js.map +1 -1
- package/dist/cjs/generated/ns/requests.d.ts +3 -1
- package/dist/cjs/generated/ns/requests.js +3 -1
- package/dist/cjs/generated/ns/requests.js.map +1 -1
- package/dist/cjs/generated/ns/routines.d.ts +22 -4
- package/dist/cjs/generated/ns/routines.js +22 -4
- package/dist/cjs/generated/ns/routines.js.map +1 -1
- package/dist/cjs/generated/ns/sandboxes.d.ts +431 -7
- package/dist/cjs/generated/ns/sandboxes.js +633 -6
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
- package/dist/cjs/generated/ns/usage.d.ts +1 -1
- package/dist/cjs/generated/ns/usage.js +1 -1
- package/dist/cjs/generated/ns/vision.d.ts +113 -17
- package/dist/cjs/generated/ns/vision.js +152 -21
- package/dist/cjs/generated/ns/vision.js.map +1 -1
- package/dist/cjs/generated/ns/workspaces.d.ts +225 -0
- package/dist/cjs/generated/ns/workspaces.js +410 -0
- package/dist/cjs/generated/ns/workspaces.js.map +1 -0
- package/dist/cjs/generated/types.d.ts +5259 -605
- package/dist/cjs/helpers/sandboxes.d.ts +20 -1
- package/dist/cjs/helpers/sandboxes.js +13 -1
- package/dist/cjs/helpers/sandboxes.js.map +1 -1
- package/dist/esm/core/util.d.ts +1 -1
- package/dist/esm/core/util.js +1 -1
- package/dist/esm/generated/client.d.ts +18 -0
- package/dist/esm/generated/client.js +34 -0
- package/dist/esm/generated/client.js.map +1 -1
- package/dist/esm/generated/errors.d.ts +1 -1
- package/dist/esm/generated/errors.js +120 -0
- package/dist/esm/generated/errors.js.map +1 -1
- package/dist/esm/generated/ids.d.ts +89 -0
- package/dist/esm/generated/ids.js +22 -0
- package/dist/esm/generated/ids.js.map +1 -1
- package/dist/esm/generated/jobs.js +4 -0
- package/dist/esm/generated/jobs.js.map +1 -1
- package/dist/esm/generated/ns/actions.d.ts +267 -33
- package/dist/esm/generated/ns/actions.js +375 -33
- package/dist/esm/generated/ns/actions.js.map +1 -1
- package/dist/esm/generated/ns/agents.d.ts +656 -0
- package/dist/esm/generated/ns/agents.js +985 -0
- package/dist/esm/generated/ns/agents.js.map +1 -0
- package/dist/esm/generated/ns/images.d.ts +162 -0
- package/dist/esm/generated/ns/images.js +242 -0
- package/dist/esm/generated/ns/images.js.map +1 -0
- package/dist/esm/generated/ns/infer.d.ts +71 -3
- package/dist/esm/generated/ns/infer.js +98 -3
- package/dist/esm/generated/ns/infer.js.map +1 -1
- package/dist/esm/generated/ns/keys.d.ts +3 -1
- package/dist/esm/generated/ns/keys.js +3 -1
- package/dist/esm/generated/ns/keys.js.map +1 -1
- package/dist/esm/generated/ns/listeners.d.ts +163 -0
- package/dist/esm/generated/ns/listeners.js +264 -0
- package/dist/esm/generated/ns/listeners.js.map +1 -0
- package/dist/esm/generated/ns/orgs.d.ts +10 -0
- package/dist/esm/generated/ns/orgs.js +26 -1
- package/dist/esm/generated/ns/orgs.js.map +1 -1
- package/dist/esm/generated/ns/projects.d.ts +32 -0
- package/dist/esm/generated/ns/projects.js +66 -0
- package/dist/esm/generated/ns/projects.js.map +1 -1
- package/dist/esm/generated/ns/render.d.ts +192 -21
- package/dist/esm/generated/ns/render.js +267 -24
- package/dist/esm/generated/ns/render.js.map +1 -1
- package/dist/esm/generated/ns/requests.d.ts +3 -1
- package/dist/esm/generated/ns/requests.js +3 -1
- package/dist/esm/generated/ns/requests.js.map +1 -1
- package/dist/esm/generated/ns/routines.d.ts +22 -4
- package/dist/esm/generated/ns/routines.js +22 -4
- package/dist/esm/generated/ns/routines.js.map +1 -1
- package/dist/esm/generated/ns/sandboxes.d.ts +431 -7
- package/dist/esm/generated/ns/sandboxes.js +633 -6
- package/dist/esm/generated/ns/sandboxes.js.map +1 -1
- package/dist/esm/generated/ns/usage.d.ts +1 -1
- package/dist/esm/generated/ns/usage.js +1 -1
- package/dist/esm/generated/ns/vision.d.ts +113 -17
- package/dist/esm/generated/ns/vision.js +152 -21
- package/dist/esm/generated/ns/vision.js.map +1 -1
- package/dist/esm/generated/ns/workspaces.d.ts +225 -0
- package/dist/esm/generated/ns/workspaces.js +406 -0
- package/dist/esm/generated/ns/workspaces.js.map +1 -0
- package/dist/esm/generated/types.d.ts +5259 -605
- package/dist/esm/helpers/sandboxes.d.ts +20 -1
- package/dist/esm/helpers/sandboxes.js +13 -1
- package/dist/esm/helpers/sandboxes.js.map +1 -1
- package/package.json +1 -1
- package/src/core/util.ts +1 -1
- package/src/generated/client.ts +38 -0
- package/src/generated/errors.ts +240 -0
- package/src/generated/ids.ts +22 -0
- package/src/generated/jobs.ts +4 -0
- package/src/generated/ns/actions.ts +403 -33
- package/src/generated/ns/agents.ts +1102 -0
- package/src/generated/ns/images.ts +256 -0
- package/src/generated/ns/infer.ts +100 -3
- package/src/generated/ns/keys.ts +3 -1
- package/src/generated/ns/listeners.ts +300 -0
- package/src/generated/ns/orgs.ts +27 -1
- package/src/generated/ns/projects.ts +74 -0
- package/src/generated/ns/render.ts +277 -24
- package/src/generated/ns/requests.ts +3 -1
- package/src/generated/ns/routines.ts +22 -4
- package/src/generated/ns/sandboxes.ts +694 -7
- package/src/generated/ns/usage.ts +1 -1
- package/src/generated/ns/vision.ts +159 -21
- package/src/generated/ns/workspaces.ts +448 -0
- package/src/generated/types.ts +5684 -601
- package/src/helpers/sandboxes.ts +31 -2
|
@@ -21,6 +21,7 @@ const createChatCompletionOp = {
|
|
|
21
21
|
id: "inferCreateChatCompletion",
|
|
22
22
|
method: "POST",
|
|
23
23
|
path: "/v1/infer/chat/completions",
|
|
24
|
+
headerParams: { capture_content: "X-B3OS-Capture-Content", replay_of: "X-B3OS-Replay-Of" },
|
|
24
25
|
body: "json",
|
|
25
26
|
stream: "sse",
|
|
26
27
|
timeoutMs: 600000,
|
|
@@ -55,10 +56,21 @@ const getModelOp = {
|
|
|
55
56
|
errorFormat: "openai",
|
|
56
57
|
scope: "infer:read",
|
|
57
58
|
};
|
|
59
|
+
const createRerankOp = {
|
|
60
|
+
id: "inferCreateRerank",
|
|
61
|
+
method: "POST",
|
|
62
|
+
path: "/v1/infer/rerank",
|
|
63
|
+
body: "json",
|
|
64
|
+
timeoutMs: 65000,
|
|
65
|
+
errorFormat: "openai",
|
|
66
|
+
stretch: true,
|
|
67
|
+
scope: "infer:run",
|
|
68
|
+
};
|
|
58
69
|
const createResponseOp = {
|
|
59
70
|
id: "inferCreateResponse",
|
|
60
71
|
method: "POST",
|
|
61
72
|
path: "/v1/infer/responses",
|
|
73
|
+
headerParams: { capture_content: "X-B3OS-Capture-Content", replay_of: "X-B3OS-Replay-Of" },
|
|
62
74
|
body: "json",
|
|
63
75
|
stream: "sse",
|
|
64
76
|
timeoutMs: 600000,
|
|
@@ -69,6 +81,7 @@ const createMessageOp = {
|
|
|
69
81
|
id: "inferCreateMessage",
|
|
70
82
|
method: "POST",
|
|
71
83
|
path: "/v1/infer/v1/messages",
|
|
84
|
+
headerParams: { capture_content: "X-B3OS-Capture-Content", replay_of: "X-B3OS-Replay-Of" },
|
|
72
85
|
body: "json",
|
|
73
86
|
stream: "sse",
|
|
74
87
|
timeoutMs: 600000,
|
|
@@ -84,6 +97,16 @@ const countMessageTokensOp = {
|
|
|
84
97
|
errorFormat: "anthropic",
|
|
85
98
|
scope: "infer:run",
|
|
86
99
|
};
|
|
100
|
+
const createRerankV2Op = {
|
|
101
|
+
id: "inferCreateRerankV2",
|
|
102
|
+
method: "POST",
|
|
103
|
+
path: "/v1/infer/v2/rerank",
|
|
104
|
+
body: "json",
|
|
105
|
+
timeoutMs: 65000,
|
|
106
|
+
errorFormat: "openai",
|
|
107
|
+
stretch: true,
|
|
108
|
+
scope: "infer:run",
|
|
109
|
+
};
|
|
87
110
|
/** Descriptors of every infer operation, keyed by method name (for tooling and custom clients). */
|
|
88
111
|
export const inferOps = {
|
|
89
112
|
createSpeech: createSpeechOp,
|
|
@@ -92,9 +115,11 @@ export const inferOps = {
|
|
|
92
115
|
createEmbeddings: createEmbeddingsOp,
|
|
93
116
|
listModels: listModelsOp,
|
|
94
117
|
getModel: getModelOp,
|
|
118
|
+
createRerank: createRerankOp,
|
|
95
119
|
createResponse: createResponseOp,
|
|
96
120
|
createMessage: createMessageOp,
|
|
97
121
|
countMessageTokens: countMessageTokensOp,
|
|
122
|
+
createRerankV2: createRerankV2Op,
|
|
98
123
|
};
|
|
99
124
|
/** Models on the node: OpenAI-compatible chat, embeddings and speech (`/v1/infer`). */
|
|
100
125
|
export class InferAPI extends Namespace {
|
|
@@ -137,8 +162,33 @@ export class InferAPI extends Namespace {
|
|
|
137
162
|
/**
|
|
138
163
|
* Create embeddings
|
|
139
164
|
*
|
|
140
|
-
* The OpenAI Embeddings API, for embedding models the node serves (`b3os.kind` is `embedding`
|
|
141
|
-
* return `404 model_not_available`; the beta node serves no embedding
|
|
165
|
+
* The OpenAI Embeddings API, for embedding models the node serves (`b3os.kind` is `embedding` in
|
|
166
|
+
* `GET /v1/infer/models`). Other models return `404 model_not_available`; the beta node serves no embedding
|
|
167
|
+
* model yet. An embedding model has no alias: name its own ID, so stored vectors always come from the model
|
|
168
|
+
* that made them.
|
|
169
|
+
*
|
|
170
|
+
* `input` is a string or 1 to 2,048 strings, none of them empty (`400 invalid_request` pointing at it). Arrays
|
|
171
|
+
* of token IDs are `400 unsupported_parameter`: the node reads text only, and token IDs from another tokenizer
|
|
172
|
+
* would give wrong vectors (LangChain's `OpenAIEmbeddings` sends them unless it is created with
|
|
173
|
+
* `check_embedding_ctx_length=False`). An input may have as many tokens as the model's `context_length`,
|
|
174
|
+
* query prompt included; a longer one is `400 context_length_exceeded` pointing at it, unless `truncate` is
|
|
175
|
+
* `end`, which cuts it at the end to fit.
|
|
176
|
+
*
|
|
177
|
+
* `encoding_format` is `float` (the default) or `base64` (little-endian float32, what the OpenAI SDKs ask for
|
|
178
|
+
* by default); both carry the same numbers. Every vector has length 1. `dimensions` shortens the vectors, from
|
|
179
|
+
* the model's `b3os.min_dimensions` to its `b3os.dimensions` values (`400 unsupported_parameter` outside it):
|
|
180
|
+
* the node cuts each vector and scales it back to length 1. `user` is accepted and ignored.
|
|
181
|
+
*
|
|
182
|
+
* B3OS extensions: `input_type: "query"` puts the model's query prompt before each input, for text you search
|
|
183
|
+
* with (`document`, the default, embeds the input as it is), and `instruction` replaces the task the prompt
|
|
184
|
+
* describes (with `input_type: "query"` only, at most 512 characters). The prompt's tokens are billed with the
|
|
185
|
+
* input. The node sends a large request to the model in parts of at most 8,192 tokens and answers in input
|
|
186
|
+
* order.
|
|
187
|
+
*
|
|
188
|
+
* Bills `infer.embed_tokens`, the tokens the model read; a request that fails is not billed. Requests are
|
|
189
|
+
* admitted against your organization's per-minute token and request limits on the model, and against 8
|
|
190
|
+
* embedding and rerank requests in flight per organization (`429 concurrency_limited`, limit
|
|
191
|
+
* `infer.pool.concurrent`). Embeddings are never kept by the model call log. No streaming.
|
|
142
192
|
*
|
|
143
193
|
* `POST /v1/infer/embeddings` · scope `infer:run` · served by the node
|
|
144
194
|
*
|
|
@@ -154,7 +204,8 @@ export class InferAPI extends Namespace {
|
|
|
154
204
|
* quantization, whether it supports tools, JSON Schema output and image input, the largest accepted request,
|
|
155
205
|
* and your per-model token and request limits. Chat models are listed while the node's model runtime is
|
|
156
206
|
* configured (one that is restarting is still listed; requests get `503` with `Retry-After`); speech models
|
|
157
|
-
* while the voice service answers.
|
|
207
|
+
* while the voice service answers. Embedding and rerank models, where a node serves them, are listed the same
|
|
208
|
+
* way, each with its own engine.
|
|
158
209
|
*
|
|
159
210
|
* `GET /v1/infer/models` · scope `infer:read` · served by the node
|
|
160
211
|
*/
|
|
@@ -171,6 +222,36 @@ export class InferAPI extends Namespace {
|
|
|
171
222
|
getModel(model, options) {
|
|
172
223
|
return this._client._call(getModelOp, { path: [model] }, options);
|
|
173
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Rerank documents
|
|
227
|
+
*
|
|
228
|
+
* Ranks documents by how well they answer a query, in the shape of Cohere's v2 rerank API, for rerank models
|
|
229
|
+
* the node serves (`b3os.kind` is `rerank` in `GET /v1/infer/models`). Other models return
|
|
230
|
+
* `404 model_not_available`; the beta node serves no rerank model yet. The same operation answers at
|
|
231
|
+
* `POST /v1/infer/v2/rerank`, so Cohere's SDK works with its base URL set to
|
|
232
|
+
* `https://beta-api.b3os.org/v1/infer`.
|
|
233
|
+
*
|
|
234
|
+
* `documents` holds 1 to 1,000 strings or `{text}` objects, none of them empty. `query` may have 2,048 tokens
|
|
235
|
+
* (`400 context_length_exceeded` past it). Each document is cut at the end to `max_tokens_per_doc` tokens
|
|
236
|
+
* (default 4,096, at most 8,000), and further where the query and the document together would pass the
|
|
237
|
+
* model's `context_length`. `results` lists the `top_n` best documents (default: all of them), highest
|
|
238
|
+
* `relevance_score` (0 to 1) first, each with its `index` in `documents`; with `return_documents: true` each
|
|
239
|
+
* also carries its document as sent. B3OS extension: `instruction` replaces the task the model's query prompt
|
|
240
|
+
* describes (at most 512 characters). The node sends a large request to the model in parts of at most 8,192
|
|
241
|
+
* tokens.
|
|
242
|
+
*
|
|
243
|
+
* Bills `infer.rerank_tokens`, the tokens of every query and document pair the model read
|
|
244
|
+
* (`usage.total_tokens`, also in `meta.billed_units.input_tokens`); a request that fails is not billed. Limits
|
|
245
|
+
* as for embeddings: per-minute tokens and requests on the model, and 8 embedding and rerank requests in
|
|
246
|
+
* flight per organization. Rerank calls are never kept by the model call log. No streaming.
|
|
247
|
+
*
|
|
248
|
+
* `POST /v1/infer/rerank` · scope `infer:run` · served by the node
|
|
249
|
+
*
|
|
250
|
+
* Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
|
|
251
|
+
*/
|
|
252
|
+
createRerank(body, options) {
|
|
253
|
+
return this._client._call(createRerankOp, { body }, options);
|
|
254
|
+
}
|
|
174
255
|
createResponse(body, options = {}) {
|
|
175
256
|
if (body.stream) {
|
|
176
257
|
return this._client._postStream(createResponseOp, { body }, options, {
|
|
@@ -199,5 +280,19 @@ export class InferAPI extends Namespace {
|
|
|
199
280
|
countMessageTokens(body, options) {
|
|
200
281
|
return this._client._call(countMessageTokensOp, { body }, options);
|
|
201
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Rerank documents at Cohere's path
|
|
285
|
+
*
|
|
286
|
+
* `POST /v1/infer/rerank` at the path Cohere's v2 SDK calls (`<base URL>/v2/rerank`), so
|
|
287
|
+
* `cohere.ClientV2(base_url="https://beta-api.b3os.org/v1/infer")` works unchanged. The request, the answer,
|
|
288
|
+
* the limits and the meter are those of `POST /v1/infer/rerank`.
|
|
289
|
+
*
|
|
290
|
+
* `POST /v1/infer/v2/rerank` · scope `infer:run` · served by the node
|
|
291
|
+
*
|
|
292
|
+
* Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
|
|
293
|
+
*/
|
|
294
|
+
createRerankV2(body, options) {
|
|
295
|
+
return this._client._call(createRerankV2Op, { body }, options);
|
|
296
|
+
}
|
|
202
297
|
}
|
|
203
298
|
//# sourceMappingURL=infer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infer.js","sourceRoot":"","sources":["../../../../src/generated/ns/infer.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAI5G,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,WAAW;CACnB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,iBAAiB;IACrB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,wBAAwB;IAC9B,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,YAAY;CACpB,C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29,9 @@ export declare class KeysAPI extends Namespace {
|
|
|
29
29
|
*
|
|
30
30
|
* Creates a key in your project (or `project`, in the same organization). `scopes` and `spend_cap_usd` may not
|
|
31
31
|
* exceed the caller's own, and when the caller expires, `expires_at` must be set and no later than the caller's
|
|
32
|
-
* expiry (`forbidden`, reason `scope_escalation`). The response is the only time `secret` is returned.
|
|
32
|
+
* expiry (`forbidden`, reason `scope_escalation`). The response is the only time `secret` is returned. An
|
|
33
|
+
* organization holds at most `platform.keys.max` active API keys (1,000 in the beta; revoked and expired ones are
|
|
34
|
+
* not counted, nor CLI tokens); a create past it is 422 `limit_exceeded`.
|
|
33
35
|
*
|
|
34
36
|
* `POST /v1/keys` · scope `platform:write` · served by beta-api.b3os.org
|
|
35
37
|
*/
|
|
@@ -90,7 +90,9 @@ export class KeysAPI extends Namespace {
|
|
|
90
90
|
*
|
|
91
91
|
* Creates a key in your project (or `project`, in the same organization). `scopes` and `spend_cap_usd` may not
|
|
92
92
|
* exceed the caller's own, and when the caller expires, `expires_at` must be set and no later than the caller's
|
|
93
|
-
* expiry (`forbidden`, reason `scope_escalation`). The response is the only time `secret` is returned.
|
|
93
|
+
* expiry (`forbidden`, reason `scope_escalation`). The response is the only time `secret` is returned. An
|
|
94
|
+
* organization holds at most `platform.keys.max` active API keys (1,000 in the beta; revoked and expired ones are
|
|
95
|
+
* not counted, nor CLI tokens); a create past it is 422 `limit_exceeded`.
|
|
94
96
|
*
|
|
95
97
|
* `POST /v1/keys` · scope `platform:write` · served by beta-api.b3os.org
|
|
96
98
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../src/generated/ns/keys.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAG5G,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD,MAAM,UAAU,GAAO;IACrB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,UAAU;IA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AAK,CAAW,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { RequestOptions, StreamOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise, ListPromise } from "../../core/promise.ts";
|
|
5
|
+
import type { EventStream } from "../../core/sse.ts";
|
|
6
|
+
import type * as T from "../types.ts";
|
|
7
|
+
/** Descriptors of every listeners operation, keyed by method name (for tooling and custom clients). */
|
|
8
|
+
export declare const listenersOps: {
|
|
9
|
+
readonly listListeners: Op;
|
|
10
|
+
readonly createListener: Op;
|
|
11
|
+
readonly deleteListener: Op;
|
|
12
|
+
readonly getListener: Op;
|
|
13
|
+
readonly updateListener: Op;
|
|
14
|
+
readonly listEvents: Op;
|
|
15
|
+
readonly ingestEvents: Op;
|
|
16
|
+
readonly redeliverEvent: Op;
|
|
17
|
+
readonly streamEvents: Op;
|
|
18
|
+
readonly testListener: Op;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Persistent subscriptions: a polled, streamed or pushed source, a CEL filter and a routine or webhook sink (`/v1/listeners`).
|
|
22
|
+
*/
|
|
23
|
+
export declare class ListenersAPI extends Namespace {
|
|
24
|
+
/**
|
|
25
|
+
* List listeners
|
|
26
|
+
*
|
|
27
|
+
* Lists this project's listeners, newest first, in every status. Deleted listeners are not listed.
|
|
28
|
+
*
|
|
29
|
+
* `GET /v1/listeners` · scope `listeners:read` · served by the node
|
|
30
|
+
*/
|
|
31
|
+
listListeners(params?: T.ListenersListListenersParams, options?: RequestOptions): ListPromise<T.ListenerList, T.Listener>;
|
|
32
|
+
/**
|
|
33
|
+
* Create a listener
|
|
34
|
+
*
|
|
35
|
+
* Validates the definition, compiles its CEL expressions and starts the source; the answer is `201` with the
|
|
36
|
+
* listener in status `starting`, and `active` follows once the first connect or poll succeeds. A source that
|
|
37
|
+
* cannot be reached does not fail the create: the listener goes `reconnecting` and retries with backoff, and
|
|
38
|
+
* after 24 hours of failures it ends `failed` with the reason in `error`.
|
|
39
|
+
*
|
|
40
|
+
* The routine named in a `routine` sink must exist in this project and needs `routines:run` on top of
|
|
41
|
+
* `listeners:write`; a `source.connection` needs `vault:run`, and the URL's host must be one of the
|
|
42
|
+
* connection's `hosts` (otherwise `422 listener_invalid`, reason `connection_host`). Without `ttl_s` or
|
|
43
|
+
* `expires_at` the listener lives until it is deleted. Without `budget.events_per_day` it gets the
|
|
44
|
+
* organization's share, `listeners.events.daily` divided by `listeners.active.max`; the object always shows the
|
|
45
|
+
* budget in force.
|
|
46
|
+
*
|
|
47
|
+
* A `filter.model` asks the small model one question about each event CEL kept, as the listener's owner, so it
|
|
48
|
+
* needs `infer:run` and bills infer tokens, within `budget.model_tokens_per_day`. The question is the system
|
|
49
|
+
* message and the event its own delimited user message; no tools are offered and the answer is parsed strictly.
|
|
50
|
+
* An event's content can still try to steer the model: at worst it makes the answer `true` for that event,
|
|
51
|
+
* which `budget.events_per_day` and `budget.model_tokens_per_day` bound, so do not rely on the model filter
|
|
52
|
+
* alone to keep untrusted events from a sink that acts on them. When the model cannot answer (an error, a
|
|
53
|
+
* timeout, output that does not parse, the token budget spent), `on_error` decides (`drop` by default, or
|
|
54
|
+
* `pass`), and the event's `filter.model` says what happened.
|
|
55
|
+
*
|
|
56
|
+
* A `pack` source is checked by the actions trigger manager at create (the trigger exists, `with` is valid,
|
|
57
|
+
* its connections are usable) and is held there as a trigger subscription the listener owns; it is removed
|
|
58
|
+
* when the listener is paused, deleted or ends.
|
|
59
|
+
*
|
|
60
|
+
* A `webhook` source's listener is `active` at once, and its answer carries `source.hook_id` and
|
|
61
|
+
* `source.hook_url` to give the provider; with the `b3os` scheme it also carries `source.secret`, which no
|
|
62
|
+
* later answer shows. A `verify.secret` connection needs `vault:run`. A `websocket` source is held by the
|
|
63
|
+
* node's socket holder; while that unit is down the listener stays `starting` or `reconnecting`.
|
|
64
|
+
*
|
|
65
|
+
* The listener belongs to the creating key (`owner.kind: key`): when that key is revoked or expires the
|
|
66
|
+
* listener ends `revoked`. One created from a sandbox belongs to the key that created the sandbox and also
|
|
67
|
+
* ends when the sandbox's root sandbox ends.
|
|
68
|
+
*
|
|
69
|
+
* `POST /v1/listeners` · scope `listeners:write` · served by the node
|
|
70
|
+
*/
|
|
71
|
+
createListener(body: T.ListenerCreateRequest, options?: RequestOptions): APIPromise<T.Listener>;
|
|
72
|
+
/**
|
|
73
|
+
* Delete a listener
|
|
74
|
+
*
|
|
75
|
+
* Closes the source and stops delivery at once; an event already handed to its sink is not recalled. The
|
|
76
|
+
* event history stays readable for its 7 days through `GET /v1/listeners/{listener_id}/events` and is then
|
|
77
|
+
* deleted. A routine's listener trigger's listener (`sink.trigger`) answers `409 listener_managed`: it goes
|
|
78
|
+
* when its routine publishes a version without the trigger, or is deleted. A listener a routine trigger names
|
|
79
|
+
* (`sink.bound`) is its owner's to delete; the trigger then starts nothing and the routine shows a
|
|
80
|
+
* `listener_not_found` warning.
|
|
81
|
+
*
|
|
82
|
+
* `DELETE /v1/listeners/{listener_id}` · scope `listeners:write` · served by the node
|
|
83
|
+
*/
|
|
84
|
+
deleteListener(listenerId: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
85
|
+
/**
|
|
86
|
+
* Get a listener
|
|
87
|
+
*
|
|
88
|
+
* Returns one of this project's listeners: its status, the source's state (cursor, connected since, next
|
|
89
|
+
* attempt), the budget in force and what it used today (UTC), and its counters.
|
|
90
|
+
*
|
|
91
|
+
* `GET /v1/listeners/{listener_id}` · scope `listeners:read` · served by the node
|
|
92
|
+
*/
|
|
93
|
+
getListener(listenerId: string, options?: RequestOptions): APIPromise<T.Listener>;
|
|
94
|
+
/**
|
|
95
|
+
* Change, pause or resume a listener
|
|
96
|
+
*
|
|
97
|
+
* Changes the lifetime (`ttl_s` counts from now; `expires_at: null` removes it), the filter, the sink, the
|
|
98
|
+
* budget, `redact` and `metadata`. `paused: true` closes the source and stops delivery, keeping the cursor;
|
|
99
|
+
* `false` opens it again where it stopped. A listener paused by its budget resumes by itself when the UTC day
|
|
100
|
+
* ends, or now if the PATCH raises the budget above what it used. The source cannot change: create a new
|
|
101
|
+
* listener. A new filter or `redact` applies to events received after the answer. A listener that ended
|
|
102
|
+
* (`failed`, `expired`, `revoked`) answers `409 listener_not_active`, except that a `failed` one can be
|
|
103
|
+
* resumed with `paused: false`, which starts its source again. While a routine's trigger names the listener
|
|
104
|
+
* (`sink.bound`), a change of `sink` answers `409 listener_bound`; everything else can change.
|
|
105
|
+
*
|
|
106
|
+
* `PATCH /v1/listeners/{listener_id}` · scope `listeners:write` · served by the node
|
|
107
|
+
*/
|
|
108
|
+
updateListener(listenerId: string, body: T.ListenerUpdateRequest, options?: RequestOptions): APIPromise<T.Listener>;
|
|
109
|
+
/**
|
|
110
|
+
* List a listener's events
|
|
111
|
+
*
|
|
112
|
+
* The listener's history, newest first: every event it kept (duplicates within the dedupe window are only
|
|
113
|
+
* counted, in `stats.duplicates`) with its payload, the filter's verdict, its status and its delivery, and a
|
|
114
|
+
* `gap` record for each time the source was down with events possibly missed. Kept 7 days. Payloads larger
|
|
115
|
+
* than 64 KiB are cut to their first 64 KiB with `payload_truncated: true`. Values at the listener's `redact`
|
|
116
|
+
* paths read `"[redacted]"`.
|
|
117
|
+
*
|
|
118
|
+
* `GET /v1/listeners/{listener_id}/events` · scope `listeners:read` · served by the node
|
|
119
|
+
*/
|
|
120
|
+
listEvents(listenerId: string, params?: T.ListenersListEventsParams, options?: RequestOptions): ListPromise<T.ListenerEventList, T.ListenerEvent>;
|
|
121
|
+
/**
|
|
122
|
+
* Send events to a push listener
|
|
123
|
+
*
|
|
124
|
+
* Sends up to 100 events to a listener whose source is `push`. Each goes through dedupe (its `dedupe_key`, or
|
|
125
|
+
* the listener's `dedupe.key` expression, or a hash of the payload), the filter and the sink, as an event from
|
|
126
|
+
* any other source would. The answer comes once every event is in the listener's log (`202`); delivery
|
|
127
|
+
* follows. A listener of another source type answers `409 listener_wrong_source`; one that is not active,
|
|
128
|
+
* `409 listener_not_active`; one whose backlog is full, `429 listener_backlog_full` with `Retry-After`.
|
|
129
|
+
* Code in a sandbox calls it at `B3OS_API_URL` when its grant holds `listeners:write`.
|
|
130
|
+
*
|
|
131
|
+
* `POST /v1/listeners/{listener_id}/events` · scope `listeners:write` · served by the node
|
|
132
|
+
*/
|
|
133
|
+
ingestEvents(listenerId: string, body: T.ListenerIngestRequest, options?: RequestOptions): APIPromise<T.ListenerIngestResult>;
|
|
134
|
+
/**
|
|
135
|
+
* Deliver an event again
|
|
136
|
+
*
|
|
137
|
+
* Hands a kept event (`delivered` or `failed`) to the sink again, with the same `dedupe_key`, so a sink that
|
|
138
|
+
* already has it can drop it. The filter does not run again. The answer is the event, `pending`.
|
|
139
|
+
*
|
|
140
|
+
* `POST /v1/listeners/{listener_id}/events/{event_id}/redeliver` · scope `listeners:write` · served by the node
|
|
141
|
+
*/
|
|
142
|
+
redeliverEvent(listenerId: string, eventId: string, options?: RequestOptions): APIPromise<T.ListenerEvent>;
|
|
143
|
+
/**
|
|
144
|
+
* Stream a listener's events
|
|
145
|
+
*
|
|
146
|
+
* Server-sent events as the listener keeps events, records gaps and changes status. Reconnect with
|
|
147
|
+
* `Last-Event-ID` (the `seq` of the last frame you read) to resume: frames still in the 7-day history are sent
|
|
148
|
+
* again from there. `: ping` every 15 seconds.
|
|
149
|
+
*
|
|
150
|
+
* `GET /v1/listeners/{listener_id}/stream` · scope `listeners:read` · served by the node
|
|
151
|
+
*/
|
|
152
|
+
streamEvents(listenerId: string, options?: StreamOptions): EventStream<T.ListenerStreamFrame>;
|
|
153
|
+
/**
|
|
154
|
+
* Test a listener on a sample event
|
|
155
|
+
*
|
|
156
|
+
* Runs a sample payload through the listener's dedupe key and filter and returns what happened, without
|
|
157
|
+
* touching the dedupe window or the history. With `deliver: true` the sample, if the filter keeps it, is also
|
|
158
|
+
* written to the log and delivered like any event, marked `test: true` in the sink's copy.
|
|
159
|
+
*
|
|
160
|
+
* `POST /v1/listeners/{listener_id}/test` · scope `listeners:write` · served by the node
|
|
161
|
+
*/
|
|
162
|
+
testListener(listenerId: string, body: T.ListenerTestRequest, options?: RequestOptions): APIPromise<T.ListenerTestResult>;
|
|
163
|
+
}
|