adapter

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package adapter is the Runtime wait-loop glue. Hosts use durable.Runtime, not these functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAuth

func ApplyAuth(recipes []durable.MountRecipe, auth durable.AuthContext) []durable.MountRecipe

ApplyAuth updates cached recipes from a work-item AuthContext. Drop is applied first. Bindings with an alias upsert that recipe. Tokens are not stored on the returned recipes.

func BindingsForTurn

func BindingsForTurn(recipes []durable.MountRecipe, auth durable.AuthContext) []vfs.Binding

BindingsForTurn builds the secret-bearing mounts for one activity/turn. Each cached recipe is included when a token for its provider is on auth.

func ChildState

func ChildState(st durable.SessionState) string

ChildState is the tool-facing running/completed/failed for a session.

func ChildrenNudge

func ChildrenNudge(rows []durable.SessionStatus) string

ChildrenNudge is injected when inference would complete while children remain.

func CloseTurnTrees

func CloseTurnTrees(workspace, skills *vfs.MountSession, sessionID, reason string)

CloseTurnTrees closes the agent workspace tree and the host-only skills tree.

func CloseTurnVFS

func CloseTurnVFS(ms *vfs.MountSession, sessionID, reason string)

CloseTurnVFS unmounts a turn-scoped MountSession (FUSE telemetry, Close, host dir).

func EncodeUserState

func EncodeUserState(state map[string]any) (map[string]any, error)

EncodeUserState JSON-roundtrips host session state so checkpoint types are stable (numbers become float64) and non-serializable values fail now.

func MergeUserState

func MergeUserState(base, overlay map[string]any) map[string]any

MergeUserState copies overlay onto a clone of base. Overlay wins on conflict.

func NormalizeSpawn

func NormalizeSpawn(specialist, task string) (string, string, error)

NormalizeSpawn trims spawn_specialist arguments. Specialist is required; empty task allowed for idempotent retry of the same callID.

func OpenSkillsVFS

func OpenSkillsVFS(ctx context.Context, threadID string, spec durable.AgentSpec) (*vfs.MountSession, error)

OpenSkillsVFS builds the host-only skills MountSession from AgentSpec.OpenSkills. It does not attach a FUSE projection. The agent never receives this session.

func OpenTurnSessions

func OpenTurnSessions(ctx context.Context, threadID string, spec durable.AgentSpec, bindings []vfs.Binding, proj vfs.Projection) (workspace, skills *vfs.MountSession, err error)

OpenTurnSessions opens the agent workspace and the host-only skills tree. On OpenSkills failure the workspace session is closed.

func OpenTurnVFS

func OpenTurnVFS(ctx context.Context, threadID string, spec durable.AgentSpec, bindings []vfs.Binding, proj vfs.Projection) (*vfs.MountSession, error)

OpenTurnVFS builds the turn-scoped MountSession from AgentSpec.OpenVFS. Nil when OpenVFS is nil or the projection is unavailable.

func OverlaySpecialist

func OverlaySpecialist(parent durable.AgentSpec, specialist string) (durable.AgentSpec, error)

OverlaySpecialist copies the parent catalog spec and applies the named Specialist.

func UnknownChild

func UnknownChild(id string) error

UnknownChild is get_child/cancel_child with an id that is not this session's child.

Types

This section is empty.

Jump to

Keyboard shortcuts

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