codex

package
v0.14.4-dev.25 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func Account(ctx context.Context) base.Account

Account reads the credential staged homes share, falling back to `codex login status` for a login kept only in the OS keychain.

func Capability

func Capability() map[string]string

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

func CurrentHome(projectRoot, modeName string) (string, error)

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

func Login(string) (base.LoginFlow, error)

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

func Logout(context.Context) error

Logout signs Codex out of every project, as `agentpack codex logout` does.

func MergeMCP

func MergeMCP(path string, entries mcp.Entries) error

func MergeMCPData added in v0.9.0

func MergeMCPData(data []byte, entries mcp.Entries) ([]byte, []string, []string, error)

func New

func New() base.Harness

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

func ProjectHomes(projectRoot string) (string, error)

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

func RefreshAuth(ctx context.Context, data []byte) ([]byte, error)

RefreshAuth renews the ChatGPT tokens in an auth.json and returns the updated file.

func RefreshCredential added in v0.14.1

func RefreshCredential(ctx context.Context, data []byte) ([]byte, error)

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

func Support(event hooks.Event, handler hooks.Handler) hooks.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

Jump to

Keyboard shortcuts

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