@opencode/protocol 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint } from "effect/http-api";
3
+ import { BlobNotFoundError } from "../errors.js";
4
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
5
+ export declare const BlobGetEndpoint: HttpApiEndpoint.HttpApiEndpoint<"blob.get", "GET", "/api/experimental/blob/:id", Schema.toCodecStringTree<Schema.Struct<{
6
+ id: Schema.brand<Schema.String, "Blob.ID">;
7
+ }>>, never, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof BlobNotFoundError>, never, never>;
@@ -0,0 +1,16 @@
1
+ import { BlobStore } from "@opencode/schema/blob-store";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
4
+ import { BlobNotFoundError } from "../errors.js";
5
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
6
+ export const BlobGetEndpoint = HttpApiEndpoint.get("blob.get", "/api/experimental/blob/:id", {
7
+ params: { id: BlobStore.ID },
8
+ success: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
9
+ error: [BlobNotFoundError],
10
+ }).annotateMerge(OpenApi.annotations({
11
+ identifier: "experimental.blob.get",
12
+ summary: "Read a blob",
13
+ description: "Stream a stored blob's bytes, such as a generated video, with single byte Range, ETag and 304 Not Modified support. Blobs are deleted 7 days after they're written. Experimental: may change without compatibility guarantees.",
14
+ // The route shares the `server.experimental` group with the persistent PTY prototype; tag it on its own.
15
+ transform: (operation) => ({ ...operation, tags: ["experimental"] }),
16
+ }));