Implement inbox read cursors for unread threads
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"ai-workflow-skill/internal/db"
|
||||
"ai-workflow-skill/internal/protocol"
|
||||
"ai-workflow-skill/internal/store"
|
||||
|
||||
@@ -28,18 +27,20 @@ func newWaitReplyCmd(root *rootOptions) *cobra.Command {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
ctx := cmd.Context()
|
||||
|
||||
sqlDB, err := db.Open(ctx, root.dbPath)
|
||||
sqlDB, err := openInboxDB(ctx, root.dbPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer sqlDB.Close()
|
||||
|
||||
s := store.NewInboxStore(sqlDB)
|
||||
agent := root.agent
|
||||
result, err := s.WaitReply(ctx, store.WaitReplyInput{
|
||||
ThreadID: opts.threadID,
|
||||
AfterMessageID: opts.afterMessageID,
|
||||
AfterEventID: opts.afterEventID,
|
||||
Kinds: parseCSV(opts.kinds),
|
||||
Agent: agent,
|
||||
Timeout: time.Duration(opts.timeoutSeconds) * time.Second,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user