@codex-app-sdk/backend 0.16.2 → 0.16.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/index.js CHANGED
@@ -5355,7 +5355,9 @@ var Ii = class {
5355
5355
  ...d === void 0 ? {} : { serviceTier: d },
5356
5356
  ...e.threadSource === void 0 ? {} : { threadSource: e.threadSource },
5357
5357
  serviceName: "codex_app_sdk"
5358
- }), h = Lt(m, i.models, i);
5358
+ });
5359
+ this.host.observeEmptyConversation(m.thread.id);
5360
+ let h = Lt(m, i.models, i);
5359
5361
  u && (await this.client.request("thread/settings/update", {
5360
5362
  threadId: m.thread.id,
5361
5363
  effort: u,
@@ -6732,6 +6734,16 @@ var ha = class {
6732
6734
  clear() {
6733
6735
  this.threads.clear();
6734
6736
  }
6737
+ observeEmptyConversation(e) {
6738
+ this.threads.has(e) || (this.thread(e).total = {
6739
+ totalTokens: 0,
6740
+ inputTokens: 0,
6741
+ cachedInputTokens: 0,
6742
+ cacheWriteInputTokens: 0,
6743
+ outputTokens: 0,
6744
+ reasoningOutputTokens: 0
6745
+ });
6746
+ }
6735
6747
  observe(e, t) {
6736
6748
  if (!("conversationId" in t)) return t;
6737
6749
  let n = t.conversationId;
@@ -6990,6 +7002,7 @@ var ba = class {
6990
7002
  ensureConnected: () => this.ensureConnected(),
6991
7003
  getSnapshot: () => this.getSnapshot(),
6992
7004
  getState: () => this.state,
7005
+ observeEmptyConversation: (e) => this.usage.observeEmptyConversation(e),
6993
7006
  patch: (e) => this.patch(e),
6994
7007
  patchRuntime: (e, t) => this.patchRuntime(e, t),
6995
7008
  requireRuntime: (e) => this.requireRuntime(e),