github cloudflare/agents @cloudflare/codemode@0.2.0

9 hours ago

Minor Changes

  • #1102 f07ef51 Thanks @mattzcarey! - BREAKING: generateTypes and ToolDescriptor/ToolDescriptors types are no longer exported from the main entry point. Import them from @cloudflare/codemode/ai instead:

    // Before
    import { generateTypes } from "@cloudflare/codemode";
    
    // After
    import { generateTypes } from "@cloudflare/codemode/ai";

    The main entry point (@cloudflare/codemode) no longer requires the ai or zod peer dependencies. It now exports:

    • sanitizeToolName — sanitize tool names into valid JS identifiers
    • normalizeCode — normalize LLM-generated code into async arrow functions
    • generateTypesFromJsonSchema — generate TypeScript type definitions from plain JSON Schema (no AI SDK needed)
    • jsonSchemaToType — convert a JSON Schema to a TypeScript type declaration string
    • DynamicWorkerExecutor, ToolDispatcher — sandboxed code execution
    • JsonSchemaToolDescriptor / JsonSchemaToolDescriptors — types for the JSON Schema API

    The ai and zod peer dependencies are now optional — only required when importing from @cloudflare/codemode/ai.

Don't miss a new agents release

NewReleases is sending notifications on new releases.