durableadapter

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package durableadapter adapts the pi-durable Harness (durable/harness) to the consumer-owned boundaries of the experimental worker services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Harness      harness.Harness
	Conversation harness.Conversation
}

Session is a durable Harness with its root conversation. It implements the Harness and conversation boundaries of the worker services and the worker's Harness (Close, TaskGraph, Resume).

func (*Session) Abort

func (session *Session) Abort(ctx context.Context) error

func (*Session) AbortSubmission

func (session *Session) AbortSubmission(ctx context.Context, id durable.SubmissionId, conversationID durable.ConversationId) (durable.SubmissionAbortResult, error)

func (*Session) AgentDocument

func (session *Session) AgentDocument(ctx context.Context, conversationID durable.ConversationId) (services.AgentDocument, error)

AgentDocument is the conversation's pi.agent document as a replicated state; it is nil when the conversation has none.

func (*Session) Close

func (session *Session) Close(ctx context.Context) error

func (*Session) Compact

func (session *Session) Compact(ctx context.Context, customInstructions *string) (int64, error)

func (*Session) Configure

func (session *Session) Configure(ctx context.Context, configuration services.ConversationConfiguration) error

Configure applies the model and thinking level in one commit.

func (*Session) ID

func (session *Session) ID() durable.ConversationId

func (*Session) Resume

func (session *Session) Resume()

func (*Session) Submission

func (session *Session) Submission(ctx context.Context, id durable.SubmissionId) (services.PromptSubmission, error)

Submission reacquires a submission; it is nil when the Harness has none with that ID.

func (*Session) Submit

func (session *Session) Submit(ctx context.Context, content ai.UserContent, whenBusy durable.WhenBusy) (durable.SubmissionId, error)

func (*Session) TaskGraph

func (session *Session) TaskGraph(ctx context.Context) (services.TaskGraphActivity, error)

TaskGraph observes the Harness's live tasks; the worker stays open while any exists.

func (*Session) ViewState

func (session *Session) ViewState(ctx context.Context) (services.TranscriptViewState, error)

ViewState returns conversation.viewState as the service host's Chord state, as upstream serves it (transcript-provider.ts:6-13, view.ts:92-104): the host state republishes the durable state's exact operation batches, so it never re-encodes or re-diffs the whole view. ctx bounds only the attachment; the state lives until Dispose.

Jump to

Keyboard shortcuts

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