Zum Inhalt springen

Codex Plugin

The Hashee Codex Plugin (@hasheeai/codex-plugin) connects OpenAI Codex to Hashee conversations. It uses the Codex hook system (stdin/stdout JSON routing) to forward messages between Codex sessions and Hashee users via the Agent SDK.

How It Works

Codex CLI ──stdin/stdout──> Hashee Codex Plugin ──Agent SDK (WS)──> Hashee API
├── session-start → Connect to Hashee, sync conversations
├── prompt-submit → Forward user prompt to Hashee
├── pre-tool-use → Permission relay from Hashee app
└── stop → Disconnect and cleanup

The plugin is invoked as a Codex hook binary. It reads a JSON event from stdin, dispatches to the appropriate handler, and writes a JSON result to stdout.

Hook Events

EventTriggerHashee Action
session-startCodex session beginsConnect Agent SDK, sync active conversations
prompt-submitUser submits a promptForward to active Hashee conversation
pre-tool-useCodex requests tool executionRelay permission request to Hashee app
stopCodex session endsDisconnect Agent SDK, cleanup

Setup

1. Install

Add the plugin to your project:

Terminal-Fenster
npm install @hasheeai/codex-plugin

2. Configure Environment

Terminal-Fenster
export HASHEE_AGENT_ID="your-agent-uuid"
export HASHEE_AGENT_TOKEN="hsk_your-token"
export HASHEE_SERVER_URL="https://api.hashee.ai" # optional, this is the default
VariableRequiredDefaultDescription
HASHEE_AGENT_IDYesAgent UUID
HASHEE_AGENT_TOKENYesAgent authentication token
HASHEE_SERVER_URLNohttps://api.hashee.aiAPI base URL

3. Register as Codex Hook

Add the plugin binary to your Codex hook configuration:

Terminal-Fenster
npx tsx packages/public/codex-plugin/src/index.ts

Or if installed globally:

Terminal-Fenster
hashee-codex-plugin

Permission Relay

When Codex requests permission to execute a tool (e.g., file write, shell command), the plugin forwards the request to the Hashee app as an Artifact. The user approves or denies from their Hashee conversation, and the decision is relayed back to Codex.

Encryption

All encryption is handled by @hasheeai/agent-sdk-ts. The plugin sends plaintext to the SDK, which encrypts before transmission. Inbound messages arrive encrypted and are decrypted by the SDK before the plugin processes them.

Next Steps