2026-06-04 02:57:43 -04:00
|
|
|
import { Schema } from "effect"
|
2026-09-07 17:19:33 -04:00
|
|
|
import { Skill } from "@opencode/schema/skill"
|
2026-10-02 23:43:56 -05:00
|
|
|
import { Location } from "@opencode/schema/location"
|
|
|
|
|
|
|
|
|
|
export class LocationNotFoundError extends Schema.TaggedError<LocationNotFoundError>()(
|
|
|
|
|
"LocationNotFoundError",
|
|
|
|
|
{ location: Location.PublicRef, message: Schema.String },
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
2026-06-04 02:57:43 -04:00
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class InvalidRequestError extends Schema.TaggedError<InvalidRequestError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"InvalidRequestError",
|
|
|
|
|
{
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
kind: Schema.optional(Schema.String),
|
|
|
|
|
field: Schema.optional(Schema.String),
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 400 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-30 21:28:19 -04:00
|
|
|
export class RpcError extends Schema.TaggedError<RpcError>()(
|
|
|
|
|
"RpcError",
|
|
|
|
|
{
|
|
|
|
|
type: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
data: Schema.optional(Schema.Unknown),
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 400 },
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
export class RpcInternalError extends Schema.TaggedError<RpcInternalError>()(
|
|
|
|
|
"RpcInternalError",
|
|
|
|
|
{
|
|
|
|
|
type: Schema.Literals(["rpc.internal", "rpc.invalid_output"]),
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
data: Schema.optional(Schema.Unknown),
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 500 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class UnauthorizedError extends Schema.TaggedError<UnauthorizedError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"UnauthorizedError",
|
|
|
|
|
{ message: Schema.String },
|
|
|
|
|
{ httpApiStatus: 401 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class ConflictError extends Schema.TaggedError<ConflictError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"ConflictError",
|
|
|
|
|
{
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
resource: Schema.optional(Schema.String),
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 409 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class SessionBusyError extends Schema.TaggedError<SessionBusyError>()(
|
2026-06-27 20:04:53 -04:00
|
|
|
"SessionBusyError",
|
|
|
|
|
{
|
|
|
|
|
sessionID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 409 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class ServiceUnavailableError extends Schema.TaggedError<ServiceUnavailableError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"ServiceUnavailableError",
|
|
|
|
|
{
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
service: Schema.optional(Schema.String),
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 503 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class UnknownError extends Schema.TaggedError<UnknownError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"UnknownError",
|
|
|
|
|
{
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
ref: Schema.optional(Schema.String),
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 500 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class ProviderNotFoundError extends Schema.TaggedError<ProviderNotFoundError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"ProviderNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
providerID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
2026-08-25 22:45:01 +08:00
|
|
|
) {}
|
|
|
|
|
|
2026-09-13 20:00:46 -04:00
|
|
|
export class IntegrationNotFoundError extends Schema.TaggedError<IntegrationNotFoundError>()(
|
|
|
|
|
"IntegrationNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
integrationID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-09-13 23:07:28 -04:00
|
|
|
export class IntegrationAttemptNotFoundError extends Schema.TaggedError<IntegrationAttemptNotFoundError>()(
|
|
|
|
|
"IntegrationAttemptNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
integrationID: Schema.String,
|
|
|
|
|
attemptID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
export class IntegrationMethodNotFoundError extends Schema.TaggedError<IntegrationMethodNotFoundError>()(
|
|
|
|
|
"IntegrationMethodNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
integrationID: Schema.String,
|
|
|
|
|
methodID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-25 22:45:01 +08:00
|
|
|
export class ProjectNotFoundError extends Schema.TaggedError<ProjectNotFoundError>()(
|
|
|
|
|
"ProjectNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
projectID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
2026-09-12 14:55:10 +08:00
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
export class FileNotFoundError extends Schema.TaggedError<FileNotFoundError>()(
|
|
|
|
|
"FileNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
path: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
2026-06-04 02:57:43 -04:00
|
|
|
) {}
|
|
|
|
|
|
2026-10-27 10:54:50 +10:00
|
|
|
export class PluginNotFoundError extends Schema.TaggedError<PluginNotFoundError>()(
|
|
|
|
|
"PluginNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
pluginID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
2026-08-17 17:54:08 -04:00
|
|
|
export class AgentNotFoundError extends Schema.TaggedError<AgentNotFoundError>()(
|
2026-07-26 20:08:55 -04:00
|
|
|
"AgentNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
agentID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class SessionNotFoundError extends Schema.TaggedError<SessionNotFoundError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"SessionNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
sessionID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
2026-06-24 19:41:16 -04:00
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class MessageNotFoundError extends Schema.TaggedError<MessageNotFoundError>()(
|
2026-06-24 19:41:16 -04:00
|
|
|
"MessageNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
sessionID: Schema.String,
|
|
|
|
|
messageID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
2026-06-04 02:57:43 -04:00
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class SkillNotFoundError extends Schema.TaggedError<SkillNotFoundError>()(
|
2026-06-30 01:14:44 -04:00
|
|
|
"SkillNotFoundError",
|
|
|
|
|
{
|
2026-07-07 22:10:11 -04:00
|
|
|
skill: Skill.ID,
|
2026-06-30 01:14:44 -04:00
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-11-24 18:06:08 -06:00
|
|
|
export class SkillLoadError extends Schema.TaggedError<SkillLoadError>()(
|
|
|
|
|
"SkillLoadError",
|
|
|
|
|
{
|
|
|
|
|
skill: Skill.ID,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 502 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class McpServerNotFoundError extends Schema.TaggedError<McpServerNotFoundError>()(
|
2026-07-19 10:28:25 -05:00
|
|
|
"McpServerNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
server: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class CommandNotFoundError extends Schema.TaggedError<CommandNotFoundError>()(
|
2026-07-02 11:22:04 -05:00
|
|
|
"CommandNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
command: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-24 16:01:58 -04:00
|
|
|
export class CommandExecutionError extends Schema.TaggedError<CommandExecutionError>()(
|
|
|
|
|
"CommandExecutionError",
|
2026-07-02 11:22:04 -05:00
|
|
|
{
|
|
|
|
|
command: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 500 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class InvalidCursorError extends Schema.TaggedError<InvalidCursorError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"InvalidCursorError",
|
|
|
|
|
{ message: Schema.String },
|
|
|
|
|
{ httpApiStatus: 400 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class PermissionNotFoundError extends Schema.TaggedError<PermissionNotFoundError>()(
|
2026-06-04 02:57:43 -04:00
|
|
|
"PermissionNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
requestID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-10-18 21:24:38 -05:00
|
|
|
export class PermissionSavedNotFoundError extends Schema.TaggedError<PermissionSavedNotFoundError>()(
|
|
|
|
|
"PermissionSavedNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
id: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class FormNotFoundError extends Schema.TaggedError<FormNotFoundError>()(
|
2026-07-03 02:40:44 -05:00
|
|
|
"FormNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
id: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class FormAlreadySettledError extends Schema.TaggedError<FormAlreadySettledError>()(
|
2026-07-03 02:40:44 -05:00
|
|
|
"FormAlreadySettledError",
|
|
|
|
|
{
|
|
|
|
|
id: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 409 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class FormInvalidAnswerError extends Schema.TaggedError<FormInvalidAnswerError>()(
|
2026-07-03 02:40:44 -05:00
|
|
|
"FormInvalidAnswerError",
|
|
|
|
|
{
|
|
|
|
|
id: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 400 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class ForbiddenError extends Schema.TaggedError<ForbiddenError>()(
|
2026-06-14 16:16:39 +05:30
|
|
|
"ForbiddenError",
|
|
|
|
|
{ message: Schema.String },
|
|
|
|
|
{ httpApiStatus: 403 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class PtyNotFoundError extends Schema.TaggedError<PtyNotFoundError>()(
|
2026-06-14 16:16:39 +05:30
|
|
|
"PtyNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
ptyID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
2026-06-29 00:43:04 -04:00
|
|
|
|
2026-10-30 09:29:04 -04:00
|
|
|
export class PtyFeatureUnsupportedError extends Schema.TaggedError<PtyFeatureUnsupportedError>()(
|
|
|
|
|
"PtyFeatureUnsupportedError",
|
|
|
|
|
{
|
|
|
|
|
feature: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 501 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-08-17 17:54:08 -04:00
|
|
|
export class ShellNotFoundError extends Schema.TaggedError<ShellNotFoundError>()(
|
2026-06-29 00:43:04 -04:00
|
|
|
"ShellNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
id: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
2026-10-26 23:22:11 -05:00
|
|
|
|
|
|
|
|
export class ModelNotFoundError extends Schema.TaggedError<ModelNotFoundError>()(
|
|
|
|
|
"ModelNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
providerID: Schema.String,
|
|
|
|
|
modelID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
/** The model exists but cannot serve this request, such as a chat model asked for images. */
|
|
|
|
|
export class UnsupportedModelError extends Schema.TaggedError<UnsupportedModelError>()(
|
|
|
|
|
"UnsupportedModelError",
|
|
|
|
|
{
|
|
|
|
|
providerID: Schema.String,
|
|
|
|
|
modelID: Schema.String,
|
|
|
|
|
capability: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 422 },
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
/** The provider rejected or failed the request after the server sent it. */
|
|
|
|
|
export class ProviderRequestError extends Schema.TaggedError<ProviderRequestError>()(
|
|
|
|
|
"ProviderRequestError",
|
|
|
|
|
{
|
|
|
|
|
providerID: Schema.String,
|
|
|
|
|
reason: Schema.Literals([
|
|
|
|
|
"authentication",
|
|
|
|
|
"rate_limit",
|
|
|
|
|
"content_filter",
|
|
|
|
|
"invalid_request",
|
|
|
|
|
"overloaded",
|
|
|
|
|
"provider",
|
|
|
|
|
]),
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
status: Schema.optional(Schema.Int),
|
|
|
|
|
retryAfterMs: Schema.optional(Schema.Int),
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 502 },
|
|
|
|
|
) {}
|
2026-10-28 19:37:14 -07:00
|
|
|
|
2026-11-16 17:14:59 -08:00
|
|
|
export class AutomationNotFoundError extends Schema.TaggedError<AutomationNotFoundError>()(
|
|
|
|
|
"AutomationNotFoundError",
|
2026-10-28 19:37:14 -07:00
|
|
|
{
|
2026-11-16 17:14:59 -08:00
|
|
|
automationID: Schema.String,
|
2026-10-28 19:37:14 -07:00
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
2026-10-30 06:19:18 -07:00
|
|
|
|
2026-11-16 17:14:18 -06:00
|
|
|
export class VideoNotFoundError extends Schema.TaggedError<VideoNotFoundError>()(
|
|
|
|
|
"VideoNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
videoID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
export class BlobNotFoundError extends Schema.TaggedError<BlobNotFoundError>()(
|
|
|
|
|
"BlobNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
blobID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-10-30 06:19:18 -07:00
|
|
|
export class ArtifactNotFoundError extends Schema.TaggedError<ArtifactNotFoundError>()(
|
|
|
|
|
"ArtifactNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
artifactID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
2026-11-20 15:13:28 -08:00
|
|
|
|
|
|
|
|
export class MachineNotFoundError extends Schema.TaggedError<MachineNotFoundError>()(
|
|
|
|
|
"MachineNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
machine: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|
2026-11-24 23:52:07 -05:00
|
|
|
|
|
|
|
|
export class PushDeviceNotFoundError extends Schema.TaggedError<PushDeviceNotFoundError>()(
|
|
|
|
|
"PushDeviceNotFoundError",
|
|
|
|
|
{
|
|
|
|
|
deviceID: Schema.String,
|
|
|
|
|
message: Schema.String,
|
|
|
|
|
},
|
|
|
|
|
{ httpApiStatus: 404 },
|
|
|
|
|
) {}
|