acp

package
v0.149.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 19 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 acp runs an `acp-agent` job: it starts the agent's ACP server over stdio, drives exactly one prompt turn (initialize → session/new → session/prompt) and maps the protocol's events onto the job's outputs.

Where each thing goes (bd h-aii-rnxk / h-aii-7kja):

  • stdout.log — the agent's own text, one block per message (a tool call ends a block, and the block after it starts on a fresh line).
  • stderr.log — the execution DETAILS as compact `{"type":…}` event lines in the ndjson capture's shape, so the web's NdjsonTimeline and `job logs stderr` read them: tool_call (per status or content/location change), thought (coalesced), permission, plan, stop.
  • acp.jsonl — the full structured stream for debugging (raw payloads truncated), thoughts coalesced the same way.
  • job events — lifecycle only: the approval gate's permission_* rows and ONE job.acp_summary at the end of the turn.

See docs/design/2026-09-17-acp-agent-and-approval-gate-design.md §一 (S0). The protocol client itself lives in internal/acp; this package is the mapping layer.

Index

Constants

View Source
const ACPFileName = "acp.jsonl"

ACPFileName is the structured event stream this runner writes, relative to the job result dir. It sits under artifacts/ so it is part of the job's artifact manifest (listable + downloadable like any other artifact).

View Source
const Name = "acp"

Name is the runner identifier ("acp"). It is NOT a configurable runner key: the job service selects it for acp-agent jobs the way it selects the pty runner for interactive ones.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct{}

Runner executes acp-agent jobs.

func New

func New() *Runner

New returns an acp runner.

func (*Runner) Name

func (r *Runner) Name() string

Name implements runner.Runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, req runner.Request) runner.Result

Run drives one prompt turn against the agent in req.Command/req.Args.

Outcome mapping (design §一.3): end_turn → exit 0; max_tokens/max_turn_requests → exit 0 with a warning and the stop_reason recorded; refusal → non-zero with an error; cancelled → the job's context error (the job service classifies it as cancelled or timeout); a protocol/transport failure → non-zero with that error. The session id and stopReason ride the result so the job row records both.

Jump to

Keyboard shortcuts

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