convert

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Package convert converts pi sessions into the Agent Session Format. docs/formats/pi.md is the mapping and lists every finding code it reports.

Index

Constants

View Source
const Harness = "pi"

Harness is the harness name converted sessions record.

View Source
const Source = "pi"

Source is the format name and the namespace of every extension member and custom entry this converter writes.

Variables

This section is empty.

Functions

func Convert

func Convert(f *pi.File, opts Options) (*agentimport.Result, error)

Convert converts a session file into one session. The file is migrated to the current version first, as pi migrates it on load.

func ConvertFile

func ConvertFile(path string, opts Options) (*agentimport.Result, error)

ConvertFile reads the session file at path and converts it. A forked session's parent is resolved by reading the file it names, when that exists.

Types

type Options

type Options struct {
	// Slim drops what the model never saw and the session format has
	// no member for, rather than keeping it in namespaced members: tool
	// and extension details, members of a line or message the converter
	// does not map, and a bash execution's record beside its rendering.
	// Each drop is still reported. Custom entries, the format's own
	// place for extension state, are kept.
	Slim bool
	// Derive writes the entries the module's derivation rules infer
	// from the converted path, each marked agentimport:derived: what a
	// shell call published and the revision a commit printed
	// (docs/plans/agentimport.md).
	Derive bool
	// ResolveParent reads the session file a forked session's header
	// names by path. Nil resolves nothing; ConvertFile reads the file.
	ResolveParent func(path string) (*pi.File, bool)
}

Options tune a conversion. The zero value keeps everything and resolves no parent session.

Jump to

Keyboard shortcuts

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