Skip to content

0.8.9

Choose a tag to compare

@asterixcapri asterixcapri released this 27 Sep 07:17
· 6 commits to 0.8.x since this release

Adds automatic session titles and processing of complete user messages, including attachments and metadata.

New features

  • Automatic session titles. Conversations backed by a NeuronInteraction\Session\Session receive a title after successful turns. Titles appear in /resume. Generation runs in the background and makes an additional AI request, with at most three attempts per session. Existing titles are preserved.
  • Complete user messages. Drafts, queued messages and input history preserve attachments and metadata alongside text. Non-text content is represented with placeholders in the conversation.
  • File-reference example. Run composer messages from examples/ and try Explain @composer.json. The processor adds file contents for the Agent while displaying the original input.

Breaking API changes

User-message processors now belong to Neuron Interaction:

use NeuronInteraction\Message\UserMessageProcessorInterface;

public function forAgent(UserMessage $message): UserMessage;
public function forDisplay(UserMessage $message): UserMessage;

Replace the previous NeuronTui\Conversation\UserMessageProcessorInterface, whose methods accepted and returned strings. Return new messages without modifying the original message or its content blocks.

Tui::addUserMessageProcessor() has been removed. Register processors in a collection and inject it:

$processors = (new UserMessageProcessors())->addProcessor([
    new MyProcessor(),
]);

Tui::make(
    $agent,
    userMessageProcessors: $processors,
)->run();

Preparation follows registration order; display processing follows reverse order. Commands and command-generated prompts bypass preparation. Selection labels are no longer passed through message processors.

This release requires Neuron Interaction ~0.8.7, which also changes these APIs:

  • Commands: create an empty collection, then register commands with addCommand():
    $commands = (new Commands())->addCommand([
        new ClearCommand(),
        new ResumeCommand(),
    ]);
  • Command-generated prompts: promptAgent() now accepts a UserMessage:
    $adapter->promptAgent(new UserMessage($prompt));
  • Input history: record() and older() accept UserMessage objects; navigation and entries() return messages instead of strings. Previously persisted string-based input history requires migration or a reset.
  • Session summaries: titles can be null. Custom session listings should provide a fallback, such as New session.