2026-03-12 01:49:57 +00:00
|
|
|
import { Schema } from "effect"
|
|
|
|
|
|
|
|
|
|
import { Identifier } from "@/id/id"
|
2026-05-09 19:51:09 +00:00
|
|
|
import { withStatics } from "@opencode-ai/core/schema"
|
2026-03-12 01:49:57 +00:00
|
|
|
|
2026-05-10 03:12:21 +00:00
|
|
|
const toolIdSchema = Schema.String.check(Schema.isStartsWith("tool")).pipe(Schema.brand("ToolID"))
|
2026-03-12 01:49:57 +00:00
|
|
|
|
|
|
|
|
export type ToolID = typeof toolIdSchema.Type
|
|
|
|
|
|
|
|
|
|
export const ToolID = toolIdSchema.pipe(
|
|
|
|
|
withStatics((schema: typeof toolIdSchema) => ({
|
2026-04-11 03:06:28 +00:00
|
|
|
ascending: (id?: string) => schema.make(Identifier.ascending("tool", id)),
|
2026-03-12 01:49:57 +00:00
|
|
|
})),
|
|
|
|
|
)
|