MCPcopy Create free account
hub / github.com/anomalyco/opencode / validateName

Function validateName

packages/core/src/tool/tool.ts:134–137  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

132}
133
134export const validateName = (name: string) =>
135 /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(name)
136 ? Effect.void
137 : Effect.fail(new RegistrationError({ name, message: `Invalid tool name: ${name}` }))
138
139export const withPermission = <Input extends SchemaType<any>, Output extends SchemaType<any>>(
140 tool: Definition<Input, Output>,

Callers 1

registry.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected