@oh-my-pi/pi-ai 18.0.5 → 18.0.7

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/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.0.7] - 2026-08-26
6
+
7
+ ### Added
8
+
9
+ - Added application-level usage attribution for billing and usage reporting, with per-application aggregation and automatic client identification. Applications can set their label with `OMP_APP_NAME` (default: `omp`); update the broker before clients to support the new usage reports.
10
+
11
+ ### Fixed
12
+
13
+ - Fixed Anthropic Claude subscription OAuth requests being rejected by the upstream service ([#9801](https://github.com/can1357/oh-my-pi/pull/9801)).
14
+ - Fixed OpenAI-compatible streaming errors being reported as empty successful completions, enabling retries and model fallback when queue admission fails.
15
+ - Fixed multimodal tool results in OpenAI Responses requests so inline, remote, and OpenAI file-backed images are preserved correctly.
16
+ - Fixed resumed and forked Cursor sessions failing when their history came from a Responses-based provider such as Codex ([#9754](https://github.com/can1357/oh-my-pi/issues/9754)).
17
+ - Fixed Cursor `composer-2.5` selections using the Fast variant instead of the Standard tier ([#9012](https://github.com/can1357/oh-my-pi/issues/9012)).
18
+
19
+ ## [18.0.6] - 2026-08-26
20
+
21
+ ### Added
22
+
23
+ - Added the `backgroundIdleMs` option to customize how long background auth-broker activity remains active before automatically parking.
24
+
25
+ ### Fixed
26
+
27
+ - Fixed auth-broker background activity keeping processes alive unnecessarily, so unused broker-backed auth storage now parks automatically and no longer prevents CLI exit.
28
+
5
29
  ## [18.0.5] - 2026-08-25
6
30
 
7
31
  ### Breaking Changes
@@ -1,7 +1,7 @@
1
1
  import { type AuthCredential, type AuthCredentialStore, type DisabledCredentialSummary, type OAuthCredential, type StoredAuthCredential, type StoredCredentialBlock } from "../auth-storage.js";
2
2
  import type { OAuthCredentials } from "../registry/oauth/types.js";
3
3
  import type { Provider } from "../types.js";
4
- import type { ObservedUsageEntry, UsageReport } from "../usage.js";
4
+ import type { ClientUsageIdentity, ObservedUsageEntry, UsageReport } from "../usage.js";
5
5
  import { type AuthBrokerClient } from "./client.js";
6
6
  import type { SnapshotResponse } from "./types.js";
7
7
  /**
@@ -35,6 +35,14 @@ export interface RemoteAuthCredentialStoreOptions {
35
35
  accountPool?: AuthBrokerAccountPool;
36
36
  /** Flush cadence for batched observed-usage reports. Default 10s. */
37
37
  observedUsageFlushMs?: number;
38
+ /**
39
+ * Idle window after the last foreground store use before background
40
+ * snapshot sync (SSE stream / long-poll) disconnects and parks. A parked
41
+ * store holds no timers or sockets, so an unclosed store never keeps the
42
+ * process alive longer than one idle window. Sync resumes transparently on
43
+ * the next use. Default 20s.
44
+ */
45
+ backgroundIdleMs?: number;
38
46
  }
39
47
  export declare class RemoteAuthCredentialStore implements AuthCredentialStore {
40
48
  #private;
@@ -130,7 +138,10 @@ export declare class RemoteAuthCredentialStore implements AuthCredentialStore {
130
138
  * a flush. One `POST /v1/usage/observed` at most per flush interval; on
131
139
  * failure the batch is retained and retried with the next flush. A 404
132
140
  * (pre-endpoint broker) disables reporting for the life of this store.
141
+ *
142
+ * `client` overrides the reporting identity — the auth-gateway attributes
143
+ * each request to the originating install/app instead of the gateway host.
133
144
  */
134
- recordObservedUsage(entries: ObservedUsageEntry[]): void;
145
+ recordObservedUsage(entries: ObservedUsageEntry[], client?: ClientUsageIdentity): void;
135
146
  close(): void;
136
147
  }
@@ -1,4 +1,5 @@
1
1
  import type { Api, AssistantMessage, Model } from "../types.js";
2
+ import type { ClientUsageIdentity } from "../usage.js";
2
3
  export declare function json(status: number, body: unknown, headers?: Record<string, string>): Response;
3
4
  /**
4
5
  * Diagnostic response headers for translated inference requests, mirroring the
@@ -30,6 +31,19 @@ export declare function isAuthorized(req: Request, tokens: ReadonlySet<string>):
30
31
  * `handleFormatEndpoint`; parsers then read `options.headers`.
31
32
  */
32
33
  export declare function captureRequestHeaders(headers: Headers): Record<string, string>;
34
+ /**
35
+ * Resolve the usage-attribution identity for an inbound gateway request.
36
+ *
37
+ * pi-native omp clients send `x-omp-install-id` / `x-omp-hostname` /
38
+ * `x-omp-app` (see `providers/pi-native-client.ts`); any client may set them.
39
+ * Requests without an install id fall back to the gateway host's identity
40
+ * under the `gateway` app label, so unlabeled foreign-SDK traffic (llm-git,
41
+ * openai/anthropic SDKs) still lands in per-client burn tracking instead of
42
+ * vanishing. These headers are attribution-only — they are deliberately
43
+ * absent from {@link captureRequestHeaders}'s allow-list and never reach the
44
+ * upstream provider.
45
+ */
46
+ export declare function resolveClientIdentity(headers: Headers): ClientUsageIdentity;
33
47
  /**
34
48
  * Resolve a prompt-cache identity from inbound request body + headers.
35
49
  * Order of precedence (first wins):
@@ -1,7 +1,7 @@
1
1
  import type { ApiKeyResolver } from "./auth-retry.js";
2
2
  import type { OAuthAuthInfo, OAuthController, OAuthCredentials, OAuthProviderId } from "./registry/oauth/types.js";
3
3
  import type { Provider } from "./types.js";
4
- import type { ClientUsageReport, ClientUsageSummary, CredentialRankingStrategy, ObservedUsageEntry, UsageHistoryEntry, UsageHistoryQuery, UsageLogger, UsageProvider, UsageReport } from "./usage.js";
4
+ import type { ClientUsageIdentity, ClientUsageReport, ClientUsageSummary, CredentialRankingStrategy, ObservedUsageEntry, UsageHistoryEntry, UsageHistoryQuery, UsageLogger, UsageProvider, UsageReport } from "./usage.js";
5
5
  import { type CodexResetConsumeCode, type CodexResetCredit } from "./usage/openai-codex-reset.js";
6
6
  export { isSqliteBusyError, isSqliteCorruptionError, SqliteAuthCredentialStore, } from "./auth/sqlite-credential-store.js";
7
7
  export type ApiKeyCredential = {
@@ -317,8 +317,10 @@ export interface AuthCredentialStore {
317
317
  * Client hook: forward locally observed request usage. Remote broker stores
318
318
  * batch these to the broker so it can attribute token burn per install;
319
319
  * local stores omit it and observation is skipped.
320
+ * `client` overrides the reporting identity (gateway requests attribute to
321
+ * the originating client, not the gateway host).
320
322
  */
321
- recordObservedUsage?(entries: ObservedUsageEntry[]): void;
323
+ recordObservedUsage?(entries: ObservedUsageEntry[], client?: ClientUsageIdentity): void;
322
324
  /** Broker host: persist one client's observed-usage report. */
323
325
  recordClientUsage?(report: ClientUsageReport): void;
324
326
  /** Broker host: aggregate recorded per-client usage since a timestamp. */
@@ -915,6 +917,8 @@ export declare class AuthStorage {
915
917
  };
916
918
  costUsd?: number;
917
919
  at?: number;
920
+ /** Attribution override; defaults to this process's install identity. */
921
+ client?: ClientUsageIdentity;
918
922
  }): void;
919
923
  /** Broker host: persist one client's observed-usage report (per-install token burn). */
920
924
  recordClientUsage(report: ClientUsageReport): boolean;
@@ -8,9 +8,11 @@
8
8
  * provider module.
9
9
  */
10
10
  /** Claude runtime version bundled by the current Cowork desktop release. */
11
- export declare const claudeCodeVersion = "2.1.220";
11
+ export declare const claudeCodeVersion = "2.1.246";
12
+ /** `@anthropic-ai/sdk` version bundled by the current Cowork desktop release. */
13
+ export declare const claudeCodeSdkVersion = "0.112.1";
12
14
  /** User-Agent emitted by Cowork's `claude-desktop` inference entrypoint. */
13
- export declare const coworkUserAgent = "claude-cli/2.1.220 (external, claude-desktop)";
15
+ export declare const coworkUserAgent = "claude-cli/2.1.246 (external, claude-desktop)";
14
16
  /** Prefix used to isolate custom Anthropic OAuth tools from built-in tools. */
15
17
  export declare const claudeToolPrefix: string;
16
18
  /** Identity block prepended by Cowork's Claude runtime. */
@@ -0,0 +1,11 @@
1
+ /** Base64 payload and media type decoded from a data URI. */
2
+ export interface DecodedDataUri {
3
+ data: string;
4
+ mimeType: string;
5
+ }
6
+ /**
7
+ * Decodes base64 and percent-encoded `data:` URIs.
8
+ *
9
+ * Returns `undefined` for non-data URLs and data URIs without a comma separator.
10
+ */
11
+ export declare function decodeDataUri(url: string): DecodedDataUri | undefined;
@@ -9,27 +9,29 @@
9
9
  */
10
10
  import type { EasyInputMessage, ResponseCreateParams, ResponseFunctionToolCall, ResponseInputContent, ResponseInputItem, ResponseOutputMessage, ResponseReasoningItem, Tool as ResponsesTool } from "./openai-responses-wire.js";
11
11
  declare const inputImageBlockSchema: import("@oh-my-pi/omptype").FluentType<{
12
- detail?: "auto" | "high" | "low" | "original" | undefined;
13
- file_id?: string | undefined;
14
- image_url?: string | undefined;
12
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
13
+ file_id?: string | null | undefined;
14
+ image_url?: string | null | undefined;
15
15
  type: "input_image";
16
16
  }, {
17
- detail?: "auto" | "high" | "low" | "original" | undefined;
18
- file_id?: string | undefined;
19
- image_url?: string | undefined;
17
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
18
+ file_id?: string | null | undefined;
19
+ image_url?: string | null | undefined;
20
20
  type: "input_image";
21
21
  }>;
22
22
  declare const inputFileBlockSchema: import("@oh-my-pi/omptype").FluentType<{
23
- file_data?: string | undefined;
24
- file_id?: string | undefined;
25
- file_url?: string | undefined;
26
- filename?: string | undefined;
23
+ detail?: "high" | "low" | undefined;
24
+ file_data?: string | null | undefined;
25
+ file_id?: string | null | undefined;
26
+ file_url?: string | null | undefined;
27
+ filename?: string | null | undefined;
27
28
  type: "input_file";
28
29
  }, {
29
- file_data?: string | undefined;
30
- file_id?: string | undefined;
31
- file_url?: string | undefined;
32
- filename?: string | undefined;
30
+ detail?: "high" | "low" | undefined;
31
+ file_data?: string | null | undefined;
32
+ file_id?: string | null | undefined;
33
+ file_url?: string | null | undefined;
34
+ filename?: string | null | undefined;
33
35
  type: "input_file";
34
36
  }>;
35
37
  declare const outputRefusalSchema: import("@oh-my-pi/omptype").FluentType<{
@@ -54,11 +56,45 @@ declare const customToolCallItemSchema: import("@oh-my-pi/omptype").FluentType<{
54
56
  }>;
55
57
  declare const customToolCallOutputItemSchema: import("@oh-my-pi/omptype").FluentType<{
56
58
  call_id: string;
57
- output: string;
59
+ output: string | ({
60
+ text: string;
61
+ type: "input_text";
62
+ } | {
63
+ text: string;
64
+ type: "text";
65
+ } | {
66
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
67
+ file_id?: string | null | undefined;
68
+ image_url?: string | null | undefined;
69
+ type: "input_image";
70
+ } | {
71
+ text: string;
72
+ type: "output_text";
73
+ } | {
74
+ refusal: string;
75
+ type: "refusal";
76
+ })[];
58
77
  type: "custom_tool_call_output";
59
78
  }, {
60
79
  call_id: string;
61
- output: string;
80
+ output: string | ({
81
+ text: string;
82
+ type: "input_text";
83
+ } | {
84
+ text: string;
85
+ type: "text";
86
+ } | {
87
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
88
+ file_id?: string | null | undefined;
89
+ image_url?: string | null | undefined;
90
+ type: "input_image";
91
+ } | {
92
+ text: string;
93
+ type: "output_text";
94
+ } | {
95
+ refusal: string;
96
+ type: "refusal";
97
+ })[];
62
98
  type: "custom_tool_call_output";
63
99
  }>;
64
100
  declare const computerCallItemSchema: import("@oh-my-pi/omptype").FluentType<{
@@ -292,15 +328,16 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
292
328
  text: string;
293
329
  type: "text";
294
330
  } | {
295
- detail?: "auto" | "high" | "low" | "original" | undefined;
296
- file_id?: string | undefined;
297
- image_url?: string | undefined;
331
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
332
+ file_id?: string | null | undefined;
333
+ image_url?: string | null | undefined;
298
334
  type: "input_image";
299
335
  } | {
300
- file_data?: string | undefined;
301
- file_id?: string | undefined;
302
- file_url?: string | undefined;
303
- filename?: string | undefined;
336
+ detail?: "high" | "low" | undefined;
337
+ file_data?: string | null | undefined;
338
+ file_id?: string | null | undefined;
339
+ file_url?: string | null | undefined;
340
+ filename?: string | null | undefined;
304
341
  type: "input_file";
305
342
  })[] | undefined;
306
343
  role: "developer" | "user";
@@ -313,15 +350,16 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
313
350
  text: string;
314
351
  type: "text";
315
352
  } | {
316
- detail?: "auto" | "high" | "low" | "original" | undefined;
317
- file_id?: string | undefined;
318
- image_url?: string | undefined;
353
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
354
+ file_id?: string | null | undefined;
355
+ image_url?: string | null | undefined;
319
356
  type: "input_image";
320
357
  } | {
321
- file_data?: string | undefined;
322
- file_id?: string | undefined;
323
- file_url?: string | undefined;
324
- filename?: string | undefined;
358
+ detail?: "high" | "low" | undefined;
359
+ file_data?: string | null | undefined;
360
+ file_id?: string | null | undefined;
361
+ file_url?: string | null | undefined;
362
+ filename?: string | null | undefined;
325
363
  type: "input_file";
326
364
  })[] | undefined;
327
365
  role: "system";
@@ -362,8 +400,16 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
362
400
  } | {
363
401
  call_id: string;
364
402
  output?: string | ({
403
+ text: string;
404
+ type: "input_text";
405
+ } | {
365
406
  text: string;
366
407
  type: "text";
408
+ } | {
409
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
410
+ file_id?: string | null | undefined;
411
+ image_url?: string | null | undefined;
412
+ type: "input_image";
367
413
  } | {
368
414
  text: string;
369
415
  type: "output_text";
@@ -380,7 +426,24 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
380
426
  type: "custom_tool_call";
381
427
  } | {
382
428
  call_id: string;
383
- output: string;
429
+ output: string | ({
430
+ text: string;
431
+ type: "input_text";
432
+ } | {
433
+ text: string;
434
+ type: "text";
435
+ } | {
436
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
437
+ file_id?: string | null | undefined;
438
+ image_url?: string | null | undefined;
439
+ type: "input_image";
440
+ } | {
441
+ text: string;
442
+ type: "output_text";
443
+ } | {
444
+ refusal: string;
445
+ type: "refusal";
446
+ })[];
384
447
  type: "custom_tool_call_output";
385
448
  } | {
386
449
  action?: {
@@ -501,15 +564,16 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
501
564
  text: string;
502
565
  type: "text";
503
566
  } | {
504
- detail?: "auto" | "high" | "low" | "original" | undefined;
505
- file_id?: string | undefined;
506
- image_url?: string | undefined;
567
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
568
+ file_id?: string | null | undefined;
569
+ image_url?: string | null | undefined;
507
570
  type: "input_image";
508
571
  } | {
509
- file_data?: string | undefined;
510
- file_id?: string | undefined;
511
- file_url?: string | undefined;
512
- filename?: string | undefined;
572
+ detail?: "high" | "low" | undefined;
573
+ file_data?: string | null | undefined;
574
+ file_id?: string | null | undefined;
575
+ file_url?: string | null | undefined;
576
+ filename?: string | null | undefined;
513
577
  type: "input_file";
514
578
  })[] | undefined;
515
579
  role: "developer" | "user";
@@ -522,15 +586,16 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
522
586
  text: string;
523
587
  type: "text";
524
588
  } | {
525
- detail?: "auto" | "high" | "low" | "original" | undefined;
526
- file_id?: string | undefined;
527
- image_url?: string | undefined;
589
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
590
+ file_id?: string | null | undefined;
591
+ image_url?: string | null | undefined;
528
592
  type: "input_image";
529
593
  } | {
530
- file_data?: string | undefined;
531
- file_id?: string | undefined;
532
- file_url?: string | undefined;
533
- filename?: string | undefined;
594
+ detail?: "high" | "low" | undefined;
595
+ file_data?: string | null | undefined;
596
+ file_id?: string | null | undefined;
597
+ file_url?: string | null | undefined;
598
+ filename?: string | null | undefined;
534
599
  type: "input_file";
535
600
  })[] | undefined;
536
601
  role: "system";
@@ -571,8 +636,16 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
571
636
  } | {
572
637
  call_id: string;
573
638
  output?: string | ({
639
+ text: string;
640
+ type: "input_text";
641
+ } | {
574
642
  text: string;
575
643
  type: "text";
644
+ } | {
645
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
646
+ file_id?: string | null | undefined;
647
+ image_url?: string | null | undefined;
648
+ type: "input_image";
576
649
  } | {
577
650
  text: string;
578
651
  type: "output_text";
@@ -589,7 +662,24 @@ export declare const inputItemSchema: import("@oh-my-pi/omptype").FluentType<{
589
662
  type: "custom_tool_call";
590
663
  } | {
591
664
  call_id: string;
592
- output: string;
665
+ output: string | ({
666
+ text: string;
667
+ type: "input_text";
668
+ } | {
669
+ text: string;
670
+ type: "text";
671
+ } | {
672
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
673
+ file_id?: string | null | undefined;
674
+ image_url?: string | null | undefined;
675
+ type: "input_image";
676
+ } | {
677
+ text: string;
678
+ type: "output_text";
679
+ } | {
680
+ refusal: string;
681
+ type: "refusal";
682
+ })[];
593
683
  type: "custom_tool_call_output";
594
684
  } | {
595
685
  action?: {
@@ -781,15 +871,16 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
781
871
  text: string;
782
872
  type: "text";
783
873
  } | {
784
- detail?: "auto" | "high" | "low" | "original" | undefined;
785
- file_id?: string | undefined;
786
- image_url?: string | undefined;
874
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
875
+ file_id?: string | null | undefined;
876
+ image_url?: string | null | undefined;
787
877
  type: "input_image";
788
878
  } | {
789
- file_data?: string | undefined;
790
- file_id?: string | undefined;
791
- file_url?: string | undefined;
792
- filename?: string | undefined;
879
+ detail?: "high" | "low" | undefined;
880
+ file_data?: string | null | undefined;
881
+ file_id?: string | null | undefined;
882
+ file_url?: string | null | undefined;
883
+ filename?: string | null | undefined;
793
884
  type: "input_file";
794
885
  })[] | undefined;
795
886
  role: "developer" | "user";
@@ -802,15 +893,16 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
802
893
  text: string;
803
894
  type: "text";
804
895
  } | {
805
- detail?: "auto" | "high" | "low" | "original" | undefined;
806
- file_id?: string | undefined;
807
- image_url?: string | undefined;
896
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
897
+ file_id?: string | null | undefined;
898
+ image_url?: string | null | undefined;
808
899
  type: "input_image";
809
900
  } | {
810
- file_data?: string | undefined;
811
- file_id?: string | undefined;
812
- file_url?: string | undefined;
813
- filename?: string | undefined;
901
+ detail?: "high" | "low" | undefined;
902
+ file_data?: string | null | undefined;
903
+ file_id?: string | null | undefined;
904
+ file_url?: string | null | undefined;
905
+ filename?: string | null | undefined;
814
906
  type: "input_file";
815
907
  })[] | undefined;
816
908
  role: "system";
@@ -851,8 +943,16 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
851
943
  } | {
852
944
  call_id: string;
853
945
  output?: string | ({
946
+ text: string;
947
+ type: "input_text";
948
+ } | {
854
949
  text: string;
855
950
  type: "text";
951
+ } | {
952
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
953
+ file_id?: string | null | undefined;
954
+ image_url?: string | null | undefined;
955
+ type: "input_image";
856
956
  } | {
857
957
  text: string;
858
958
  type: "output_text";
@@ -869,7 +969,24 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
869
969
  type: "custom_tool_call";
870
970
  } | {
871
971
  call_id: string;
872
- output: string;
972
+ output: string | ({
973
+ text: string;
974
+ type: "input_text";
975
+ } | {
976
+ text: string;
977
+ type: "text";
978
+ } | {
979
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
980
+ file_id?: string | null | undefined;
981
+ image_url?: string | null | undefined;
982
+ type: "input_image";
983
+ } | {
984
+ text: string;
985
+ type: "output_text";
986
+ } | {
987
+ refusal: string;
988
+ type: "refusal";
989
+ })[];
873
990
  type: "custom_tool_call_output";
874
991
  } | {
875
992
  action?: {
@@ -1046,15 +1163,16 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
1046
1163
  text: string;
1047
1164
  type: "text";
1048
1165
  } | {
1049
- detail?: "auto" | "high" | "low" | "original" | undefined;
1050
- file_id?: string | undefined;
1051
- image_url?: string | undefined;
1166
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
1167
+ file_id?: string | null | undefined;
1168
+ image_url?: string | null | undefined;
1052
1169
  type: "input_image";
1053
1170
  } | {
1054
- file_data?: string | undefined;
1055
- file_id?: string | undefined;
1056
- file_url?: string | undefined;
1057
- filename?: string | undefined;
1171
+ detail?: "high" | "low" | undefined;
1172
+ file_data?: string | null | undefined;
1173
+ file_id?: string | null | undefined;
1174
+ file_url?: string | null | undefined;
1175
+ filename?: string | null | undefined;
1058
1176
  type: "input_file";
1059
1177
  })[] | undefined;
1060
1178
  role: "developer" | "user";
@@ -1067,15 +1185,16 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
1067
1185
  text: string;
1068
1186
  type: "text";
1069
1187
  } | {
1070
- detail?: "auto" | "high" | "low" | "original" | undefined;
1071
- file_id?: string | undefined;
1072
- image_url?: string | undefined;
1188
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
1189
+ file_id?: string | null | undefined;
1190
+ image_url?: string | null | undefined;
1073
1191
  type: "input_image";
1074
1192
  } | {
1075
- file_data?: string | undefined;
1076
- file_id?: string | undefined;
1077
- file_url?: string | undefined;
1078
- filename?: string | undefined;
1193
+ detail?: "high" | "low" | undefined;
1194
+ file_data?: string | null | undefined;
1195
+ file_id?: string | null | undefined;
1196
+ file_url?: string | null | undefined;
1197
+ filename?: string | null | undefined;
1079
1198
  type: "input_file";
1080
1199
  })[] | undefined;
1081
1200
  role: "system";
@@ -1116,8 +1235,16 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
1116
1235
  } | {
1117
1236
  call_id: string;
1118
1237
  output?: string | ({
1238
+ text: string;
1239
+ type: "input_text";
1240
+ } | {
1119
1241
  text: string;
1120
1242
  type: "text";
1243
+ } | {
1244
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
1245
+ file_id?: string | null | undefined;
1246
+ image_url?: string | null | undefined;
1247
+ type: "input_image";
1121
1248
  } | {
1122
1249
  text: string;
1123
1250
  type: "output_text";
@@ -1134,7 +1261,24 @@ export declare const openaiResponsesRequestSchema: import("@oh-my-pi/omptype").F
1134
1261
  type: "custom_tool_call";
1135
1262
  } | {
1136
1263
  call_id: string;
1137
- output: string;
1264
+ output: string | ({
1265
+ text: string;
1266
+ type: "input_text";
1267
+ } | {
1268
+ text: string;
1269
+ type: "text";
1270
+ } | {
1271
+ detail?: "auto" | "high" | "low" | "original" | null | undefined;
1272
+ file_id?: string | null | undefined;
1273
+ image_url?: string | null | undefined;
1274
+ type: "input_image";
1275
+ } | {
1276
+ text: string;
1277
+ type: "output_text";
1278
+ } | {
1279
+ refusal: string;
1280
+ type: "refusal";
1281
+ })[];
1138
1282
  type: "custom_tool_call_output";
1139
1283
  } | {
1140
1284
  action?: {
@@ -493,7 +493,25 @@ export interface BuildResponsesInputOptions<TApi extends Api> {
493
493
  export declare function escapeReplayedControlTokens(items: ResponseInput): ResponseInput;
494
494
  export declare function buildResponsesInput<TApi extends Api>(options: BuildResponsesInputOptions<TApi>): ResponseInput;
495
495
  export declare function convertResponsesAssistantMessage<TApi extends Api>(assistantMsg: AssistantMessage, model: Model<TApi>, msgIndex: number, knownCallIds: Set<string>, includeThinkingSignatures?: boolean, customCallIds?: Set<string>, preserveMessageIds?: boolean, supportsCustomToolCalls?: boolean, customToolWireNameMap?: ReadonlyMap<string, string>, computerCallIds?: Set<string>, requiresReasoningReplayForAllTurns?: boolean, requiresReasoningReplayForToolCalls?: boolean): ResponseInput;
496
- /** Appends one tool result while keeping consecutive outputs ahead of its synthetic image messages. */
496
+ /**
497
+ * Responses wire output for a tool result plus its text-only fallback.
498
+ *
499
+ * `output` preserves native image blocks for paired function/custom outputs.
500
+ * `outputText` feeds orphan and unsupported-computer fallback messages, which
501
+ * cannot carry the native output array.
502
+ */
503
+ export interface ResponsesToolResultOutputEncoding {
504
+ output: string | ResponseInputContent[];
505
+ outputText: string;
506
+ }
507
+ /**
508
+ * Encodes one canonical tool result for OpenAI Responses replay.
509
+ *
510
+ * Image-capable models receive an ordered native content array; text-only
511
+ * models and callers without images receive the compatible string form.
512
+ */
513
+ export declare function encodeResponsesToolResultOutput<TApi extends Api>(toolResult: ToolResultMessage, model: Model<TApi>, supportsImageDetailOriginal: boolean): ResponsesToolResultOutputEncoding;
514
+ /** Appends one Responses tool result. */
497
515
  export declare function appendResponsesToolResultMessages<TApi extends Api>(messages: ResponseInput, toolResult: ToolResultMessage, model: Model<TApi>, strictResponsesPairing: boolean, supportsImageDetailOriginal: boolean, knownCallIds: ReadonlySet<string>, customCallIds?: ReadonlySet<string>, supportsCustomToolCalls?: boolean, computerCallIds?: ReadonlySet<string>): void;
498
516
  /**
499
517
  * Per-block accumulation helpers shared by the two Responses decode loops —
@@ -165,10 +165,25 @@ export interface ClientUsageReport {
165
165
  installId: string;
166
166
  /** Human-readable machine name for display surfaces. */
167
167
  hostname?: string;
168
+ /** Application label for the process that burned the tokens (e.g. `omp`, `robomp`). */
169
+ app?: string;
168
170
  entries: ObservedUsageEntry[];
169
171
  }
172
+ /**
173
+ * Identity a client presents for usage attribution. Defaults to this
174
+ * process's install id / hostname / app label; the auth-gateway overrides it
175
+ * with the identity its caller sent so token burn lands on the originating
176
+ * machine and application instead of the gateway host.
177
+ */
178
+ export interface ClientUsageIdentity {
179
+ installId: string;
180
+ hostname?: string;
181
+ app?: string;
182
+ }
170
183
  /** Per-provider aggregate of one client's recorded usage. */
171
184
  export interface ClientProviderUsage {
185
+ /** Application label the usage was reported under; absent for legacy rows. */
186
+ app?: string;
172
187
  provider: string;
173
188
  requests: number;
174
189
  inputTokens: number;