9e888227a3
Семантика outbox'а — теперь чистый live-канал:
* OutboxStore.conversationEvents(id) — больше не принимает after-cursor.
Catchup (replay) делает клиент: journal.listFlow(afterSeq) + подписка
на live. Outbox ответственен только за уведомления «что-то произошло».
* OutboxStore.oldestCursor()/currentCursor()/OutboxGapException — удалены.
Эпоха и offset живут ТОЛЬКО в CursorHolder/CursorStore, переживают
рестарт и инкремент для каждого commit.
* DurableEvent: commit принимает блок { cursor -> MessageRecord }
(cursor выдаёт CursorStore; клиент не вычисляет offset сам).
* MessageRecord больше не несёт cursor — это не его ответственность.
Новые модули:
* :cursor-api — Cursor(epoch, offset) + CursorHolder / MutableCursorHolder
* :cursor-ksqlite — KsqliteCursorHolder (персистентный)
* :cursor-inmemory — для тестов
* :client-sync — LocalSyncAgent (мини-агент поверх :client для десктопа)
Удалены:
* :sync-core — старая референсная реализация, заменена
cursor-разделением и :client.
* outbox-ksqlite — CursorStore/Schema уехали в :cursor-ksqlite.
* OffsetSequencer / PersistentOffsetSequencer / InMemoryOffsetSequencer.
standalone:
* ChatAgent/ConversationLoop/DurableLog/ToolDispatcher/ReflectionScheduler/
ConversationEvents — подписка через push-паттерн (collect событий).
* A2aBridge — currentCursor() и conversationEvents(after=) убраны.
* SqliteStores — cursor_offset удалён из schema v4; seedNextFromJournal
читает MAX(created_at).
* Main.kt — outboxSequencer → outboxCursorHolder; user→agent (:server)
transport удалён; debug-routes удалены; A2A остался.
* Тесты ChatAgentTest/PersistenceTest переписаны на push-паттерн
(subscribe-before-act, snapshot∪live = итоговое состояние). 25/25 + 19/19 ✅
server / client:
* Routes эпоху читают из CursorHolder; снимки несут Cursor? для catchup.
* AgentikAgent и HttpEventStore — те же подписки, без after-параметра.
* ReconnectingOutbox / ReconnectingOutboxTest — без изменений API.
* JournalStore API расширен count(after=Instant?) для unread-badge.
38 lines
1.2 KiB
Kotlin
38 lines
1.2 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.kotlin.multiplatform)
|
|
// Нужен для @Serializable на AgentEvent/CommonEvent/Event — все
|
|
// три типа теперь живут в :outbox-api (см. миграцию из :proto).
|
|
alias(libs.plugins.kotlin.serialization)
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(21)
|
|
|
|
jvm()
|
|
macosX64()
|
|
macosArm64()
|
|
iosX64()
|
|
iosArm64()
|
|
iosSimulatorArm64()
|
|
linuxX64()
|
|
linuxArm64()
|
|
mingwX64()
|
|
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
// :proto не нужен (Event/OnlineEvent/AgentEvent/CommonEvent живут
|
|
// здесь). Message-события несут общие типы содержимого из
|
|
// низкоуровневого :content-api (Content/MessageContext/TurnTokens).
|
|
api(project(":content-api"))
|
|
api(project(":cursor-api"))
|
|
api(libs.kotlinx.coroutines.core)
|
|
api(libs.kotlinx.serialization.core)
|
|
api(libs.kotlinx.serialization.json)
|
|
}
|
|
commonTest.dependencies {
|
|
implementation(kotlin("test"))
|
|
implementation(libs.kotlinx.coroutines.test)
|
|
}
|
|
}
|
|
}
|