@christiandoxa/prodex 0.189.0 → 0.190.0

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.
Files changed (3) hide show
  1. package/README.md +6 -1
  2. package/package.json +7 -7
  3. package/prodex +19 -1
package/README.md CHANGED
@@ -76,7 +76,9 @@ curl http://127.0.0.1:4000/v1/responses \
76
76
  -d '{"model":"prodex-fast","input":"hello"}'
77
77
  ```
78
78
 
79
- The gateway serves `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/images/*`, `/v1/audio/*`, `/v1/batches`, `/v1/rerank`, `/v1/a2a`, `/v1/messages`, and `/v1/models` where the selected upstream supports them. It adds `x-prodex-call-id` to responses, writes local request detail plus `gateway_spend` events to runtime logs, can export those events to JSONL or HTTP using generic, OTel, Datadog, or Langfuse-shaped payloads, supports policy-defined routing strategies (`fallback`, `round-robin`, `least-busy`, `lowest-cost`, `lowest-latency`, `rpm`, `tpm`, `first`) for model aliases/fallback chains, and can apply keyword/model, Presidio, and external webhook guardrails before calls and on outputs. Configure defaults under `[gateway]` in `policy.toml`.
79
+ The gateway serves `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/images/*`, `/v1/audio/*`, `/v1/batches`, `/v1/rerank`, `/v1/a2a`, `/v1/messages`, and `/v1/models` where the selected upstream supports them. It adds `x-prodex-call-id` to responses, writes local request detail plus `gateway_spend` events for both `request` and `response` phases to runtime logs, can export those events to JSONL or HTTP using generic, OTel, Datadog, or Langfuse-shaped payloads, supports catalog-backed policy routing strategies (`fallback`, `round-robin`, `least-busy`, `lowest-cost`, `lowest-latency`, `rpm`, `tpm`, `first`) for model aliases/fallback chains, can enforce static virtual keys with persisted request/spend usage plus model/budget/RPM/TPM limits, supports file, SQLite, Postgres, or Redis-backed gateway admin/usage/ledger/SCIM state, and can apply keyword/model, Presidio, and external webhook guardrails before calls and on outputs. Admin-token, trusted-proxy SSO, or OIDC/JWT bearer requests can list usage, create generated-token keys, rotate/disable/update/delete admin-managed keys, provision SSO users through SCIM-compatible `/v1/prodex/gateway/scim/v2/Users`, inspect usage at `/v1/prodex/gateway/keys` and `/v1/prodex/gateway/usage`, read recent billing ledger records with response-status/output-token reconciliation at `/v1/prodex/gateway/ledger`, read aggregated billing totals at `/v1/prodex/gateway/ledger/summary`, export billing CSV from `/v1/prodex/gateway/ledger.csv` and `/v1/prodex/gateway/ledger/summary.csv`, scrape Prometheus text metrics at `/v1/prodex/gateway/metrics`, fetch the machine-readable gateway contract at `/v1/prodex/gateway/openapi.json`, and open the built-in gateway admin dashboard at `/v1/prodex/gateway/admin`; policy/env-backed keys remain read-only, admin-managed key and SCIM user mutations are recorded in `prodex audit`, and additional admin-plane tokens can be `admin` or read-only `viewer` with optional virtual-key prefix and tenant scopes. Configure defaults under `[gateway]` in `policy.toml`; validate provider catalog edits with `npm run catalog:providers`.
80
+
81
+ JavaScript clients can use `@christiandoxa/prodex-gateway-sdk` for `/v1/responses` plus gateway key, usage, billing ledger, metrics, and OpenAPI admin calls.
80
82
 
81
83
  <details>
82
84
  <summary>Provider behavior details</summary>
@@ -105,6 +107,8 @@ Runtime proxy design contract:
105
107
  npm install -g @christiandoxa/prodex
106
108
  ```
107
109
 
110
+ The npm package uses its bundled `@openai/codex@latest` dependency by default. To deliberately use a separate Codex CLI from your machine, set `PRODEX_CODEX_BIN=/path/to/codex` or `PRODEX_CODEX_RESOLUTION=external`.
111
+
108
112
  </details>
109
113
 
110
114
  <details>
@@ -1056,6 +1060,7 @@ Contributor testing guidance lives in [docs/testing.md](./docs/testing.md), incl
1056
1060
  - [LOCAL.md](./LOCAL.md) — self-hosted local model setup and testing
1057
1061
  - [docs/state-model.md](./docs/state-model.md) — state ownership and persistence model
1058
1062
  - [docs/runtime-policy.md](./docs/runtime-policy.md) — runtime policy keys, environment overrides, and runtime log path resolution
1063
+ - [docs/deployment.md](./docs/deployment.md) — Docker Compose scaffold for the standalone gateway
1059
1064
  - [docs/testing.md](./docs/testing.md) — contributor testing guidance
1060
1065
 
1061
1066
  ## Support
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christiandoxa/prodex",
3
- "version": "0.189.0",
3
+ "version": "0.190.0",
4
4
  "description": "Safe multi-account auto-rotate for Codex CLI with isolated CODEX_HOME profiles",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -16,12 +16,12 @@
16
16
  "@openai/codex": "latest"
17
17
  },
18
18
  "optionalDependencies": {
19
- "@christiandoxa/prodex-linux-x64": "0.189.0",
20
- "@christiandoxa/prodex-linux-arm64": "0.189.0",
21
- "@christiandoxa/prodex-darwin-x64": "0.189.0",
22
- "@christiandoxa/prodex-darwin-arm64": "0.189.0",
23
- "@christiandoxa/prodex-win32-x64": "0.189.0",
24
- "@christiandoxa/prodex-win32-arm64": "0.189.0"
19
+ "@christiandoxa/prodex-linux-x64": "0.190.0",
20
+ "@christiandoxa/prodex-linux-arm64": "0.190.0",
21
+ "@christiandoxa/prodex-darwin-x64": "0.190.0",
22
+ "@christiandoxa/prodex-darwin-arm64": "0.190.0",
23
+ "@christiandoxa/prodex-win32-x64": "0.190.0",
24
+ "@christiandoxa/prodex-win32-arm64": "0.190.0"
25
25
  },
26
26
  "engines": {
27
27
  "node": ">=18"
package/prodex CHANGED
@@ -97,7 +97,25 @@ function resolveExternalCodexBin() {
97
97
  if (process.env.PRODEX_CODEX_BIN) {
98
98
  return process.env.PRODEX_CODEX_BIN;
99
99
  }
100
- return resolveCommandFromPath("codex", process.env.PATH || "");
100
+ const resolution = (process.env.PRODEX_CODEX_RESOLUTION || "bundled").toLowerCase();
101
+ if (resolution === "bundled") {
102
+ return null;
103
+ }
104
+ if (resolution !== "external") {
105
+ process.stderr.write(
106
+ `Unsupported PRODEX_CODEX_RESOLUTION=${JSON.stringify(process.env.PRODEX_CODEX_RESOLUTION)}; expected "bundled" or "external".\n`,
107
+ );
108
+ process.exit(1);
109
+ }
110
+
111
+ const externalCodex = resolveCommandFromPath("codex", process.env.PATH || "");
112
+ if (!externalCodex) {
113
+ process.stderr.write(
114
+ "PRODEX_CODEX_RESOLUTION=external was set, but no executable codex was found on PATH.\n",
115
+ );
116
+ process.exit(1);
117
+ }
118
+ return externalCodex;
101
119
  }
102
120
 
103
121
  if (!platformPackage) {