Documentation
¶
Index ¶
- Variables
- func Account(ctx context.Context) base.Account
- func Capability() map[string]string
- func CredentialFile() string
- func CurrentHome(projectRoot, modeName string) (string, error)
- func HomesBase() string
- func Login(string) (base.LoginFlow, error)
- func Logout(context.Context) error
- func MergeMCP(path string, entries mcp.Entries) error
- func MergeMCPData(data []byte, entries mcp.Entries) ([]byte, []string, []string, error)
- func New() base.Harness
- func ProbeHome(ctx context.Context, codexHome, workspace, sourceID, lockDigest, mode string, ...) (environment.Receipt, error)
- func ProjectHomes(projectRoot string) (string, error)
- func ReadLimits(ctx context.Context, codexHome string) base.LimitSnapshot
- func RefreshAuth(ctx context.Context, data []byte) ([]byte, error)
- func RefreshCredential(ctx context.Context, data []byte) ([]byte, error)
- func Support(event hooks.Event, handler hooks.Handler) hooks.Support
- type HookRenderer
Constants ¶
This section is empty.
Variables ¶
var LoginMethods = []base.LoginMethod{{ID: "chatgpt", Label: "ChatGPT account"}}
LoginMethods are the ways the web UI signs Codex in.
Functions ¶
func Account ¶ added in v0.14.1
Account reads the credential staged homes share, falling back to `codex login status` for a login kept only in the OS keychain.
func Capability ¶
Capability describes validated Codex observation support for this revision.
func CredentialFile ¶ added in v0.14.1
func CredentialFile() string
CredentialFile is the auth.json every staged Codex home links to: ~/.codex's when present, else agentpack's shared one (sharedAuthSource picks the same, without touching the keychain here).
func CurrentHome ¶
CurrentHome resolves the fully published home for new launches. The pointer is updated only after a replacement generation passes staging verification. Running Codex processes retain the old canonical path across that update.
func HomesBase ¶
func HomesBase() string
HomesBase is the directory that holds the Codex homes of every project.
Codex binds a Unix socket at <home>/app-server-control/app-server-control.sock, and a socket path is limited to about 104 (macOS) or 108 (Linux) bytes, so a home must sit at a short path. With AGENTPACK_STAGING_ROOT set, the homes go under it (<root>/ap-c) whenever a generation there still leaves room for the socket. Otherwise, and when the configured root is too long, they go under /var/tmp/ap-c, the one place agentpack writes outside its configured roots.
func Login ¶ added in v0.14.1
Login runs `codex login --device-auth` in an isolated home, so an abandoned attempt never touches the current credential; success installs the new one as the shared source.
func Logout ¶ added in v0.14.1
Logout signs Codex out of every project, as `agentpack codex logout` does.
func MergeMCPData ¶ added in v0.9.0
func ProbeHome ¶
func ProbeHome(ctx context.Context, codexHome, workspace, sourceID, lockDigest, mode string, packaged ...base.PackagedNames) (environment.Receipt, error)
ProbeHome records what Codex lists for the staged home. packaged names the commands and subagents of the plan: Agentpack renders them as skills for Codex, so they are observed in the same listing and reported under their own category.
func ProjectHomes ¶
ProjectHomes is the directory that holds one project's Codex homes, for every mode.
func ReadLimits ¶ added in v0.10.0
func ReadLimits(ctx context.Context, codexHome string) base.LimitSnapshot
ReadLimits asks the authenticated Codex app-server for account rate limits. It uses the user's existing login, including Agentpack's shared auth store, and sends no inference turns.
func RefreshAuth ¶ added in v0.14.1
RefreshAuth renews the ChatGPT tokens in an auth.json and returns the updated file.
func RefreshCredential ¶ added in v0.14.1
RefreshCredential renews the ChatGPT sign-in in an auth.json when it is due, and returns nil when it is not (or the file holds an API key).
func Support ¶
Support follows the event list of the Codex hooks reference (learn.chatgpt.com/docs/hooks, read 2026-10-13; the names are also in the codex-cli 0.159.3 binary): PreToolUse, PermissionRequest, PostToolUse, PreCompact, PostCompact, UserPromptSubmit, SubagentStart, SubagentStop, Stop, SessionStart, SessionEnd. Codex's own Interrupt has no counterpart in the other agents' hook files.
Types ¶
type HookRenderer ¶
type HookRenderer struct{}
func (HookRenderer) Render ¶
func (HookRenderer) Render(bundle hooks.Bundle, context hooks.RenderContext) (hooks.RenderOutput, error)
func (HookRenderer) Target ¶
func (HookRenderer) Target() harness.Target