@grackle-ai/runtime-codex 0.108.4 → 0.110.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @grackle-ai/runtime-codex
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/@grackle-ai/runtime-codex"><img src="https://img.shields.io/npm/v/@grackle-ai/runtime-codex.svg" alt="npm version" /></a>
|
|
5
|
+
<a href="https://github.com/nick-pape/grackle/actions/workflows/ci.yml"><img src="https://github.com/nick-pape/grackle/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
|
|
6
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img src="https://raw.githubusercontent.com/nick-pape/grackle/main/apps/docs-site/static/img/grackle-logo.png" alt="Grackle" width="200" />
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
Grackle runtime that drives OpenAI's Codex agent.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
This package implements the `AgentRuntime` interface from [`@grackle-ai/runtime-sdk`](https://www.npmjs.com/package/@grackle-ai/runtime-sdk) by wrapping OpenAI's Codex SDK (`@openai/codex-sdk`), which in turn drives the Codex CLI. The exported `CodexRuntime` is registered with the PowerLine runtime registry under the name `codex`, so tasks can run against Codex anywhere PowerLine runs (Docker, local, SSH, Codespace).
|
|
18
|
+
|
|
19
|
+
When a session starts, the runtime creates a Codex thread, runs the prompt with `runStreamed()`, and translates the SDK's thread events into Grackle's normalized agent event stream (text, reasoning, tool use/results, usage, and errors). It supports multi-turn conversations, follow-up input, resuming a previous thread, MCP servers, and `maxTurns` enforcement.
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
All configuration is supplied via environment variables so the runtime behaves identically across every environment type.
|
|
24
|
+
|
|
25
|
+
| Variable | Required | Description |
|
|
26
|
+
|----------|----------|-------------|
|
|
27
|
+
| `OPENAI_API_KEY` | yes* | OpenAI API key. Read automatically by the Codex SDK. |
|
|
28
|
+
| `CODEX_API_KEY` | no | Explicit API-key override; takes precedence over `OPENAI_API_KEY`. |
|
|
29
|
+
| `OPENAI_BASE_URL` | no | Custom base URL for the OpenAI API. |
|
|
30
|
+
| `CODEX_CLI_PATH` | no | Path to the Codex CLI binary, overriding default PATH resolution. |
|
|
31
|
+
|
|
32
|
+
\* Either `OPENAI_API_KEY` or `CODEX_API_KEY` must be set. If neither is present, Codex returns no messages and the session reports an authentication error.
|
|
33
|
+
|
|
34
|
+
Threads are created with full filesystem access (`sandboxMode: "danger-full-access"`), no approval prompts (`approvalPolicy: "never"`), and the git-repo check skipped, since the agent runs inside an already-isolated Grackle environment. The working directory and `model` are set per session from the spawn options; system context is injected as Codex `developer_instructions`, and MCP servers are translated into Codex's `mcp_servers` config.
|
|
35
|
+
|
|
36
|
+
## Models
|
|
37
|
+
|
|
38
|
+
The model is selected per session from the spawn options and passed straight through to the Codex thread. When no model is specified, the Codex SDK / CLI default is used. This package does not pin or restrict the model list — any model your installed Codex CLI accepts is valid.
|
|
39
|
+
|
|
40
|
+
## Credentials
|
|
41
|
+
|
|
42
|
+
Codex authenticates with an OpenAI API key, resolved in this order:
|
|
43
|
+
|
|
44
|
+
1. `CODEX_API_KEY` (explicit override)
|
|
45
|
+
2. `OPENAI_API_KEY` (read automatically by the SDK)
|
|
46
|
+
|
|
47
|
+
Grackle delivers these credentials to the PowerLine over the gRPC connection at task start, so nothing needs to be baked into the environment image.
|
|
48
|
+
|
|
49
|
+
## Requirements
|
|
50
|
+
|
|
51
|
+
- Node.js >= 22
|
|
52
|
+
- The Codex CLI installed and available on `PATH` (or set `CODEX_CLI_PATH`)
|
|
53
|
+
- An OpenAI API key (`OPENAI_API_KEY` or `CODEX_API_KEY`)
|
|
54
|
+
|
|
55
|
+
The `@openai/codex-sdk` package is installed lazily on first use into an isolated per-runtime directory, so it does not need to be a direct dependency of your project.
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grackle-ai/runtime-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.110.2",
|
|
4
4
|
"description": "Grackle OpenAI Codex runtime implementation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"dist/"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@grackle-ai/
|
|
32
|
-
"@grackle-ai/
|
|
31
|
+
"@grackle-ai/common": "0.110.2",
|
|
32
|
+
"@grackle-ai/runtime-sdk": "0.110.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@rushstack/heft": "1.2.7",
|