pi

package
v1.138.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) NewSkillLoads added in v1.135.0

func (p *Provider) NewSkillLoads(store *state.Store, input *trace.HookInput) []string

NewSkillLoads scans the selected live branch for completed loads. The line cursor filters uses after a full parse; the byte cursor avoids parsing when no complete candidate line was appended.

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) SessionSkills added in v1.135.0

func (p *Provider) SessionSkills(opts *trace.ParseOpts) ([]trace.SkillUse, []string, error)

SessionSkills reads only Trace's private transcript copy.

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) SkillRoots added in v1.135.0

func (p *Provider) SkillRoots(repoRoot string) skill.Roots

SkillRoots follows Pi's user/project and managed package locations. Pi does not identify an organization scope; arbitrary external paths stay unknown.

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