GeezerVison is showing github.com — chore: upgrade effect to 4.0.6 by kommander · Pull Request #59630 · anomalyco/opencode
chore: upgrade effect to 4.0.6
#59630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement . We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from all commits
Commits
File filter
Filter by extension
.json
(2)
.lock
(1)
.ts
(10)
All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
There are no files selected for viewing
22 changes: 12 additions & 10 deletions
22
bun.lock
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Original file line number
Diff line number
Diff line change
Expand Up
@@ -45,10 +45,10 @@
"packages/stats/*"
],
"catalog": {
"@effect/opentelemetry": "4.0.1 ",
"@effect/platform-node": "4.0.1 ",
"@effect/platform-node-shared": "4.0.1 ",
"@effect/sql-sqlite-bun": "4.0.1 ",
"@effect/opentelemetry": "4.0.6 ",
"@effect/platform-node": "4.0.6 ",
"@effect/platform-node-shared": "4.0.6 ",
"@effect/sql-sqlite-bun": "4.0.6 ",
"@npmcli/arborist": "9.4.0",
"@types/bun": "1.4.3",
"@types/cross-spawn": "6.0.6",
Expand Down
Expand Up
@@ -77,7 +77,7 @@
"dompurify": "3.4.17",
"drizzle-kit": "1.0.0-rc.5-ab785fc",
"drizzle-orm": "1.0.0-rc.5-169397b",
"effect": "4.0.1 ",
"effect": "4.0.6 ",
"fast-check": "4.9.0",
"cross-spawn": "7.0.6",
"hono": "4.10.7",
Expand Down
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Original file line number
Diff line number
Diff line change
Expand Up
@@ -79,8 +79,11 @@ const docTags = (schema: JsonSchema): Array<string> => {
}
if (typeof schema.format === "string") tags.push(`@format ${schema.format}`)
if (schema.type === "integer") tags.push("@integer")
if (typeof schema.minimum === "number") tags.push(`@minimum ${schema.minimum}`)
if (typeof schema.maximum === "number") tags.push(`@maximum ${schema.maximum}`)
const integer = schema.type === "integer"
if (typeof schema.minimum === "number" && !(integer && schema.minimum === Number.MIN_SAFE_INTEGER))
tags.push(`@minimum ${schema.minimum}`)
if (typeof schema.maximum === "number" && !(integer && schema.maximum === Number.MAX_SAFE_INTEGER))
tags.push(`@maximum ${schema.maximum}`)
if (typeof schema.exclusiveMinimum === "number") tags.push(`@exclusiveMinimum ${schema.exclusiveMinimum}`)
if (typeof schema.exclusiveMaximum === "number") tags.push(`@exclusiveMaximum ${schema.exclusiveMaximum}`)
if (typeof schema.multipleOf === "number") tags.push(`@multipleOf ${schema.multipleOf}`)
Expand Down
Expand Up
@@ -154,7 +157,10 @@ const renderSchema = (
}
if (schema.const !== undefined) return renderLiteral(schema.const)
if (schema.enum) return schema.enum.map(renderLiteral).join(" | ")
const alternatives = schema.anyOf ?? schema.oneOf
const listed = schema.anyOf ?? schema.oneOf
const alternatives = listed?.some((item) => item.type === "number")
? listed.filter((item) => !effectNumberSentinel(item))
: listed
if (alternatives) {
if (
alternatives.some((item) => item.type === "number") &&
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -78,6 +78,7 @@ export const makeClient = <
acquirer,
compiler: Statement.makeCompilerSqlite(options.transformQueryNames),
transactionAcquirer,
driver: "sqlite",
spanAttributes: [
...(options.spanAttributes ? Object.entries(options.spanAttributes) : []),
["db.system.name", "sqlite"],
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -185,6 +185,7 @@ const make = (options: Config) =>
compiler,
transactionAcquirer,
transactionService: WorkerdTransaction,
driver: "sqlite-do",
spanAttributes: [
...(options.spanAttributes ? Object.entries(options.spanAttributes) : []),
[ATTR_DB_SYSTEM_NAME, "sqlite"],
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -191,7 +191,21 @@ const flattenAllOf = (value: unknown): unknown => {
if (Array.isArray(value)) return value.map(flattenAllOf)
if (typeof value !== "object" || value === null) return value
const schema = Object.fromEntries(Object.entries(value).map(([key, item]) => [key, flattenAllOf(item)]))
// Effect adds the safe-integer range to every Schema.Int. Drop it so tool schemas don't change and
// bust prompt caches.
const integer = "type" in value && value.type === "integer"
const schema = Object.fromEntries(
Object.entries(value)
.filter(
([key, item]) =>
!integer ||
!(
(key === "minimum" && item === Number.MIN_SAFE_INTEGER) ||
(key === "maximum" && item === Number.MAX_SAFE_INTEGER)
),
)
.map(([key, item]) => [key, flattenAllOf(item)]),
)
if (!Array.isArray(schema.allOf) || !schema.allOf.every(isRecord) || !canFlattenAllOf(schema.allOf, schema))
return schema
const { allOf, ...rest } = schema
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -58,6 +58,7 @@ const parkedClient = (arrived: Deferred.Deferred<void>, gate: Deferred.Deferred<
executeRaw: (query, params) => park(query, connection.executeRaw(query, params)),
}),
compiler: Statement.makeCompilerSqlite(),
driver: client.driver,
spanAttributes: [],
})
}),
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -93,7 +93,9 @@ type PromiseInputField =
| (InputField & { readonly optional: boolean })
| { readonly name: string; readonly source: "wildcard"; readonly optional: false }
const resolveHttpApiStatus = SchemaAST.resolveAt<number>("httpApiStatus")
const resolveHttpApiStatus = (ast: SchemaAST.AST) =>
SchemaAST.resolveAt<number>("httpApiStatus")(ast) ??
(ast.checks === undefined ? ast.context?.annotations?.httpApiStatus : undefined)
const resolveHttpApiEncoding = SchemaAST.resolveAt<HttpApiSchema.Encoding>("~httpApiEncoding")
const Manifest = Schema.fromJsonString(Schema.Array(Schema.String))
const manifestName = ".httpapi-codegen.json"
Expand Down
Expand Up
@@ -1454,7 +1456,10 @@ function sameChecks(left: SchemaAST.Checks | undefined, right: SchemaAST.Checks
}
function sameContext(left: SchemaAST.Context | undefined, right: SchemaAST.Context | undefined) {
return left?.isOptional === right?.isOptional && left?.isMutable === right?.isMutable
return (
(left?.isOptional ?? false) === (right?.isOptional ?? false) &&
(left?.isMutable ?? false) === (right?.isMutable ?? false)
)
}
export function write(
Expand Down
Expand Up
@@ -1738,7 +1743,9 @@ function isDataEnvelope(schema: Schema.Top) {
)
}
function isStreamSchema(schema: Schema.Top): schema is HttpApiSchema.StreamSchema {
function isStreamSchema(
schema: Schema.Top,
): schema is Exclude<HttpApiSchema.StreamSchema, HttpApiSchema.StreamNdjson<Schema.Top>> {
return "_tag" in schema && (schema._tag === "StreamSse" || schema._tag === "StreamUint8Array")
}
Expand Down
Expand Up
@@ -1841,7 +1848,7 @@ function renderGroup(group: Group) {
const inputDeclaration =
operation.operation.inputMode === "none"
? ""
: `${opaquePayload ? `type ${prefix}Request = Parameters<RawGroup[${JSON.stringify(endpoint.identifier)}]>[0]\n` : ""}type ${prefix}Input = { ${inputType} }\n`
: `${opaquePayload ? `type ${prefix}Request = Parameters<RawGroup[${JSON.stringify(endpoint.identifier)}]>[0] & { readonly responseMode?: "decoded-only" } \n` : ""}type ${prefix}Input = { ${inputType} }\n`
adapters.push(
`${inputDeclaration}const ${prefix}DeclaredError = ${declaredSchema}\nconst map${prefix}Error = (error: unknown) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError({ cause: error }) : Schema.is(${prefix}DeclaredError)(error) ? error : new ClientError({ cause: error })\nconst ${prefix} = (raw: RawGroup) => (${argument}) => ${operation.operation.success === "stream" ? `Stream.unwrap(${rawCall}.pipe(Effect.mapError(map${prefix}Error), Effect.map((stream) => stream.pipe(Stream.mapError(map${prefix}Error)))))` : mapped}`,
)
Expand Down
Expand Up
@@ -1922,7 +1929,9 @@ function renderSchemas(slots: ReadonlyArray<Slot>) {
]
const document = SchemaRepresentation.toCodeDocument(
SchemaRepresentation.toRepresentations(
codegenAsts(expanded.map((slot) => slot.schema.ast)) as [SchemaAST.AST, ...Array<SchemaAST.AST>],
codegenAsts(
expanded.map((slot) => slot.schema.annotate({ httpApiStatus: resolveHttpApiStatus(slot.schema.ast) }).ast),
) as [SchemaAST.AST, ...Array<SchemaAST.AST>],
),
)
const artifacts = document.artifacts.flatMap((artifact) => {
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -114,7 +114,7 @@ const mapEndpointInterruptError = (error: unknown) =>
const EndpointInterrupt = (raw: RawGroup) => (input: EndpointInterruptInput) =>
raw["interrupt"]({ params: { sessionID: input["sessionID"] } }).pipe(Effect.mapError(mapEndpointInterruptError))
type EndpointConfigureRequest = Parameters<RawGroup["configure"]>[0]
type EndpointConfigureRequest = Parameters<RawGroup["configure"]>[0] & { readonly responseMode?: "decoded-only" }
type EndpointConfigureInput = {
readonly sessionID: (typeof EndpointConfigureParams.Type)["sessionID"]
readonly dryRun?: (typeof EndpointConfigureQuery.Type)["dryRun"]
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -143,7 +143,7 @@ describe("HttpApiCodegen.write", () => {
mtime: Option.none(),
atime: Option.none(),
birthtime: Option.none(),
dev: 0 ,
dev: 0n ,
ino: Option.none(),
mode: 0,
nlink: Option.none(),
Expand Down
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.