Saltar a contenido

Changelog

All notable changes to this project will be documented in this file.

[2.3.0]

Added

  • Tool lifecycle hooks via IAgent.hooks: PreFunc runs before each tool executes (receives ctx, tool, params), and PostFunc runs after (receives ctx, tool, params, response). Both are chainable pipes — PostFunc's return value replaces the response passed downstream. Hooks run in both call() and stream().

Changed (breaking)

  • AgentOptions interface renamed to IAgent. Update type imports accordingly.
  • Agent no longer accepts name or description options. Pass behavior via rules instead (a description-style string can be supplied as a Rule).

[2.1.0]

Added

  • Ollama provider for running local open-source models via Ollama's OpenAI-compatible API. Options: { model, base_url?, think?, num_ctx? } (no api_key — defaults to "ollama").
  • Multimodal Message.content: now string | ContentBlock[]. New exported types: TextBlock, ImageBlock, AudioBlock, DocumentBlock, ContentBlock, MessageContent. Each provider translates supported blocks to its wire format and drops unsupported ones (e.g. Claude drops audio, OpenAI drops document).
  • Extended thinking on Message: optional thinking and thinking_signature fields on assistant messages, persisted across turns. Anthropic's signature is reinjected automatically so multi-turn thinking is accepted by the API.
  • ProviderChunk { type: "signature_delta" } to carry the thinking signature in streaming mode.
  • ResponseMessage.reasoning_signature?: string optional field.

Changed

  • Claude provider options reworked: base_url is now the full endpoint URL (no /messages appended), api_key is optional (sent as Authorization: Bearer), and a new body field extends the request payload. This single provider now covers both the classic API key flow and the Claude Code OAuth flow (base_url with ?beta=true + OAuth token in api_key + betas in headers).
  • OpenAI-compatible providers (Groq, DeepSeek, Ollama) now extend the OpenAI base class — minimal subclasses that only override defaults.
  • Providers read delta.reasoning in addition to delta.reasoning_content for thinking (Ollama compatibility).

Removed (breaking)

  • ClaudeCode provider and ClaudeCodeOptions type. Use Claude with base_url, OAuth token in api_key, and betas in headers instead.
  • The temporary Think class (it existed only internally) — thinking is now part of Message.

[2.0.0]

Changed (breaking)

  • Message.content type widened from string to string | ContentBlock[] to support multimodal input/output. Plain string content remains fully backward-compatible.

[1.8.0]

Added

  • branches option on AgentOptions: array of sub-agents (Agent, AgentOptions, or description string) that run sequentially before each call() / stream() turn, building accumulated thinking injected as ephemeral system message.
  • Agent.stream() method: async generator yielding StreamChunk (assistant, thinking, tool_call, tool roles).
  • ProviderChunk { type: "thinking_delta" }: all built-in providers parse native model thinking.
  • ResponseMessage.reasoning_content?: string optional field.
  • Built-in tools: AgentTool, AskTool, ChoiceTool, SleepTool.
  • Context constructor now accepts plain objects: metadata as Record<string,string>, rules as string | string[], messages as MessageOptions | MessageOptions[].

Changed

  • Context setters (messages, rules, tools) are now idempotent: filter inherited items by reference before storing locals.
  • AgentOptions.name and AgentOptions.description are now deprecatedname/description props are always undefined at runtime; description is converted to a Rule in the internal Context.

Removed

  • Context.appendMessages() method.
  • Context.spliceAt() method.

[1.7.0]

Added

  • Five built-in provider classes: OpenAI, Groq, DeepSeek, Claude, ClaudeCode.

[1.0.4] - 2025-07-17

Added

  • Full integration of the agent’s name and description into the system message.

Improved

  • Enhanced rule and limit handling during conversation flow.
  • Optimized validation process for provider responses.

[1.0.3] - 2025-07-17

Changed

  • Renamed the Bot class to Agent to ensure consistent terminology.
  • Refactored related interfaces to adopt the "Agent" term.

Documentation

  • Updated usage examples and improved main method documentation.

[1.0.2] - 2025-07-17

Added

  • Extra integrity checks prior to publishing.

Fixed

  • Minor type issues in core interfaces.

Changed

  • Publication workflow now auto-increments patch version.

[1.0.1] - 2025-07-17

Changed

  • Downgraded package version to 1.0.1 to comply with semantic versioning.
  • Simplified internal logic for error handling in tool calls.

Improved

  • Better compatibility with various OpenAI API versions.

[2.0.5] (reverted to 1.0.1) - 2025-07-17

Changed

  • Updated package metadata and dependencies.
  • Fixed version numbering to restore correct semantic structure.

Improved

  • Optimized project metadata structure.

[1.0.0] - 2025-07-17

Added

  • yarn.lock file to ensure dependency consistency.
  • Strict version control enforcement for cross-environment compatibility.

Documentation

  • Improved installation and usage instructions.

[0.9.0] - 2025-07-17

Added

  • Initial TypeScript compiler configuration with strict mode.
  • Module aliasing for improved project structure.
  • Optimized compilation options for maximum compatibility.