mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-18 15:28:48 +03:00
chore: generate
This commit is contained in:
@@ -92,9 +92,10 @@ describe("AI.Usage", () => {
|
||||
|
||||
test("sseFraming maps decoder failures to AI errors", async () => {
|
||||
const error = await Effect.runPromise(
|
||||
ProviderShared.sseFraming(
|
||||
Stream.make(new TextEncoder().encode(`data: ${"x".repeat(10 * 1024 * 1024)}`)),
|
||||
).pipe(Stream.runCollect, Effect.flip),
|
||||
ProviderShared.sseFraming(Stream.make(new TextEncoder().encode(`data: ${"x".repeat(10 * 1024 * 1024)}`))).pipe(
|
||||
Stream.runCollect,
|
||||
Effect.flip,
|
||||
),
|
||||
)
|
||||
|
||||
expect(error).toBeInstanceOf(AIError)
|
||||
|
||||
@@ -25,10 +25,9 @@ export class InvalidModeError extends Schema.TaggedError<InvalidModeError>()("AC
|
||||
|
||||
export class AuthRequiredError extends Schema.TaggedError<AuthRequiredError>()("ACPAuthRequiredError", {}) {}
|
||||
|
||||
export class UnknownAuthMethodError extends Schema.TaggedError<UnknownAuthMethodError>()(
|
||||
"ACPUnknownAuthMethodError",
|
||||
{ methodId: Schema.String },
|
||||
) {}
|
||||
export class UnknownAuthMethodError extends Schema.TaggedError<UnknownAuthMethodError>()("ACPUnknownAuthMethodError", {
|
||||
methodId: Schema.String,
|
||||
}) {}
|
||||
|
||||
export class ServiceFailureError extends Schema.TaggedError<ServiceFailureError>()("ACPServiceFailureError", {
|
||||
safeMessage: Schema.String,
|
||||
|
||||
@@ -12,10 +12,9 @@ export interface TextInput {
|
||||
readonly model?: Model.Ref
|
||||
}
|
||||
|
||||
export class ModelSelectionError extends Schema.TaggedError<ModelSelectionError>()(
|
||||
"Generate.ModelSelectionError",
|
||||
{ message: Schema.String },
|
||||
) {}
|
||||
export class ModelSelectionError extends Schema.TaggedError<ModelSelectionError>()("Generate.ModelSelectionError", {
|
||||
message: Schema.String,
|
||||
}) {}
|
||||
|
||||
export class UnavailableError extends Schema.TaggedError<UnavailableError>()("Generate.UnavailableError", {
|
||||
message: Schema.String,
|
||||
|
||||
@@ -31,13 +31,10 @@ export type EnsureInput = {
|
||||
readonly branch?: string
|
||||
}
|
||||
|
||||
export class InvalidBranchError extends Schema.TaggedError<InvalidBranchError>()(
|
||||
"RepositoryCacheInvalidBranchError",
|
||||
{
|
||||
branch: Schema.String,
|
||||
message: Schema.String,
|
||||
},
|
||||
) {}
|
||||
export class InvalidBranchError extends Schema.TaggedError<InvalidBranchError>()("RepositoryCacheInvalidBranchError", {
|
||||
branch: Schema.String,
|
||||
message: Schema.String,
|
||||
}) {}
|
||||
|
||||
export class CloneFailedError extends Schema.TaggedError<CloneFailedError>()("RepositoryCacheCloneFailedError", {
|
||||
repository: Schema.String,
|
||||
@@ -68,14 +65,11 @@ export class LockFailedError extends Schema.TaggedError<LockFailedError>()("Repo
|
||||
message: Schema.String,
|
||||
}) {}
|
||||
|
||||
export class CacheOperationError extends Schema.TaggedError<CacheOperationError>()(
|
||||
"RepositoryCacheOperationError",
|
||||
{
|
||||
operation: Schema.String,
|
||||
path: Schema.String,
|
||||
message: Schema.String,
|
||||
},
|
||||
) {}
|
||||
export class CacheOperationError extends Schema.TaggedError<CacheOperationError>()("RepositoryCacheOperationError", {
|
||||
operation: Schema.String,
|
||||
path: Schema.String,
|
||||
message: Schema.String,
|
||||
}) {}
|
||||
|
||||
export type Error =
|
||||
| InvalidBranchError
|
||||
|
||||
@@ -11,13 +11,10 @@ import { SessionMessage } from "./message.js"
|
||||
import { SessionSchema } from "./schema.js"
|
||||
import { SessionMessageTable } from "./sql.js"
|
||||
|
||||
export class MessageNotFoundError extends Schema.TaggedError<MessageNotFoundError>()(
|
||||
"Session.MessageNotFoundError",
|
||||
{
|
||||
sessionID: SessionSchema.ID,
|
||||
messageID: SessionMessage.ID,
|
||||
},
|
||||
) {}
|
||||
export class MessageNotFoundError extends Schema.TaggedError<MessageNotFoundError>()("Session.MessageNotFoundError", {
|
||||
sessionID: SessionSchema.ID,
|
||||
messageID: SessionMessage.ID,
|
||||
}) {}
|
||||
|
||||
interface BoundaryInput {
|
||||
readonly sessionID: SessionSchema.ID
|
||||
|
||||
@@ -33,12 +33,9 @@ export class ProviderRequiredError extends Schema.TaggedError<ProviderRequiredEr
|
||||
{},
|
||||
) {}
|
||||
|
||||
export class ProviderNotFoundError extends Schema.TaggedError<ProviderNotFoundError>()(
|
||||
"WebSearch.ProviderNotFound",
|
||||
{
|
||||
providerID: ID,
|
||||
},
|
||||
) {}
|
||||
export class ProviderNotFoundError extends Schema.TaggedError<ProviderNotFoundError>()("WebSearch.ProviderNotFound", {
|
||||
providerID: ID,
|
||||
}) {}
|
||||
|
||||
export class DisabledError extends Schema.TaggedError<DisabledError>()("WebSearch.Disabled", {}) {}
|
||||
|
||||
|
||||
@@ -461,7 +461,9 @@ function effectType(schema: Schema.Top, references: ReturnType<typeof effectType
|
||||
imports.add(direct.import)
|
||||
return direct.name
|
||||
}
|
||||
const document = SchemaRepresentation.toCodeDocument(SchemaRepresentation.toRepresentations([codegenAst(projected.ast)]))
|
||||
const document = SchemaRepresentation.toCodeDocument(
|
||||
SchemaRepresentation.toRepresentations([codegenAst(projected.ast)]),
|
||||
)
|
||||
const source = new Map(document.references.nonRecursives.map((reference) => [reference.$ref, reference.code.Type]))
|
||||
const expand = (type: string, seen = new Set<string>()): string => {
|
||||
for (const [name, value] of source) {
|
||||
@@ -1844,10 +1846,9 @@ function renderSchemas(slots: ReadonlyArray<Slot>) {
|
||||
]
|
||||
const [first, ...rest] = expanded
|
||||
const document = SchemaRepresentation.toCodeDocument(
|
||||
SchemaRepresentation.toRepresentations(codegenAsts(expanded.map((slot) => slot.schema.ast)) as [
|
||||
SchemaAST.AST,
|
||||
...Array<SchemaAST.AST>,
|
||||
]),
|
||||
SchemaRepresentation.toRepresentations(
|
||||
codegenAsts(expanded.map((slot) => slot.schema.ast)) as [SchemaAST.AST, ...Array<SchemaAST.AST>],
|
||||
),
|
||||
)
|
||||
const artifacts = document.artifacts.flatMap((artifact) => {
|
||||
if (artifact._tag === "Import") return [artifact.importDeclaration]
|
||||
|
||||
+1090
-10324
File diff suppressed because it is too large
Load Diff
@@ -60,15 +60,12 @@ export namespace JsonRpc {
|
||||
}
|
||||
}
|
||||
|
||||
export class SimulationRequestError extends Schema.TaggedError<SimulationRequestError>()(
|
||||
"SimulationRequestError",
|
||||
{
|
||||
method: Schema.String,
|
||||
code: Schema.Number,
|
||||
message: Schema.String,
|
||||
data: Schema.optionalKey(Schema.Json),
|
||||
},
|
||||
) {}
|
||||
export class SimulationRequestError extends Schema.TaggedError<SimulationRequestError>()("SimulationRequestError", {
|
||||
method: Schema.String,
|
||||
code: Schema.Number,
|
||||
message: Schema.String,
|
||||
data: Schema.optionalKey(Schema.Json),
|
||||
}) {}
|
||||
|
||||
const request = <
|
||||
const Tag extends string,
|
||||
|
||||
@@ -147,10 +147,9 @@ class ToolInvocationNotFoundError extends Schema.TaggedError<ToolInvocationNotFo
|
||||
{ id: Schema.String, message: Schema.String },
|
||||
) {}
|
||||
|
||||
class ToolControllerError extends Schema.TaggedError<ToolControllerError>()(
|
||||
"SimulatedProvider.ToolControllerError",
|
||||
{ message: Schema.String },
|
||||
) {}
|
||||
class ToolControllerError extends Schema.TaggedError<ToolControllerError>()("SimulatedProvider.ToolControllerError", {
|
||||
message: Schema.String,
|
||||
}) {}
|
||||
|
||||
export const layerDrive = (options: { readonly endpoint: string; readonly version: string }) =>
|
||||
Layer.effect(
|
||||
|
||||
+1090
-10324
File diff suppressed because it is too large
Load Diff
+1090
-10324
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user