@agentvault/openai-bridge 0.1.1 → 0.1.3

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/dist/bridge.d.ts CHANGED
@@ -19,6 +19,17 @@ export interface BridgeChannel {
19
19
  conversationId: string;
20
20
  }): Promise<unknown>;
21
21
  sendToRoom(roomId: string, text: string): Promise<unknown>;
22
+ /** SecureChannel's TelemetryReporter (device JWT, buffered). Optional so
23
+ * fixtures and a channel without telemetry keep working. */
24
+ telemetry?: {
25
+ reportLlmCall(opts: {
26
+ model: string;
27
+ provider?: string;
28
+ latencyMs: number;
29
+ tokensInput: number;
30
+ tokensOutput: number;
31
+ }): void;
32
+ } | null;
22
33
  }
23
34
  export interface TurnDriver {
24
35
  run(key: string, prompt: string, signal?: AbortSignal): Promise<TurnResult>;
@@ -46,6 +57,9 @@ export declare class OpenAIBridge {
46
57
  private hushed;
47
58
  private invalidate;
48
59
  private enqueue;
60
+ /** Health (2026-10-14): tokens for the model call. No cost — the bridge runs
61
+ * on a ChatGPT login, so there is no per-token price to report honestly. */
62
+ private reportUsage;
49
63
  private deliver;
50
64
  idle(): Promise<void>;
51
65
  stop(): Promise<void>;
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type HistoryRecoveryCommandInput } from "@agentvault/agentvault";
2
2
  import { type Layout } from "./driver.js";
3
- export declare const VERSION = "0.1.1";
3
+ export declare const VERSION = "0.1.3";
4
4
  export interface RunConfig {
5
5
  name: string;
6
6
  apiUrl: string;
package/dist/driver.d.ts CHANGED
@@ -18,10 +18,24 @@ export declare function buildInvocation(layout: Layout, sessionId?: string): {
18
18
  };
19
19
  export declare function resolveCodex(path?: string): Promise<string>;
20
20
  export declare function checkVersion(binary: string, layout: Layout): Promise<void>;
21
+ /** The one model this bridge runs (pinned in buildInvocation). */
22
+ export declare const CODEX_MODEL = "gpt-5.6-terra";
23
+ /** Token usage Codex reports on `turn.completed`, for Health (2026-10-14). */
24
+ export interface TurnUsage {
25
+ model: string;
26
+ inputTokens: number;
27
+ outputTokens: number;
28
+ cachedInputTokens?: number;
29
+ }
21
30
  export interface TurnResult {
22
31
  text: string;
23
32
  sessionId: string;
33
+ /** Absent when Codex reported none or the shape was not understood. */
34
+ usage?: TurnUsage;
24
35
  }
36
+ /** Lenient on purpose: usage is telemetry, so a shape we do not understand is
37
+ * dropped — it must never fail a turn the strict parser otherwise accepted. */
38
+ export declare function parseTurnUsage(raw: unknown): TurnUsage | undefined;
25
39
  export interface DriverOptions {
26
40
  binary: string;
27
41
  layout: Layout;