feat(client): refactor AgentikAgent to manage its own HttpClient
- `AgentikAgent` now accepts `engineFactory` and an optional `token` to create an internal `HttpClient`, handling all configuration (JSON, Bearer). - Removed `applyAgentikDefaults` and replaced it with `agentikHttpClient` for `HttpClient` creation with consistent settings. - Updated `Agent` to implement `AutoCloseable`, ensuring proper resource closure with `agent.close()`. - Adjusted tests, docs, and examples to align with the new `AgentikAgent` API.
This commit is contained in:
@@ -19,11 +19,18 @@ import kotlin.time.Instant
|
||||
* `outbox.agentEvents(after)`. Это даёт единый путь для всех read-операций
|
||||
* по хранилищу и убирает дублирование между протоколом и хранилищем.
|
||||
*/
|
||||
public interface Agent {
|
||||
interface Agent : AutoCloseable {
|
||||
|
||||
/** Идентификатор агента. */
|
||||
val id: String
|
||||
|
||||
/**
|
||||
* Освобождает ресурсы агента (HTTP-клиент, сетевые handles, подписки).
|
||||
* После [close] вызовы [createConversation] / [getConversation] и т.п.
|
||||
* не определены. Idempotent.
|
||||
*/
|
||||
override fun close()
|
||||
|
||||
/**
|
||||
* Append-only audit log всех сообщений диалогов (read-only view).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user