pi

package
v1.131.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "pi"

Name is the provider identifier stored in session records and evidence.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider captures and parses Pi sessions.

func New

func New() *Provider

New creates a Pi provider.

func (*Provider) AnnouncePromptSubmit added in v1.128.0

func (p *Provider) AnnouncePromptSubmit(reminder string) error

AnnouncePromptSubmit writes the per-turn reminder response.

func (*Provider) AnnounceSessionStart added in v1.128.0

func (p *Provider) AnnounceSessionStart(msg trace.SessionStartMessage) error

AnnounceSessionStart writes the response consumed by the Pi extension.

func (*Provider) AnnounceToUser added in v1.128.0

func (p *Provider) AnnounceToUser(msg string) error

AnnounceToUser writes a message for Pi's UI or headless stderr channel.

func (*Provider) CaptureFileSnapshot added in v1.128.0

func (p *Provider) CaptureFileSnapshot(store *state.Store, input *trace.HookInput) error

CaptureFileSnapshot saves the file content for one Pi tool call.

func (*Provider) CleanupAfterEdit added in v1.128.0

func (p *Provider) CleanupAfterEdit(store *state.Store, input *trace.HookInput)

CleanupAfterEdit removes the snapshot for one Pi tool call.

func (*Provider) CopySessionData

func (p *Provider) CopySessionData(store *state.Store, loc trace.SessionLocation) error

CopySessionData refreshes the store's private copy of a persisted Pi JSONL session. Pi reports the authoritative path through its extension; there is no cwd-derived fallback because --no-session has no transcript to discover.

A successful refresh becomes visible only after its temporary file is closed and atomically renamed. A failed refresh leaves the previous copy in place so the push can send the best version available.

func (*Provider) DeduplicatesSessionStartInstruction added in v1.128.0

func (p *Provider) DeduplicatesSessionStartInstruction() bool

DeduplicatesSessionStartInstruction reports that the extension persists a marker carrying Pi's session ID and owns exactly-once delivery.

func (*Provider) HooksInstalled added in v1.128.0

func (p *Provider) HooksInstalled(repoRoot string) (bool, error)

HooksInstalled reports whether the Pi extension is Chainloop-managed.

func (*Provider) InstallHooks added in v1.128.0

func (p *Provider) InstallHooks(repoRoot string) error

InstallHooks writes the permanent extension, including session shutdown.

func (*Provider) InstallHooksForTraceRun added in v1.128.0

func (p *Provider) InstallHooksForTraceRun(repoRoot string) error

InstallHooksForTraceRun writes the temporary extension without session end; trace run owns final attestation and restores the previous file.

func (*Provider) IsCommandTool added in v1.128.0

func (p *Provider) IsCommandTool(toolName string) bool

IsCommandTool reports whether Pi's tool can mutate the working tree broadly.

func (*Provider) IsFileWritingTool added in v1.128.0

func (p *Provider) IsFileWritingTool(toolName string) bool

IsFileWritingTool reports whether Pi's tool writes one named file.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the agent identifier.

func (*Provider) ParseSession

func (p *Provider) ParseSession(_ context.Context, opts *trace.ParseOpts) (*aicodingsession.Evidence, error)

ParseSession reads the copied Pi JSONL and maps its selected branch to AI coding-session evidence. The live Pi transcript is never parsed in place.

func (*Provider) ReadHookInput added in v1.128.0

func (p *Provider) ReadHookInput(r io.Reader) (*trace.HookInput, error)

ReadHookInput decodes payloads emitted by the generated Pi extension.

func (*Provider) ResolveBeforeContent added in v1.128.0

func (p *Provider) ResolveBeforeContent(store *state.Store, input *trace.HookInput, _ []byte) []byte

ResolveBeforeContent returns the snapshot paired by Pi's tool-call ID.

func (*Provider) SettingsFile added in v1.128.0

func (p *Provider) SettingsFile(repoRoot string) string

SettingsFile returns the generated project-local Pi extension path.

func (*Provider) SupportsPromptReminder added in v1.128.0

func (p *Provider) SupportsPromptReminder() bool

SupportsPromptReminder reports that before_agent_start runs for every user turn.

func (*Provider) SupportsSessionStartBanner added in v1.128.0

func (p *Provider) SupportsSessionStartBanner() bool

SupportsSessionStartBanner reports that the extension can notify Pi's UI.

func (*Provider) SupportsSessionStartInstruction added in v1.128.0

func (p *Provider) SupportsSessionStartInstruction() bool

SupportsSessionStartInstruction reports that before_agent_start can inject context.

func (*Provider) UninstallHooks added in v1.128.0

func (p *Provider) UninstallHooks(repoRoot string) error

UninstallHooks removes only an extension carrying Chainloop's ownership marker.

Jump to

Keyboard shortcuts

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