docs

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package docs holds the built-in conversation documents of src/harness/agent.ts and provider.ts that no machine owns: pi.agent and pi.provider, and the conversation-creation step for pi.agent.

Index

Constants

This section is empty.

Variables

View Source
var AgentDef = &session.DocDef{
	Kind:           "pi.agent",
	Version:        1,
	Scope:          session.ScopeConversation,
	History:        session.HistoryRewindable,
	Fork:           session.ForkAsOf,
	Initial:        func(any) *jv.Object { return jv.NewObject() },
	CheckpointWhen: func(*jv.Object, []delta.Op, int) bool { return true },
}

AgentDef is AgentDoc: the conversation's agent state, rewindable so forks start from the agent at their fork entry. Its value holds the model, thinkingLevel, extensions, tools, instructions and cwd that are set. Read-only: assigned once at initialization.

Functions

func AddTools

func AddTools(tx *session.Tx, conversation session.ID, added []any) error

AddTools is agent.ts addTools, the effect of a tool round's `addTools` controls, applied to `tools` and `modelTools`: an array gets each name it lacks appended, and `{remove}` loses the names. An unset `tools` already enables every tool, so nothing is written for it. An unset or object `modelTools` also gets each name appended to its `add`, which loads deferred tools and has no effect for others. By name, without the registry: a tool that is not registered now, such as one of an MCP server that is reconnecting, is offered once it is again.

func CreateAgent

func CreateAgent(tx *session.Tx, conversation *jv.Object) error

CreateAgent is createAgent, the built-in part of every commit that creates or forks a conversation, for pi.agent: a fork keeps its asOf copy; a new task-owned conversation copies the stored agent of its owner task's conversation; a new ownerless one starts empty.

func ProviderDef

func ProviderDef(newID func() string) *session.DocDef

ProviderDef is ProviderDoc: the stable provider-facing identity of one conversation, {sessionId}. A fork starts with a fresh identity instead of copying its parent's. newID is the Session's UUIDv7 source.

Types

This section is empty.

Jump to

Keyboard shortcuts

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