@opengeni/codex 0.2.15 → 0.2.17

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.
@@ -53,6 +53,7 @@ export type CodexRequestOpaqueArtifacts = {
53
53
  requestId: string;
54
54
  fingerprints: readonly string[];
55
55
  };
56
+ export type CodexRequestPreparationPhase = "transport_entry" | "credential_ready" | "wire_request_ready";
56
57
  export type CodexRequestContext = {
57
58
  clientVersion: string;
58
59
  /**
@@ -83,6 +84,14 @@ export type CodexRequestContext = {
83
84
  onUsageHeaders?: (snapshot: CodexUsageHeaderSnapshot) => void;
84
85
  /** Optional per-run override, primarily for deterministic transport tests. */
85
86
  responseTimeoutPolicy?: Partial<CodexResponseTimeoutPolicy>;
87
+ /**
88
+ * Synchronous, best-effort diagnostics for the request lifecycle. This hook
89
+ * runs before the durable audit sink and MUST remain non-blocking: a throw is
90
+ * swallowed by the transport and it must never receive request bodies/auth.
91
+ */
92
+ onModelRequestDiagnostic?: (event: CodexModelRequestEvent) => void;
93
+ /** Bounded synchronous checkpoints for pre-network request preparation. */
94
+ onRequestPreparationDiagnostic?: (phase: CodexRequestPreparationPhase) => void;
86
95
  /** Worker-owned durable audit sink; payloads never contain request bodies or auth. */
87
96
  onModelRequestEvent?: (event: CodexModelRequestEvent) => Promise<void> | void;
88
97
  /** Exact opaque artifacts on the normalized wire request, never their ciphertext. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/codex",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "ChatGPT/Codex subscription auth + transport: device-code login, token refresh, and the Responses-backend fetch. Pure HTTP + transforms; no database dependency.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {