pi-openai-codex-compat 0.0.10 → 0.0.11
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/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -25,6 +25,11 @@ Pi provides the Codex OAuth flow and model catalog. At session start, this packa
|
|
|
25
25
|
- Pi `>=0.86.0 <0.87.0`
|
|
26
26
|
- An OpenAI Codex login in Pi
|
|
27
27
|
|
|
28
|
+
Restart Pi after upgrading its runtime. `/reload` reloads extensions but cannot
|
|
29
|
+
upgrade the running Pi process. The extension checks the host's transcript APIs
|
|
30
|
+
at load time. `PI_PACKAGE_DIR` can point an older executable at newer package
|
|
31
|
+
metadata, so its displayed version alone does not establish compatibility.
|
|
32
|
+
|
|
28
33
|
Authenticate through Pi if needed:
|
|
29
34
|
|
|
30
35
|
```text
|
|
@@ -581,6 +586,11 @@ mise run test:live:codex
|
|
|
581
586
|
|
|
582
587
|
The task obtains the local Codex bearer token and runs the tests with
|
|
583
588
|
`gpt-5.6-luna` at medium reasoning effort.
|
|
589
|
+
It also packs the extension and loads that archive through the shipped Pi
|
|
590
|
+
0.86.0 CLI. Ordinary Responses and Responses Lite tests exercise tool calls,
|
|
591
|
+
prompt reload, native compaction, and persisted-session resume against Codex.
|
|
592
|
+
Test credentials stay in memory and child-process environments. Test sessions
|
|
593
|
+
and configuration are isolated from the user's agent directory.
|
|
584
594
|
|
|
585
595
|
The public package entrypoint is `extensions/index.ts`; implementation modules remain under
|
|
586
596
|
`extensions/openai-codex-compat/`. The focused Pi AI serializer copy lives under
|
|
@@ -593,7 +603,7 @@ search, and compaction continuation.
|
|
|
593
603
|
## Release staging
|
|
594
604
|
|
|
595
605
|
1. Run `npm run release -- X.Y.Z` from a clean, synchronized `main`.
|
|
596
|
-
2. The command builds the exact package locally
|
|
606
|
+
2. The command builds the exact package locally and runs live CLI tests against that archive. It also runs the existing live SDK tests against checkout source. Both suites must pass before it records the archive's SHA-256 in an SSH-signed release commit, proves a clean rebuild is reproducible, and creates a lightweight tag. Missing credentials or failing live tests stop the release.
|
|
597
607
|
3. Inspect the result, then push atomically with `git push --atomic origin main vX.Y.Z`.
|
|
598
608
|
4. A read-only GitHub Actions job validates and packs the package. After approval in the tag-restricted `npm-publish` environment, a separate GitHub-owned job verifies the signature and signed digest before attesting and staging that exact archive through npm trusted publishing.
|
|
599
609
|
5. Approve the staged package on npmjs.com, or with `npm stage approve <stage-id>`.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import * as piAi from "@earendil-works/pi-ai";
|
|
3
|
+
import { requirePiTranscriptRuntime } from "./pi-runtime.ts";
|
|
2
4
|
import { DEFAULT_CONFIG, loadConfig, type CodexCompatConfig } from "./config.ts";
|
|
3
5
|
import type { ConfigContext } from "./config-context.ts";
|
|
4
6
|
import { registerCodexProvider } from "./codex-provider.ts";
|
|
@@ -21,6 +23,7 @@ export {
|
|
|
21
23
|
} from "./codex-transport.ts";
|
|
22
24
|
|
|
23
25
|
export default function registerOpenAICodexCompat(pi: ExtensionAPI): void {
|
|
26
|
+
requirePiTranscriptRuntime(piAi);
|
|
24
27
|
let activeConfig: CodexCompatConfig | undefined;
|
|
25
28
|
const resolveConfig = (ctx: ConfigContext): CodexCompatConfig => {
|
|
26
29
|
activeConfig ??= loadConfig(ctx.cwd, ctx.isProjectTrusted());
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const TRANSCRIPT_APIS = [
|
|
2
|
+
"normalizeContext",
|
|
3
|
+
"getCurrentSystemPrompt",
|
|
4
|
+
"getDeclaredTools",
|
|
5
|
+
"getInitialSystemMessage",
|
|
6
|
+
"resolveTranscriptTools",
|
|
7
|
+
] as const;
|
|
8
|
+
|
|
9
|
+
/** Check the loaded host, not package metadata that PI_PACKAGE_DIR can override. */
|
|
10
|
+
export function requirePiTranscriptRuntime(api: Record<string, unknown>): void {
|
|
11
|
+
const missing = TRANSCRIPT_APIS.filter((name) => typeof api[name] !== "function");
|
|
12
|
+
if (missing.length > 0) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"pi-openai-codex-compat requires a running Pi 0.86.x runtime. " +
|
|
15
|
+
`Missing host APIs: ${missing.join(", ")}. ` +
|
|
16
|
+
"Exit Pi and start Pi 0.86.x after updating. /reload cannot upgrade the running " +
|
|
17
|
+
"runtime, and PI_PACKAGE_DIR can make an older executable report a newer version.",
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-openai-codex-compat",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "OpenAI Codex compatibility for Pi with native compaction, fast mode, and Codex-optimized capabilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"check": "hk check --all --check",
|
|
38
38
|
"test": "node --test --test-concurrency=4 test/*.test.ts",
|
|
39
|
-
"test:live:codex": "PI_CODEX_LIVE_TEST=1 node --test --test-concurrency=1 test/codex-host.live.test.ts",
|
|
39
|
+
"test:live:codex": "PI_CODEX_LIVE_TEST=1 node --test --test-concurrency=1 test/codex-host.live.test.ts test/codex-cli.live.test.ts",
|
|
40
40
|
"pack:dry": "npm pack --dry-run --allow-directory=all",
|
|
41
41
|
"release": "node scripts/release.ts",
|
|
42
42
|
"fmt": "oxfmt",
|