runtimehost

package
v0.1.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package runtimehost provides Worker-specific implementations of agent ports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InteractionRouter

type InteractionRouter struct {
	// contains filtered or unexported fields
}

InteractionRouter 统一管理审批(approval)和问题(question)类型的待处理交互请求。 通过 channel 桥接前端的 HTTP 回传和引擎的阻塞 goroutine。

func NewInteractionRouter

func NewInteractionRouter() *InteractionRouter

NewInteractionRouter 创建交互路由器。

func (*InteractionRouter) GetApprovalResponder

func (r *InteractionRouter) GetApprovalResponder(requestID string) agent.ApprovalResponder

GetApprovalResponder 获取审批请求对应的 Responder。

func (*InteractionRouter) GetQuestionResponder

func (r *InteractionRouter) GetQuestionResponder(requestID string) agent.QuestionResponder

GetQuestionResponder 获取问题请求对应的 Responder。

func (*InteractionRouter) RequestAnswer

RequestAnswer 注册 pending question 并阻塞等待前端 HTTP 回传答案。 实现 QuestionHandler 接口。

func (*InteractionRouter) RequestApproval

RequestApproval 注册 pending approval 并阻塞等待前端 HTTP 回传决策。 实现 ApprovalHandler 接口。

func (*InteractionRouter) ResolveApproval

func (r *InteractionRouter) ResolveApproval(requestID, action, reason string) error

ResolveApproval 由 HTTP handler / worker subscriber 调用,填入前端决策并唤醒阻塞的 goroutine。

func (*InteractionRouter) ResolveQuestion

func (r *InteractionRouter) ResolveQuestion(requestID string, answers [][]string) error

ResolveQuestion 由 HTTP handler / worker subscriber 调用,填入用户答案并唤醒阻塞的 goroutine。

func (*InteractionRouter) SetApprovalResponder

func (r *InteractionRouter) SetApprovalResponder(requestID string, responder agent.ApprovalResponder)

SetApprovalResponder 设置审批请求对应的 Responder。

func (*InteractionRouter) SetQuestionResponder

func (r *InteractionRouter) SetQuestionResponder(requestID string, responder agent.QuestionResponder)

SetQuestionResponder 设置问题请求对应的 Responder。

type PendingApproval

type PendingApproval struct {
	Request   *agent.ApprovalRequest
	Responder agent.ApprovalResponder
	ResultCh  chan *agent.ApprovalDecision
	CreatedAt time.Time
}

PendingApproval represents an approval request waiting for a user decision.

type PendingQuestion

type PendingQuestion struct {
	Request   *agent.QuestionRequest
	Responder agent.QuestionResponder
	ResultCh  chan *agent.QuestionAnswer
	CreatedAt time.Time
}

PendingQuestion 表示一个等待前端回答的问题请求。

type SQLiteSessionStore

type SQLiteSessionStore struct {
	// contains filtered or unexported fields
}

SQLiteSessionStore implements agentrun.ProviderSessionStore using a local SQLite database. The database path is injected by the composition root, not resolved internally.

func NewSQLiteSessionStore

func NewSQLiteSessionStore(dbPath string) (*SQLiteSessionStore, error)

NewSQLiteSessionStore opens a SQLite session store at the given path.

func (*SQLiteSessionStore) Close

func (s *SQLiteSessionStore) Close() error

Close closes the underlying database.

func (*SQLiteSessionStore) GetProviderSession

GetProviderSession implements agentrun.ProviderSessionStore.

func (*SQLiteSessionStore) MarkProviderSessionFailed

func (s *SQLiteSessionStore) MarkProviderSessionFailed(_ context.Context, key agentrun.ProviderSessionKey, reason string) error

MarkProviderSessionFailed implements agentrun.ProviderSessionStore.

func (*SQLiteSessionStore) UpsertProviderSession

func (s *SQLiteSessionStore) UpsertProviderSession(_ context.Context, binding *agentrun.ProviderSessionBinding) error

UpsertProviderSession implements agentrun.ProviderSessionStore.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL