agentrun

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 3 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

Overview

Package agentrun provides workdir-encoding helpers used by the JSONL session-file watcher (#349) to locate claude's per-session output under ~/.claude/projects/<encoded-cwd>/.

MUST NOT log file contents. Callers that consume the resolved paths must uphold the same constraint at their layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeProjectDir

func EncodeProjectDir(workdir string) (string, error)

EncodeProjectDir returns the dashed directory-name segment claude uses under ~/.claude/projects/ for the given workdir. Chains ResolveWorkdir then maps '/' and '.' to '-' in the resolved absolute path. The result does NOT include the ~/.claude/projects/ prefix or any .jsonl suffix.

func ResolveWorkdir

func ResolveWorkdir(workdir string) (string, error)

ResolveWorkdir returns the resolved absolute path of workdir, mirroring how claude resolves a workdir before reading ~/.claude.json's projects map. Resolves symlinks (macOS /var → /private/var). Wraps fs.ErrNotExist when the path does not exist.

Types

This section is empty.

Directories

Path Synopsis
Package budget enforces the pyry-side --max-turns cap for agent-run by counting assistant JSONL entries and signalling the claude child when the budget is reached.
Package budget enforces the pyry-side --max-turns cap for agent-run by counting assistant JSONL entries and signalling the claude child when the budget is reached.
Package jsonl parses claude session JSONL output into structured events, surfacing every line (assistant, user, tool_use, tool_result, system, attachment, or unrecognised) with its verbatim bytes, alongside a deterministic end-of-turn signal on assistant entries.
Package jsonl parses claude session JSONL output into structured events, surfacing every line (assistant, user, tool_use, tool_result, system, attachment, or unrecognised) with its verbatim bytes, alongside a deterministic end-of-turn signal on assistant entries.
tail
Package tail watches ~/.claude/projects/<encoded-cwd>/<sid>.jsonl for claude's per-session JSONL output, opens the file as it appears, and feeds appended bytes into a jsonl.Reader until the deterministic end-of-turn signal fires or the caller cancels.
Package tail watches ~/.claude/projects/<encoded-cwd>/<sid>.jsonl for claude's per-session JSONL output, opens the file as it appears, and feeds appended bytes into a jsonl.Reader until the deterministic end-of-turn signal fires or the caller cancels.
Package selfcheck implements the boot-time verification that the per-agent tool-allowlist enforcement contract still refuses Bash when claude is spawned with `--allowed-tools "Read" --dangerously-skip-permissions` in stream-json mode and asked for Bash.
Package selfcheck implements the boot-time verification that the per-agent tool-allowlist enforcement contract still refuses Bash when claude is spawned with `--allowed-tools "Read" --dangerously-skip-permissions` in stream-json mode and asked for Bash.
Package streamjson re-emits the parsed claude session-JSONL Event stream onto a writer (typically pyry's stdout) and composes a single `type:"result"` trailer line when the run terminates.
Package streamjson re-emits the parsed claude session-JSONL Event stream onto a writer (typically pyry's stdout) and composes a single `type:"result"` trailer line when the run terminates.
Package streamrunner spawns claude with the stream-json input/output formats as a plain subprocess (no PTY), writes one user-turn JSON envelope to its stdin, forwards stdout/stderr to caller-supplied writers, and waits for the child to exit.
Package streamrunner spawns claude with the stream-json input/output formats as a plain subprocess (no PTY), writes one user-turn JSON envelope to its stdin, forwards stdout/stderr to caller-supplied writers, and waits for the child to exit.

Jump to

Keyboard shortcuts

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