Skip to content

v0.2.1

Choose a tag to compare

@codybrom codybrom released this 10 Mar 04:45
· 28 commits to main since this release
69f996c

Added

  • Branded NativePointer type for compile-time C pointer type safety
  • unregisterCallback() utility to centralize callback cleanup logic
  • Discriminated union for GenerationGuide data, enabling exhaustive type checking
  • Comprehensive JSDoc comments on public APIs (SystemLanguageModel, LanguageModelSession, Tool, Transcript, SamplingMode)
  • stripInternal in tsconfig to exclude @internal symbols from .d.ts output
  • Unit tests for error hierarchy and statusToError() mapping
  • Integration test suite covering basic responses, streaming, structured output, tools, and transcripts
  • GitHub Actions CI workflow (macOS, Node.js 20/22, lint + format + unit tests)
  • Organized examples directory with individual READMEs for each example

Changed

  • Renamed all internal pointer variables from abbreviations (ptr, cbPtr) to full names (pointer, callbackPointer, _nativeSession, _nativeTool, _nativeSchema, etc.)
  • InvalidGenerationSchemaError now extends GenerationError instead of FoundationModelsError
  • All error-throwing paths now use FoundationModelsError or GenerationError subclasses instead of generic Error
  • Replaced GenerationGuide separate guideType/value fields with a single data discriminated union

Removed

  • Monolithic example.ts file (replaced by organized examples/ directory)