fix(codemode): canonicalize dotted tool paths (#36994)

This commit is contained in:
Aiden Cline 2026-07-15 11:09:09 -05:00 committed by GitHub
commit 22334b94c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 242 additions and 44 deletions

View file

@ -50,8 +50,13 @@ export type Options<I extends SchemaType, O extends SchemaType | undefined, R =
readonly run: (input: InputType<I>) => Effect.Effect<ResultType<O>, unknown, R>
}
// Object.hasOwn: an inherited _tag must not classify a namespace as a Definition.
export const isDefinition = <R = never>(value: unknown): value is Definition<R> =>
typeof value === "object" && value !== null && "_tag" in value && value._tag === "CodeModeTool"
typeof value === "object" &&
value !== null &&
"_tag" in value &&
Object.hasOwn(value, "_tag") &&
value._tag === "CodeModeTool"
/**
* Defines one schema-described tool available to a CodeMode program through `tools.*`.