@christiandoxa/prodex 0.188.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 +19 -0
  2. package/package.json +7 -7
  3. package/prodex +19 -1
package/README.md CHANGED
@@ -65,6 +65,21 @@ Prodex supports two provider paths:
65
65
  | Local OpenAI-compatible | `prodex super --url http://127.0.0.1:8131` | Local server auth/config | Health snapshot | `prodex quota --all --provider local --base-url ...` checks the local `/models` endpoint. |
66
66
  | Bedrock / custom Codex `model_provider` | `prodex run` / `prodex caveman` direct pass-through | Codex-owned config | Config snapshot | Prodex reports configured provider metadata; provider-side quota stays owned by Codex/upstream. |
67
67
 
68
+ `prodex gateway` exposes the provider bridge as a standalone OpenAI-compatible service for non-Codex clients:
69
+
70
+ ```bash
71
+ PRODEX_GATEWAY_TOKEN=change-me GEMINI_API_KEY=... prodex gateway --provider gemini
72
+ auth_header="Authorization: Bearer $PRODEX_GATEWAY_TOKEN"
73
+ curl http://127.0.0.1:4000/v1/responses \
74
+ -H "$auth_header" \
75
+ -H "Content-Type: application/json" \
76
+ -d '{"model":"prodex-fast","input":"hello"}'
77
+ ```
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 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.
82
+
68
83
  <details>
69
84
  <summary>Provider behavior details</summary>
70
85
 
@@ -92,6 +107,8 @@ Runtime proxy design contract:
92
107
  npm install -g @christiandoxa/prodex
93
108
  ```
94
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
+
95
112
  </details>
96
113
 
97
114
  <details>
@@ -123,6 +140,7 @@ prodex tokensavior
123
140
  prodex clawcompactor
124
141
  prodex presidio doctor
125
142
  prodex presidio redact --text "My phone is 212-555-1234"
143
+ prodex gateway --provider gemini
126
144
  prodex s
127
145
  prodex super
128
146
  prodex claude mem
@@ -1042,6 +1060,7 @@ Contributor testing guidance lives in [docs/testing.md](./docs/testing.md), incl
1042
1060
  - [LOCAL.md](./LOCAL.md) — self-hosted local model setup and testing
1043
1061
  - [docs/state-model.md](./docs/state-model.md) — state ownership and persistence model
1044
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
1045
1064
  - [docs/testing.md](./docs/testing.md) — contributor testing guidance
1046
1065
 
1047
1066
  ## Support
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christiandoxa/prodex",
3
- "version": "0.188.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.188.0",
20
- "@christiandoxa/prodex-linux-arm64": "0.188.0",
21
- "@christiandoxa/prodex-darwin-x64": "0.188.0",
22
- "@christiandoxa/prodex-darwin-arm64": "0.188.0",
23
- "@christiandoxa/prodex-win32-x64": "0.188.0",
24
- "@christiandoxa/prodex-win32-arm64": "0.188.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) {