@opencode/protocol 0.0.0-dev-19518 → 0.0.0-dev-19520

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/errors.d.ts CHANGED
@@ -61,6 +61,12 @@ declare const ProjectNotFoundError_base: Schema.Class<ProjectNotFoundError, Sche
61
61
  }>, import("effect/Cause").YieldableError>;
62
62
  export declare class ProjectNotFoundError extends ProjectNotFoundError_base {
63
63
  }
64
+ declare const FileNotFoundError_base: Schema.Class<FileNotFoundError, Schema.TaggedStruct<"FileNotFoundError", {
65
+ readonly path: Schema.String;
66
+ readonly message: Schema.String;
67
+ }>, import("effect/Cause").YieldableError>;
68
+ export declare class FileNotFoundError extends FileNotFoundError_base {
69
+ }
64
70
  declare const AgentNotFoundError_base: Schema.Class<AgentNotFoundError, Schema.TaggedStruct<"AgentNotFoundError", {
65
71
  readonly agentID: Schema.String;
66
72
  readonly message: Schema.String;
package/dist/errors.js CHANGED
@@ -50,6 +50,11 @@ export class ProjectNotFoundError extends Schema.TaggedError()("ProjectNotFoundE
50
50
  message: Schema.String,
51
51
  }, { httpApiStatus: 404 }) {
52
52
  }
53
+ export class FileNotFoundError extends Schema.TaggedError()("FileNotFoundError", {
54
+ path: Schema.String,
55
+ message: Schema.String,
56
+ }, { httpApiStatus: 404 }) {
57
+ }
53
58
  export class AgentNotFoundError extends Schema.TaggedError()("AgentNotFoundError", {
54
59
  agentID: Schema.String,
55
60
  message: Schema.String,
@@ -1,12 +1,13 @@
1
1
  import { Location } from "@opencode/schema/location";
2
2
  import { Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
4
+ import { FileNotFoundError } from "../errors.js";
4
5
  export declare const FileSystemGroup: HttpApiGroup.HttpApiGroup<"server.fs", HttpApiEndpoint.HttpApiEndpoint<"fs.read", "GET", "/api/fs/read/*", never, Schema.toCodecStringTree<Schema.Struct<{
5
6
  readonly location: Schema.optional<Schema.Struct<{
6
7
  readonly directory: Schema.optional<Schema.String>;
7
8
  readonly workspace: Schema.optional<Schema.String>;
8
9
  }>>;
9
- }>>, never, never, Schema.toCodecJson<Schema.Uint8Array>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.list", "GET", "/api/fs/list", never, Schema.toCodecStringTree<Schema.Struct<{
10
+ }>>, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof FileNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.list", "GET", "/api/fs/list", never, Schema.toCodecStringTree<Schema.Struct<{
10
11
  readonly path: Schema.optional<Schema.String>;
11
12
  readonly location: Schema.optional<Schema.Struct<{
12
13
  readonly directory: Schema.optional<Schema.String>;
package/dist/groups/fs.js CHANGED
@@ -3,6 +3,7 @@ import { Location } from "@opencode/schema/location";
3
3
  import { PositiveInt } from "@opencode/schema/schema";
4
4
  import { Schema } from "effect";
5
5
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
6
+ import { FileNotFoundError } from "../errors.js";
6
7
  import { LocationQuery, locationQueryOpenApi } from "./location.js";
7
8
  const ListQuery = Schema.Struct({
8
9
  ...LocationQuery.fields,
@@ -20,6 +21,7 @@ export const FileSystemGroup = HttpApiGroup.make("server.fs")
20
21
  .add(HttpApiEndpoint.get("fs.read", "/api/fs/read/*", {
21
22
  query: LocationQuery,
22
23
  success: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
24
+ error: FileNotFoundError,
23
25
  })
24
26
  .annotateMerge(locationQueryOpenApi)
25
27
  .annotateMerge(OpenApi.annotations({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/protocol",
4
- "version": "0.0.0-dev-19518",
4
+ "version": "0.0.0-dev-19520",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "typecheck": "tsgo --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@opencode/schema": "0.0.0-dev-19518",
35
+ "@opencode/schema": "0.0.0-dev-19520",
36
36
  "effect": "4.0.0-rc.112"
37
37
  },
38
38
  "devDependencies": {