@omnicross/contracts 0.1.10 → 0.2.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Sayo
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sayo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,15 +1,15 @@
1
- # @omnicross/contracts
2
-
3
- Dependency-light, host-agnostic contract types + runtime-value helpers shared across the omnicross packages: LLM config, completion types + message blocks, provider presets, thinking config, usage, and subscription/account-token types.
4
-
5
- Consumed via subpaths to keep the dependency graph tight, e.g. `@omnicross/contracts/llm-config`, `@omnicross/contracts/provider-presets`, `@omnicross/contracts/completion-types`.
6
-
7
- Part of the [omnicross](https://github.com/Dumoedss/omnicross) monorepo — see the root README for the full overview.
8
-
9
- ```bash
10
- npm install @omnicross/contracts
11
- ```
12
-
13
- ## License
14
-
15
- [MIT](LICENSE)
1
+ # @omnicross/contracts
2
+
3
+ Dependency-light, host-agnostic contract types + runtime-value helpers shared across the omnicross packages: LLM config, completion types + message blocks, provider presets, thinking config, usage, and subscription/account-token types.
4
+
5
+ Consumed via subpaths to keep the dependency graph tight, e.g. `@omnicross/contracts/llm-config`, `@omnicross/contracts/provider-presets`, `@omnicross/contracts/completion-types`.
6
+
7
+ Part of the [omnicross](https://github.com/Dumoedss/omnicross) monorepo — see the root README for the full overview.
8
+
9
+ ```bash
10
+ npm install @omnicross/contracts
11
+ ```
12
+
13
+ ## License
14
+
15
+ [MIT](LICENSE)
@@ -58,11 +58,18 @@ type LogFormat = 'text' | 'json';
58
58
  * - `format` — `text` (human-readable, legacy shape) | `json` (structured lines).
59
59
  * - `file` — OPTIONAL append-only file sink path. A PLAIN config value (NOT a
60
60
  * secret — never walked by the at-rest secret encryption).
61
+ * - `maxFileBytes` / `maxFiles` — file-sink rotation (default 8 MB x 5). Only
62
+ * meaningful alongside `file`. An uncapped daemon log is a slow
63
+ * disk-fill, so the cap is a default rather than an opt-in.
61
64
  */
62
65
  interface LoggingConfig {
63
66
  level?: LogLevel;
64
67
  format?: LogFormat;
65
68
  file?: string;
69
+ /** Size cap for one generation of the file sink, in bytes. Default 8 MB. */
70
+ maxFileBytes?: number;
71
+ /** Generations kept as `<file>.1` … `<file>.N`. Default 5. */
72
+ maxFiles?: number;
66
73
  }
67
74
 
68
75
  export { type HealthReport, type HealthStatus, type LogFormat, type LogLevel, type LoggingConfig, healthHttpStatus };
@@ -58,11 +58,18 @@ type LogFormat = 'text' | 'json';
58
58
  * - `format` — `text` (human-readable, legacy shape) | `json` (structured lines).
59
59
  * - `file` — OPTIONAL append-only file sink path. A PLAIN config value (NOT a
60
60
  * secret — never walked by the at-rest secret encryption).
61
+ * - `maxFileBytes` / `maxFiles` — file-sink rotation (default 8 MB x 5). Only
62
+ * meaningful alongside `file`. An uncapped daemon log is a slow
63
+ * disk-fill, so the cap is a default rather than an opt-in.
61
64
  */
62
65
  interface LoggingConfig {
63
66
  level?: LogLevel;
64
67
  format?: LogFormat;
65
68
  file?: string;
69
+ /** Size cap for one generation of the file sink, in bytes. Default 8 MB. */
70
+ maxFileBytes?: number;
71
+ /** Generations kept as `<file>.1` … `<file>.N`. Default 5. */
72
+ maxFiles?: number;
66
73
  }
67
74
 
68
75
  export { type HealthReport, type HealthStatus, type LogFormat, type LogLevel, type LoggingConfig, healthHttpStatus };
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/image-generation-types.ts
21
+ var image_generation_types_exports = {};
22
+ __export(image_generation_types_exports, {
23
+ IMAGE_CAPABILITY_UNAVAILABLE_REASONS: () => IMAGE_CAPABILITY_UNAVAILABLE_REASONS,
24
+ IMAGE_GENERATION_ERROR_CODES: () => IMAGE_GENERATION_ERROR_CODES
25
+ });
26
+ module.exports = __toCommonJS(image_generation_types_exports);
27
+ var IMAGE_GENERATION_ERROR_CODES = [
28
+ "invalid_image_request",
29
+ "unsupported_model",
30
+ "unsupported_capability",
31
+ "invalid_api_key",
32
+ "upstream_auth_required",
33
+ "image_reference_not_found",
34
+ "image_reference_expired",
35
+ "image_too_large",
36
+ "unsupported_image_type",
37
+ "moderation_blocked",
38
+ "upstream_rate_limited",
39
+ "subscription_usage_limit_reached",
40
+ "image_queue_full",
41
+ "image_queue_timeout",
42
+ "request_cancelled",
43
+ "upstream_protocol_changed",
44
+ "image_generation_failed",
45
+ "image_generation_timeout"
46
+ ];
47
+ var IMAGE_CAPABILITY_UNAVAILABLE_REASONS = [
48
+ "missing_evidence",
49
+ "stale_evidence",
50
+ "contradictory_evidence",
51
+ "adapter_unavailable",
52
+ "account_unverified",
53
+ "protocol_unverified",
54
+ "no_common_models",
55
+ "no_common_output_formats",
56
+ "no_common_quality_levels",
57
+ "no_common_moderation_modes"
58
+ ];
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ IMAGE_CAPABILITY_UNAVAILABLE_REASONS,
62
+ IMAGE_GENERATION_ERROR_CODES
63
+ });
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Provider-neutral image generation vocabulary.
3
+ *
4
+ * This module intentionally contains no HTTP, filesystem, credential, or
5
+ * ChatGPT/Codex private-wire types. Binary access is supplied by the core
6
+ * image-generation module through an asset type that extends
7
+ * {@link ImageInputAsset} / {@link ImageArtifactMetadata}.
8
+ */
9
+ declare const imageArtifactIdBrand: unique symbol;
10
+ declare const imageReferenceIdBrand: unique symbol;
11
+ declare const sensitiveProviderReferenceBrand: unique symbol;
12
+ /** A process-generated, non-provider artifact identifier. */
13
+ type ImageArtifactId = string & {
14
+ readonly [imageArtifactIdBrand]: true;
15
+ };
16
+ /** A random public reference ID scoped by the reference store to one tenant. */
17
+ type ImageReferenceId = string & {
18
+ readonly [imageReferenceIdBrand]: true;
19
+ };
20
+ /**
21
+ * An opaque upstream reference. It is content-sensitive and must never be
22
+ * logged, serialized into telemetry, or exposed as a public file/reference ID.
23
+ */
24
+ type SensitiveOpaqueImageReference = string & {
25
+ readonly [sensitiveProviderReferenceBrand]: 'sensitive-opaque-image-reference';
26
+ };
27
+ type ImageOutputFormat = 'png' | 'jpeg' | 'webp';
28
+ type ImageQuality = 'auto' | 'low' | 'medium' | 'high';
29
+ type ImageBackground = 'auto' | 'opaque' | 'transparent';
30
+ type ImageModeration = 'auto' | 'low';
31
+ type ImageAction = 'generate' | 'edit';
32
+ /** Truthful provider support for the numeric output_compression request. */
33
+ type ImageOutputCompressionCapability = {
34
+ readonly supported: false;
35
+ } | {
36
+ readonly supported: true;
37
+ readonly formats: readonly ImageOutputFormat[];
38
+ readonly min: number;
39
+ readonly max: number;
40
+ };
41
+ type ImageSize = {
42
+ readonly kind: 'auto';
43
+ } | {
44
+ readonly kind: 'pixels';
45
+ readonly width: number;
46
+ readonly height: number;
47
+ };
48
+ interface ImageRequestOptions {
49
+ readonly model: string;
50
+ readonly prompt: string;
51
+ readonly n: number;
52
+ readonly quality: ImageQuality;
53
+ readonly size: ImageSize;
54
+ readonly background: ImageBackground;
55
+ readonly outputFormat: ImageOutputFormat;
56
+ readonly outputCompression?: number;
57
+ readonly moderation: ImageModeration;
58
+ readonly stream: boolean;
59
+ readonly partialImages: number;
60
+ /** Optional irreversible digest created by the protocol frontend. */
61
+ readonly userFingerprint?: string;
62
+ }
63
+ /** Trusted metadata shared by every normalized edit asset. */
64
+ interface ImageInputAsset {
65
+ readonly artifactId: ImageArtifactId;
66
+ readonly mimeType: `image/${string}`;
67
+ readonly byteLength: number;
68
+ readonly width: number;
69
+ readonly height: number;
70
+ readonly hasAlpha?: boolean;
71
+ readonly sha256?: string;
72
+ }
73
+ interface NormalizedImageGenerateRequest extends ImageRequestOptions {
74
+ readonly action: 'generate';
75
+ }
76
+ interface NormalizedImageEditRequest<TAsset extends ImageInputAsset = ImageInputAsset> extends ImageRequestOptions {
77
+ readonly action: 'edit';
78
+ readonly images: readonly TAsset[];
79
+ readonly mask?: TAsset;
80
+ }
81
+ type NormalizedImageRequest<TAsset extends ImageInputAsset = ImageInputAsset> = NormalizedImageGenerateRequest | NormalizedImageEditRequest<TAsset>;
82
+ /** Metadata for a complete, independently decodable image artifact. */
83
+ interface ImageArtifactMetadata extends ImageInputAsset {
84
+ readonly independentlyDecodable: true;
85
+ }
86
+ interface ImageProviderOutput<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> {
87
+ readonly artifact: TArtifact;
88
+ /** Sensitive trusted-process state; callers must retain it behind a public ID. */
89
+ readonly providerReference?: SensitiveOpaqueImageReference;
90
+ readonly revisedPrompt?: string;
91
+ }
92
+ /** Image usage is truthful and optional; absent values are never defaulted to zero. */
93
+ interface ImageUsage {
94
+ readonly totalTokens?: number;
95
+ readonly inputTokens?: number;
96
+ readonly outputTokens?: number;
97
+ readonly inputTextTokens?: number;
98
+ readonly inputImageTokens?: number;
99
+ readonly outputImageTokens?: number;
100
+ readonly generatedImages?: number;
101
+ }
102
+ declare const IMAGE_GENERATION_ERROR_CODES: readonly ["invalid_image_request", "unsupported_model", "unsupported_capability", "invalid_api_key", "upstream_auth_required", "image_reference_not_found", "image_reference_expired", "image_too_large", "unsupported_image_type", "moderation_blocked", "upstream_rate_limited", "subscription_usage_limit_reached", "image_queue_full", "image_queue_timeout", "request_cancelled", "upstream_protocol_changed", "image_generation_failed", "image_generation_timeout"];
103
+ type ImageGenerationErrorCode = (typeof IMAGE_GENERATION_ERROR_CODES)[number];
104
+ type ImageRetrySafety = 'before_acceptance' | 'after_acceptance' | 'unknown';
105
+ type ImageModerationStage = 'input' | 'output';
106
+ interface ImageModerationDetails {
107
+ readonly stage?: ImageModerationStage;
108
+ /** Coarse, upstream-verified category names only; no scores are accepted. */
109
+ readonly categories?: readonly string[];
110
+ }
111
+ /** The only serializable error fields allowed across the image module boundary. */
112
+ interface ImageGenerationPublicError {
113
+ readonly type: 'image_generation_error' | 'image_generation_user_error';
114
+ readonly code: ImageGenerationErrorCode;
115
+ readonly message: string;
116
+ readonly param?: string;
117
+ readonly httpStatus?: number;
118
+ readonly retryAfterSeconds?: number;
119
+ readonly retrySafety?: ImageRetrySafety;
120
+ readonly moderationDetails?: ImageModerationDetails;
121
+ }
122
+ type ImageProviderAcceptedEvent = {
123
+ readonly type: 'accepted';
124
+ readonly acceptedAt: number;
125
+ };
126
+ type ImageProviderPartialImageEvent<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> = {
127
+ readonly type: 'partial_image';
128
+ readonly outputIndex: number;
129
+ readonly partialImageIndex: number;
130
+ readonly image: ImageProviderOutput<TArtifact>;
131
+ };
132
+ type ImageProviderCompletedEvent<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> = {
133
+ readonly type: 'completed';
134
+ readonly images: readonly ImageProviderOutput<TArtifact>[];
135
+ readonly usage?: ImageUsage;
136
+ /** Added by trusted retention, not by a private provider wire. */
137
+ readonly references?: readonly ImageReferenceMetadata[];
138
+ };
139
+ type ImageProviderFailedEvent = {
140
+ readonly type: 'failed';
141
+ readonly error: ImageGenerationPublicError;
142
+ };
143
+ type ImageProviderEvent<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> = ImageProviderAcceptedEvent | ImageProviderPartialImageEvent<TArtifact> | ImageProviderCompletedEvent<TArtifact> | ImageProviderFailedEvent;
144
+ type ImageCapabilityLayerKind = 'adapter' | 'account' | 'upstream';
145
+ /** Every property is independently evidenced; omission means unknown. */
146
+ interface ImageCapabilityValues {
147
+ readonly available: boolean;
148
+ readonly models: readonly string[];
149
+ readonly generate: boolean;
150
+ readonly edit: boolean;
151
+ readonly maskEdit: boolean;
152
+ readonly maxInputImages: number;
153
+ readonly maxOutputImages: number;
154
+ readonly streaming: boolean;
155
+ readonly maxPartialImages: number;
156
+ readonly transparentBackground: boolean;
157
+ readonly flexibleSizes: boolean;
158
+ readonly outputFormats: readonly ImageOutputFormat[];
159
+ readonly qualityLevels: readonly ImageQuality[];
160
+ readonly moderationModes: readonly ImageModeration[];
161
+ readonly outputCompression: ImageOutputCompressionCapability;
162
+ readonly responsesTool: boolean;
163
+ readonly multiTurnEdit: boolean;
164
+ readonly supportsFileId: boolean;
165
+ readonly supportsImageUrl: boolean;
166
+ }
167
+ /** Trusted evidence. Sources must be descriptive, never an account identifier. */
168
+ interface ImageCapabilityEvidenceLayer {
169
+ readonly kind: ImageCapabilityLayerKind;
170
+ readonly source: string;
171
+ readonly verifiedAt?: number;
172
+ readonly expiresAt?: number;
173
+ readonly values?: Partial<ImageCapabilityValues>;
174
+ }
175
+ declare const IMAGE_CAPABILITY_UNAVAILABLE_REASONS: readonly ["missing_evidence", "stale_evidence", "contradictory_evidence", "adapter_unavailable", "account_unverified", "protocol_unverified", "no_common_models", "no_common_output_formats", "no_common_quality_levels", "no_common_moderation_modes"];
176
+ type ImageCapabilityUnavailableReason = (typeof IMAGE_CAPABILITY_UNAVAILABLE_REASONS)[number];
177
+ /** Safe resolved snapshot. Raw account/protocol evidence never leaves the provider. */
178
+ interface ImageCapabilities extends ImageCapabilityValues {
179
+ readonly reason?: ImageCapabilityUnavailableReason;
180
+ readonly resolvedAt: number;
181
+ readonly oldestEvidenceAt?: number;
182
+ }
183
+ interface ImageReferenceMetadata {
184
+ readonly referenceId: ImageReferenceId;
185
+ readonly createdAt: number;
186
+ readonly expiresAt: number;
187
+ readonly mimeType: `image/${string}`;
188
+ readonly byteLength: number;
189
+ readonly width: number;
190
+ readonly height: number;
191
+ }
192
+
193
+ export { IMAGE_CAPABILITY_UNAVAILABLE_REASONS, IMAGE_GENERATION_ERROR_CODES, type ImageAction, type ImageArtifactId, type ImageArtifactMetadata, type ImageBackground, type ImageCapabilities, type ImageCapabilityEvidenceLayer, type ImageCapabilityLayerKind, type ImageCapabilityUnavailableReason, type ImageCapabilityValues, type ImageGenerationErrorCode, type ImageGenerationPublicError, type ImageInputAsset, type ImageModeration, type ImageModerationDetails, type ImageModerationStage, type ImageOutputCompressionCapability, type ImageOutputFormat, type ImageProviderAcceptedEvent, type ImageProviderCompletedEvent, type ImageProviderEvent, type ImageProviderFailedEvent, type ImageProviderOutput, type ImageProviderPartialImageEvent, type ImageQuality, type ImageReferenceId, type ImageReferenceMetadata, type ImageRequestOptions, type ImageRetrySafety, type ImageSize, type ImageUsage, type NormalizedImageEditRequest, type NormalizedImageGenerateRequest, type NormalizedImageRequest, type SensitiveOpaqueImageReference };
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Provider-neutral image generation vocabulary.
3
+ *
4
+ * This module intentionally contains no HTTP, filesystem, credential, or
5
+ * ChatGPT/Codex private-wire types. Binary access is supplied by the core
6
+ * image-generation module through an asset type that extends
7
+ * {@link ImageInputAsset} / {@link ImageArtifactMetadata}.
8
+ */
9
+ declare const imageArtifactIdBrand: unique symbol;
10
+ declare const imageReferenceIdBrand: unique symbol;
11
+ declare const sensitiveProviderReferenceBrand: unique symbol;
12
+ /** A process-generated, non-provider artifact identifier. */
13
+ type ImageArtifactId = string & {
14
+ readonly [imageArtifactIdBrand]: true;
15
+ };
16
+ /** A random public reference ID scoped by the reference store to one tenant. */
17
+ type ImageReferenceId = string & {
18
+ readonly [imageReferenceIdBrand]: true;
19
+ };
20
+ /**
21
+ * An opaque upstream reference. It is content-sensitive and must never be
22
+ * logged, serialized into telemetry, or exposed as a public file/reference ID.
23
+ */
24
+ type SensitiveOpaqueImageReference = string & {
25
+ readonly [sensitiveProviderReferenceBrand]: 'sensitive-opaque-image-reference';
26
+ };
27
+ type ImageOutputFormat = 'png' | 'jpeg' | 'webp';
28
+ type ImageQuality = 'auto' | 'low' | 'medium' | 'high';
29
+ type ImageBackground = 'auto' | 'opaque' | 'transparent';
30
+ type ImageModeration = 'auto' | 'low';
31
+ type ImageAction = 'generate' | 'edit';
32
+ /** Truthful provider support for the numeric output_compression request. */
33
+ type ImageOutputCompressionCapability = {
34
+ readonly supported: false;
35
+ } | {
36
+ readonly supported: true;
37
+ readonly formats: readonly ImageOutputFormat[];
38
+ readonly min: number;
39
+ readonly max: number;
40
+ };
41
+ type ImageSize = {
42
+ readonly kind: 'auto';
43
+ } | {
44
+ readonly kind: 'pixels';
45
+ readonly width: number;
46
+ readonly height: number;
47
+ };
48
+ interface ImageRequestOptions {
49
+ readonly model: string;
50
+ readonly prompt: string;
51
+ readonly n: number;
52
+ readonly quality: ImageQuality;
53
+ readonly size: ImageSize;
54
+ readonly background: ImageBackground;
55
+ readonly outputFormat: ImageOutputFormat;
56
+ readonly outputCompression?: number;
57
+ readonly moderation: ImageModeration;
58
+ readonly stream: boolean;
59
+ readonly partialImages: number;
60
+ /** Optional irreversible digest created by the protocol frontend. */
61
+ readonly userFingerprint?: string;
62
+ }
63
+ /** Trusted metadata shared by every normalized edit asset. */
64
+ interface ImageInputAsset {
65
+ readonly artifactId: ImageArtifactId;
66
+ readonly mimeType: `image/${string}`;
67
+ readonly byteLength: number;
68
+ readonly width: number;
69
+ readonly height: number;
70
+ readonly hasAlpha?: boolean;
71
+ readonly sha256?: string;
72
+ }
73
+ interface NormalizedImageGenerateRequest extends ImageRequestOptions {
74
+ readonly action: 'generate';
75
+ }
76
+ interface NormalizedImageEditRequest<TAsset extends ImageInputAsset = ImageInputAsset> extends ImageRequestOptions {
77
+ readonly action: 'edit';
78
+ readonly images: readonly TAsset[];
79
+ readonly mask?: TAsset;
80
+ }
81
+ type NormalizedImageRequest<TAsset extends ImageInputAsset = ImageInputAsset> = NormalizedImageGenerateRequest | NormalizedImageEditRequest<TAsset>;
82
+ /** Metadata for a complete, independently decodable image artifact. */
83
+ interface ImageArtifactMetadata extends ImageInputAsset {
84
+ readonly independentlyDecodable: true;
85
+ }
86
+ interface ImageProviderOutput<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> {
87
+ readonly artifact: TArtifact;
88
+ /** Sensitive trusted-process state; callers must retain it behind a public ID. */
89
+ readonly providerReference?: SensitiveOpaqueImageReference;
90
+ readonly revisedPrompt?: string;
91
+ }
92
+ /** Image usage is truthful and optional; absent values are never defaulted to zero. */
93
+ interface ImageUsage {
94
+ readonly totalTokens?: number;
95
+ readonly inputTokens?: number;
96
+ readonly outputTokens?: number;
97
+ readonly inputTextTokens?: number;
98
+ readonly inputImageTokens?: number;
99
+ readonly outputImageTokens?: number;
100
+ readonly generatedImages?: number;
101
+ }
102
+ declare const IMAGE_GENERATION_ERROR_CODES: readonly ["invalid_image_request", "unsupported_model", "unsupported_capability", "invalid_api_key", "upstream_auth_required", "image_reference_not_found", "image_reference_expired", "image_too_large", "unsupported_image_type", "moderation_blocked", "upstream_rate_limited", "subscription_usage_limit_reached", "image_queue_full", "image_queue_timeout", "request_cancelled", "upstream_protocol_changed", "image_generation_failed", "image_generation_timeout"];
103
+ type ImageGenerationErrorCode = (typeof IMAGE_GENERATION_ERROR_CODES)[number];
104
+ type ImageRetrySafety = 'before_acceptance' | 'after_acceptance' | 'unknown';
105
+ type ImageModerationStage = 'input' | 'output';
106
+ interface ImageModerationDetails {
107
+ readonly stage?: ImageModerationStage;
108
+ /** Coarse, upstream-verified category names only; no scores are accepted. */
109
+ readonly categories?: readonly string[];
110
+ }
111
+ /** The only serializable error fields allowed across the image module boundary. */
112
+ interface ImageGenerationPublicError {
113
+ readonly type: 'image_generation_error' | 'image_generation_user_error';
114
+ readonly code: ImageGenerationErrorCode;
115
+ readonly message: string;
116
+ readonly param?: string;
117
+ readonly httpStatus?: number;
118
+ readonly retryAfterSeconds?: number;
119
+ readonly retrySafety?: ImageRetrySafety;
120
+ readonly moderationDetails?: ImageModerationDetails;
121
+ }
122
+ type ImageProviderAcceptedEvent = {
123
+ readonly type: 'accepted';
124
+ readonly acceptedAt: number;
125
+ };
126
+ type ImageProviderPartialImageEvent<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> = {
127
+ readonly type: 'partial_image';
128
+ readonly outputIndex: number;
129
+ readonly partialImageIndex: number;
130
+ readonly image: ImageProviderOutput<TArtifact>;
131
+ };
132
+ type ImageProviderCompletedEvent<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> = {
133
+ readonly type: 'completed';
134
+ readonly images: readonly ImageProviderOutput<TArtifact>[];
135
+ readonly usage?: ImageUsage;
136
+ /** Added by trusted retention, not by a private provider wire. */
137
+ readonly references?: readonly ImageReferenceMetadata[];
138
+ };
139
+ type ImageProviderFailedEvent = {
140
+ readonly type: 'failed';
141
+ readonly error: ImageGenerationPublicError;
142
+ };
143
+ type ImageProviderEvent<TArtifact extends ImageArtifactMetadata = ImageArtifactMetadata> = ImageProviderAcceptedEvent | ImageProviderPartialImageEvent<TArtifact> | ImageProviderCompletedEvent<TArtifact> | ImageProviderFailedEvent;
144
+ type ImageCapabilityLayerKind = 'adapter' | 'account' | 'upstream';
145
+ /** Every property is independently evidenced; omission means unknown. */
146
+ interface ImageCapabilityValues {
147
+ readonly available: boolean;
148
+ readonly models: readonly string[];
149
+ readonly generate: boolean;
150
+ readonly edit: boolean;
151
+ readonly maskEdit: boolean;
152
+ readonly maxInputImages: number;
153
+ readonly maxOutputImages: number;
154
+ readonly streaming: boolean;
155
+ readonly maxPartialImages: number;
156
+ readonly transparentBackground: boolean;
157
+ readonly flexibleSizes: boolean;
158
+ readonly outputFormats: readonly ImageOutputFormat[];
159
+ readonly qualityLevels: readonly ImageQuality[];
160
+ readonly moderationModes: readonly ImageModeration[];
161
+ readonly outputCompression: ImageOutputCompressionCapability;
162
+ readonly responsesTool: boolean;
163
+ readonly multiTurnEdit: boolean;
164
+ readonly supportsFileId: boolean;
165
+ readonly supportsImageUrl: boolean;
166
+ }
167
+ /** Trusted evidence. Sources must be descriptive, never an account identifier. */
168
+ interface ImageCapabilityEvidenceLayer {
169
+ readonly kind: ImageCapabilityLayerKind;
170
+ readonly source: string;
171
+ readonly verifiedAt?: number;
172
+ readonly expiresAt?: number;
173
+ readonly values?: Partial<ImageCapabilityValues>;
174
+ }
175
+ declare const IMAGE_CAPABILITY_UNAVAILABLE_REASONS: readonly ["missing_evidence", "stale_evidence", "contradictory_evidence", "adapter_unavailable", "account_unverified", "protocol_unverified", "no_common_models", "no_common_output_formats", "no_common_quality_levels", "no_common_moderation_modes"];
176
+ type ImageCapabilityUnavailableReason = (typeof IMAGE_CAPABILITY_UNAVAILABLE_REASONS)[number];
177
+ /** Safe resolved snapshot. Raw account/protocol evidence never leaves the provider. */
178
+ interface ImageCapabilities extends ImageCapabilityValues {
179
+ readonly reason?: ImageCapabilityUnavailableReason;
180
+ readonly resolvedAt: number;
181
+ readonly oldestEvidenceAt?: number;
182
+ }
183
+ interface ImageReferenceMetadata {
184
+ readonly referenceId: ImageReferenceId;
185
+ readonly createdAt: number;
186
+ readonly expiresAt: number;
187
+ readonly mimeType: `image/${string}`;
188
+ readonly byteLength: number;
189
+ readonly width: number;
190
+ readonly height: number;
191
+ }
192
+
193
+ export { IMAGE_CAPABILITY_UNAVAILABLE_REASONS, IMAGE_GENERATION_ERROR_CODES, type ImageAction, type ImageArtifactId, type ImageArtifactMetadata, type ImageBackground, type ImageCapabilities, type ImageCapabilityEvidenceLayer, type ImageCapabilityLayerKind, type ImageCapabilityUnavailableReason, type ImageCapabilityValues, type ImageGenerationErrorCode, type ImageGenerationPublicError, type ImageInputAsset, type ImageModeration, type ImageModerationDetails, type ImageModerationStage, type ImageOutputCompressionCapability, type ImageOutputFormat, type ImageProviderAcceptedEvent, type ImageProviderCompletedEvent, type ImageProviderEvent, type ImageProviderFailedEvent, type ImageProviderOutput, type ImageProviderPartialImageEvent, type ImageQuality, type ImageReferenceId, type ImageReferenceMetadata, type ImageRequestOptions, type ImageRetrySafety, type ImageSize, type ImageUsage, type NormalizedImageEditRequest, type NormalizedImageGenerateRequest, type NormalizedImageRequest, type SensitiveOpaqueImageReference };
@@ -0,0 +1,37 @@
1
+ // src/image-generation-types.ts
2
+ var IMAGE_GENERATION_ERROR_CODES = [
3
+ "invalid_image_request",
4
+ "unsupported_model",
5
+ "unsupported_capability",
6
+ "invalid_api_key",
7
+ "upstream_auth_required",
8
+ "image_reference_not_found",
9
+ "image_reference_expired",
10
+ "image_too_large",
11
+ "unsupported_image_type",
12
+ "moderation_blocked",
13
+ "upstream_rate_limited",
14
+ "subscription_usage_limit_reached",
15
+ "image_queue_full",
16
+ "image_queue_timeout",
17
+ "request_cancelled",
18
+ "upstream_protocol_changed",
19
+ "image_generation_failed",
20
+ "image_generation_timeout"
21
+ ];
22
+ var IMAGE_CAPABILITY_UNAVAILABLE_REASONS = [
23
+ "missing_evidence",
24
+ "stale_evidence",
25
+ "contradictory_evidence",
26
+ "adapter_unavailable",
27
+ "account_unverified",
28
+ "protocol_unverified",
29
+ "no_common_models",
30
+ "no_common_output_formats",
31
+ "no_common_quality_levels",
32
+ "no_common_moderation_modes"
33
+ ];
34
+ export {
35
+ IMAGE_CAPABILITY_UNAVAILABLE_REASONS,
36
+ IMAGE_GENERATION_ERROR_CODES
37
+ };
package/dist/index.cjs CHANGED
@@ -34,6 +34,8 @@ __export(index_exports, {
34
34
  DEFAULT_VOUCHER_CONFIG: () => DEFAULT_VOUCHER_CONFIG,
35
35
  EFFORT_RATIO: () => EFFORT_RATIO,
36
36
  EXTENDED_CONTEXT_CAPABLE_MODELS: () => EXTENDED_CONTEXT_CAPABLE_MODELS,
37
+ IMAGE_CAPABILITY_UNAVAILABLE_REASONS: () => IMAGE_CAPABILITY_UNAVAILABLE_REASONS,
38
+ IMAGE_GENERATION_ERROR_CODES: () => IMAGE_GENERATION_ERROR_CODES,
37
39
  KNOWN_MODELS: () => KNOWN_MODELS,
38
40
  LEGACY_THINKING_TOKEN_LIMITS: () => LEGACY_THINKING_TOKEN_LIMITS,
39
41
  LLM_PROVIDER_PRESETS: () => LLM_PROVIDER_PRESETS,
@@ -372,6 +374,40 @@ function healthHttpStatus(status) {
372
374
  return status === "ok" ? 200 : 503;
373
375
  }
374
376
 
377
+ // src/image-generation-types.ts
378
+ var IMAGE_GENERATION_ERROR_CODES = [
379
+ "invalid_image_request",
380
+ "unsupported_model",
381
+ "unsupported_capability",
382
+ "invalid_api_key",
383
+ "upstream_auth_required",
384
+ "image_reference_not_found",
385
+ "image_reference_expired",
386
+ "image_too_large",
387
+ "unsupported_image_type",
388
+ "moderation_blocked",
389
+ "upstream_rate_limited",
390
+ "subscription_usage_limit_reached",
391
+ "image_queue_full",
392
+ "image_queue_timeout",
393
+ "request_cancelled",
394
+ "upstream_protocol_changed",
395
+ "image_generation_failed",
396
+ "image_generation_timeout"
397
+ ];
398
+ var IMAGE_CAPABILITY_UNAVAILABLE_REASONS = [
399
+ "missing_evidence",
400
+ "stale_evidence",
401
+ "contradictory_evidence",
402
+ "adapter_unavailable",
403
+ "account_unverified",
404
+ "protocol_unverified",
405
+ "no_common_models",
406
+ "no_common_output_formats",
407
+ "no_common_quality_levels",
408
+ "no_common_moderation_modes"
409
+ ];
410
+
375
411
  // src/mcp-types.ts
376
412
  var DEFAULT_MCP_SESSION_CONFIG = {
377
413
  mode: "auto",
@@ -2812,6 +2848,8 @@ function isLocalProvider(id) {
2812
2848
  DEFAULT_VOUCHER_CONFIG,
2813
2849
  EFFORT_RATIO,
2814
2850
  EXTENDED_CONTEXT_CAPABLE_MODELS,
2851
+ IMAGE_CAPABILITY_UNAVAILABLE_REASONS,
2852
+ IMAGE_GENERATION_ERROR_CODES,
2815
2853
  KNOWN_MODELS,
2816
2854
  LEGACY_THINKING_TOKEN_LIMITS,
2817
2855
  LLM_PROVIDER_PRESETS,
package/dist/index.d.cts CHANGED
@@ -9,6 +9,7 @@ export { R as ReasoningConfig, T as ThinkLevel, a as ThinkingContent } from './t
9
9
  export { ResolvedEndpoint, resolveProviderEndpoint } from './endpoint-resolver.cjs';
10
10
  export { EXTENDED_CONTEXT_CAPABLE_MODELS, isExtendedContextCapable } from './extended-context.cjs';
11
11
  export { HealthReport, HealthStatus, LogFormat, LogLevel, LoggingConfig, healthHttpStatus } from './health-logging-types.cjs';
12
+ export { IMAGE_CAPABILITY_UNAVAILABLE_REASONS, IMAGE_GENERATION_ERROR_CODES, ImageAction, ImageArtifactId, ImageArtifactMetadata, ImageBackground, ImageCapabilities, ImageCapabilityEvidenceLayer, ImageCapabilityLayerKind, ImageCapabilityUnavailableReason, ImageCapabilityValues, ImageGenerationErrorCode, ImageGenerationPublicError, ImageInputAsset, ImageModeration, ImageModerationDetails, ImageModerationStage, ImageOutputCompressionCapability, ImageOutputFormat, ImageProviderAcceptedEvent, ImageProviderCompletedEvent, ImageProviderEvent, ImageProviderFailedEvent, ImageProviderOutput, ImageProviderPartialImageEvent, ImageQuality, ImageReferenceId, ImageReferenceMetadata, ImageRequestOptions, ImageRetrySafety, ImageSize, ImageUsage, NormalizedImageEditRequest, NormalizedImageGenerateRequest, NormalizedImageRequest, SensitiveOpaqueImageReference } from './image-generation-types.cjs';
12
13
  export { A as API_MODE_IDS, a as AgentDefaultModels, b as ApiFormat, c as ApiKeyEntry, d as ApiMode, e as ApiModeId, C as ChatApiFormat, f as CodingPlanConfig, g as CompletionSettings, G as GlobalModelParameters, L as LLMProvider, M as ModelConfig, h as ModelGroup, i as ModelParameter, j as ModelRef, O as OpenRouterDataCollection, k as OpenRouterMaxPrice, l as OpenRouterProviderRouting, m as OpenRouterProviderSort, n as OpenRouterQuantization, P as PresetProviderTemplate, o as ProviderApiType, p as ProviderModelMapping, q as ProviderSearchConfig, r as ProviderTemplate, S as SearchCapability, T as TransformerConfig, s as TransformerEntry } from './llm-config-DeWNx1ig.cjs';
13
14
  export { DEFAULT_MCP_SESSION_CONFIG, MCPCallToolResponse, MCPTool, MCPToolResponseContent, McpActionResult, McpDiscoverResult, McpMode, McpServerConfig, McpServerInput, McpServerJsonInput, McpServerList, McpServerRecord, McpServerRemoveInput, McpServerScope, McpServerTransport, McpSessionConfig, McpTestResult, McpToolInfo } from './mcp-types.cjs';
14
15
  export { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBlock, ToolResultBlock, ToolUseBlock } from './message-blocks.cjs';
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { R as ReasoningConfig, T as ThinkLevel, a as ThinkingContent } from './t
9
9
  export { ResolvedEndpoint, resolveProviderEndpoint } from './endpoint-resolver.js';
10
10
  export { EXTENDED_CONTEXT_CAPABLE_MODELS, isExtendedContextCapable } from './extended-context.js';
11
11
  export { HealthReport, HealthStatus, LogFormat, LogLevel, LoggingConfig, healthHttpStatus } from './health-logging-types.js';
12
+ export { IMAGE_CAPABILITY_UNAVAILABLE_REASONS, IMAGE_GENERATION_ERROR_CODES, ImageAction, ImageArtifactId, ImageArtifactMetadata, ImageBackground, ImageCapabilities, ImageCapabilityEvidenceLayer, ImageCapabilityLayerKind, ImageCapabilityUnavailableReason, ImageCapabilityValues, ImageGenerationErrorCode, ImageGenerationPublicError, ImageInputAsset, ImageModeration, ImageModerationDetails, ImageModerationStage, ImageOutputCompressionCapability, ImageOutputFormat, ImageProviderAcceptedEvent, ImageProviderCompletedEvent, ImageProviderEvent, ImageProviderFailedEvent, ImageProviderOutput, ImageProviderPartialImageEvent, ImageQuality, ImageReferenceId, ImageReferenceMetadata, ImageRequestOptions, ImageRetrySafety, ImageSize, ImageUsage, NormalizedImageEditRequest, NormalizedImageGenerateRequest, NormalizedImageRequest, SensitiveOpaqueImageReference } from './image-generation-types.js';
12
13
  export { A as API_MODE_IDS, a as AgentDefaultModels, b as ApiFormat, c as ApiKeyEntry, d as ApiMode, e as ApiModeId, C as ChatApiFormat, f as CodingPlanConfig, g as CompletionSettings, G as GlobalModelParameters, L as LLMProvider, M as ModelConfig, h as ModelGroup, i as ModelParameter, j as ModelRef, O as OpenRouterDataCollection, k as OpenRouterMaxPrice, l as OpenRouterProviderRouting, m as OpenRouterProviderSort, n as OpenRouterQuantization, P as PresetProviderTemplate, o as ProviderApiType, p as ProviderModelMapping, q as ProviderSearchConfig, r as ProviderTemplate, S as SearchCapability, T as TransformerConfig, s as TransformerEntry } from './llm-config-CKOaFFdy.js';
13
14
  export { DEFAULT_MCP_SESSION_CONFIG, MCPCallToolResponse, MCPTool, MCPToolResponseContent, McpActionResult, McpDiscoverResult, McpMode, McpServerConfig, McpServerInput, McpServerJsonInput, McpServerList, McpServerRecord, McpServerRemoveInput, McpServerScope, McpServerTransport, McpSessionConfig, McpTestResult, McpToolInfo } from './mcp-types.js';
14
15
  export { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBlock, ToolResultBlock, ToolUseBlock } from './message-blocks.js';
package/dist/index.js CHANGED
@@ -293,6 +293,40 @@ function healthHttpStatus(status) {
293
293
  return status === "ok" ? 200 : 503;
294
294
  }
295
295
 
296
+ // src/image-generation-types.ts
297
+ var IMAGE_GENERATION_ERROR_CODES = [
298
+ "invalid_image_request",
299
+ "unsupported_model",
300
+ "unsupported_capability",
301
+ "invalid_api_key",
302
+ "upstream_auth_required",
303
+ "image_reference_not_found",
304
+ "image_reference_expired",
305
+ "image_too_large",
306
+ "unsupported_image_type",
307
+ "moderation_blocked",
308
+ "upstream_rate_limited",
309
+ "subscription_usage_limit_reached",
310
+ "image_queue_full",
311
+ "image_queue_timeout",
312
+ "request_cancelled",
313
+ "upstream_protocol_changed",
314
+ "image_generation_failed",
315
+ "image_generation_timeout"
316
+ ];
317
+ var IMAGE_CAPABILITY_UNAVAILABLE_REASONS = [
318
+ "missing_evidence",
319
+ "stale_evidence",
320
+ "contradictory_evidence",
321
+ "adapter_unavailable",
322
+ "account_unverified",
323
+ "protocol_unverified",
324
+ "no_common_models",
325
+ "no_common_output_formats",
326
+ "no_common_quality_levels",
327
+ "no_common_moderation_modes"
328
+ ];
329
+
296
330
  // src/mcp-types.ts
297
331
  var DEFAULT_MCP_SESSION_CONFIG = {
298
332
  mode: "auto",
@@ -2732,6 +2766,8 @@ export {
2732
2766
  DEFAULT_VOUCHER_CONFIG,
2733
2767
  EFFORT_RATIO,
2734
2768
  EXTENDED_CONTEXT_CAPABLE_MODELS,
2769
+ IMAGE_CAPABILITY_UNAVAILABLE_REASONS,
2770
+ IMAGE_GENERATION_ERROR_CODES,
2735
2771
  KNOWN_MODELS,
2736
2772
  LEGACY_THINKING_TOKEN_LIMITS,
2737
2773
  LLM_PROVIDER_PRESETS,
@@ -20,6 +20,8 @@ type UsageEngineOrigin =
20
20
  | 'claude-sdk-direct'
21
21
  /** Codex CLI run as a model client through the Responses-API ingress. */
22
22
  | 'codex-ingress'
23
+ /** Claude-family client run through the `/v1/messages` ingress (claude-api-transform-fidelity, R11). */
24
+ | 'anthropic-messages-ingress'
23
25
  /** Additional engine origins defined by the embedding host's own engines. */
24
26
  | (string & {});
25
27
  /**
@@ -20,6 +20,8 @@ type UsageEngineOrigin =
20
20
  | 'claude-sdk-direct'
21
21
  /** Codex CLI run as a model client through the Responses-API ingress. */
22
22
  | 'codex-ingress'
23
+ /** Claude-family client run through the `/v1/messages` ingress (claude-api-transform-fidelity, R11). */
24
+ | 'anthropic-messages-ingress'
23
25
  /** Additional engine origins defined by the embedding host's own engines. */
24
26
  | (string & {});
25
27
  /**
package/package.json CHANGED
@@ -1,156 +1,161 @@
1
- {
2
- "name": "@omnicross/contracts",
3
- "version": "0.1.10",
4
- "description": "Dependency-light, host-agnostic contract types + runtime-value helpers shared by the @omnicross/* packages.",
5
- "license": "MIT",
6
- "author": "Sayo (https://github.com/Dumoedss)",
7
- "homepage": "https://github.com/Dumoedss/omnicross#readme",
8
- "keywords": [
9
- "omnicross",
10
- "llm",
11
- "openai",
12
- "anthropic",
13
- "gemini",
14
- "types",
15
- "contracts"
16
- ],
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/Dumoedss/omnicross.git",
20
- "directory": "packages/contracts"
21
- },
22
- "publishConfig": {
23
- "access": "public"
24
- },
25
- "engines": {
26
- "node": ">=20"
27
- },
28
- "type": "module",
29
- "main": "dist/index.cjs",
30
- "module": "dist/index.js",
31
- "types": "dist/index.d.ts",
32
- "exports": {
33
- ".": {
34
- "types": "./dist/index.d.ts",
35
- "import": "./dist/index.js",
36
- "require": "./dist/index.cjs"
37
- },
38
- "./account-tokens-types": {
39
- "types": "./dist/account-tokens-types.d.ts",
40
- "import": "./dist/account-tokens-types.js",
41
- "require": "./dist/account-tokens-types.cjs"
42
- },
43
- "./audit-types": {
44
- "types": "./dist/audit-types.d.ts",
45
- "import": "./dist/audit-types.js",
46
- "require": "./dist/audit-types.cjs"
47
- },
48
- "./billing-types": {
49
- "types": "./dist/billing-types.d.ts",
50
- "import": "./dist/billing-types.js",
51
- "require": "./dist/billing-types.cjs"
52
- },
53
- "./canonical-models": {
54
- "types": "./dist/canonical-models.d.ts",
55
- "import": "./dist/canonical-models.js",
56
- "require": "./dist/canonical-models.cjs"
57
- },
58
- "./completion-types": {
59
- "types": "./dist/completion-types.d.ts",
60
- "import": "./dist/completion-types.js",
61
- "require": "./dist/completion-types.cjs"
62
- },
63
- "./endpoint-resolver": {
64
- "types": "./dist/endpoint-resolver.d.ts",
65
- "import": "./dist/endpoint-resolver.js",
66
- "require": "./dist/endpoint-resolver.cjs"
67
- },
68
- "./extended-context": {
69
- "types": "./dist/extended-context.d.ts",
70
- "import": "./dist/extended-context.js",
71
- "require": "./dist/extended-context.cjs"
72
- },
73
- "./health-logging-types": {
74
- "types": "./dist/health-logging-types.d.ts",
75
- "import": "./dist/health-logging-types.js",
76
- "require": "./dist/health-logging-types.cjs"
77
- },
78
- "./llm-config": {
79
- "types": "./dist/llm-config.d.ts",
80
- "import": "./dist/llm-config.js",
81
- "require": "./dist/llm-config.cjs"
82
- },
83
- "./mcp-types": {
84
- "types": "./dist/mcp-types.d.ts",
85
- "import": "./dist/mcp-types.js",
86
- "require": "./dist/mcp-types.cjs"
87
- },
88
- "./message-blocks": {
89
- "types": "./dist/message-blocks.d.ts",
90
- "import": "./dist/message-blocks.js",
91
- "require": "./dist/message-blocks.cjs"
92
- },
93
- "./pricing-types": {
94
- "types": "./dist/pricing-types.d.ts",
95
- "import": "./dist/pricing-types.js",
96
- "require": "./dist/pricing-types.cjs"
97
- },
98
- "./provider-presets": {
99
- "types": "./dist/provider-presets/index.d.ts",
100
- "import": "./dist/provider-presets/index.js",
101
- "require": "./dist/provider-presets/index.cjs"
102
- },
103
- "./subscription-model-catalog": {
104
- "types": "./dist/subscription-model-catalog.d.ts",
105
- "import": "./dist/subscription-model-catalog.js",
106
- "require": "./dist/subscription-model-catalog.cjs"
107
- },
108
- "./subscription-types": {
109
- "types": "./dist/subscription-types.d.ts",
110
- "import": "./dist/subscription-types.js",
111
- "require": "./dist/subscription-types.cjs"
112
- },
113
- "./thinking-config": {
114
- "types": "./dist/thinking-config.d.ts",
115
- "import": "./dist/thinking-config.js",
116
- "require": "./dist/thinking-config.cjs"
117
- },
118
- "./usage-stats-types": {
119
- "types": "./dist/usage-stats-types.d.ts",
120
- "import": "./dist/usage-stats-types.js",
121
- "require": "./dist/usage-stats-types.cjs"
122
- },
123
- "./usage-types": {
124
- "types": "./dist/usage-types.d.ts",
125
- "import": "./dist/usage-types.js",
126
- "require": "./dist/usage-types.cjs"
127
- },
128
- "./voucher-types": {
129
- "types": "./dist/voucher-types.d.ts",
130
- "import": "./dist/voucher-types.js",
131
- "require": "./dist/voucher-types.cjs"
132
- },
133
- "./webhook-types": {
134
- "types": "./dist/webhook-types.d.ts",
135
- "import": "./dist/webhook-types.js",
136
- "require": "./dist/webhook-types.cjs"
137
- },
138
- "./websearch-types": {
139
- "types": "./dist/websearch-types.d.ts",
140
- "import": "./dist/websearch-types.js",
141
- "require": "./dist/websearch-types.cjs"
142
- }
143
- },
144
- "files": [
145
- "dist",
146
- "LICENSE",
147
- "README.md"
148
- ],
149
- "scripts": {
150
- "build": "tsup",
151
- "typecheck": "tsc -p tsconfig.typecheck.json --noEmit"
152
- },
153
- "dependencies": {
154
- "zod": "^4.3.6"
155
- }
156
- }
1
+ {
2
+ "name": "@omnicross/contracts",
3
+ "version": "0.2.0",
4
+ "description": "Dependency-light, host-agnostic contract types + runtime-value helpers shared by the @omnicross/* packages.",
5
+ "license": "MIT",
6
+ "author": "Sayo (https://github.com/Dumoedss)",
7
+ "homepage": "https://github.com/Dumoedss/omnicross#readme",
8
+ "keywords": [
9
+ "omnicross",
10
+ "llm",
11
+ "openai",
12
+ "anthropic",
13
+ "gemini",
14
+ "types",
15
+ "contracts"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/DumoeDss/omnicross",
20
+ "directory": "packages/contracts"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "engines": {
26
+ "node": ">=20"
27
+ },
28
+ "type": "module",
29
+ "main": "dist/index.cjs",
30
+ "module": "dist/index.js",
31
+ "types": "dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "require": "./dist/index.cjs"
37
+ },
38
+ "./account-tokens-types": {
39
+ "types": "./dist/account-tokens-types.d.ts",
40
+ "import": "./dist/account-tokens-types.js",
41
+ "require": "./dist/account-tokens-types.cjs"
42
+ },
43
+ "./audit-types": {
44
+ "types": "./dist/audit-types.d.ts",
45
+ "import": "./dist/audit-types.js",
46
+ "require": "./dist/audit-types.cjs"
47
+ },
48
+ "./billing-types": {
49
+ "types": "./dist/billing-types.d.ts",
50
+ "import": "./dist/billing-types.js",
51
+ "require": "./dist/billing-types.cjs"
52
+ },
53
+ "./canonical-models": {
54
+ "types": "./dist/canonical-models.d.ts",
55
+ "import": "./dist/canonical-models.js",
56
+ "require": "./dist/canonical-models.cjs"
57
+ },
58
+ "./completion-types": {
59
+ "types": "./dist/completion-types.d.ts",
60
+ "import": "./dist/completion-types.js",
61
+ "require": "./dist/completion-types.cjs"
62
+ },
63
+ "./endpoint-resolver": {
64
+ "types": "./dist/endpoint-resolver.d.ts",
65
+ "import": "./dist/endpoint-resolver.js",
66
+ "require": "./dist/endpoint-resolver.cjs"
67
+ },
68
+ "./extended-context": {
69
+ "types": "./dist/extended-context.d.ts",
70
+ "import": "./dist/extended-context.js",
71
+ "require": "./dist/extended-context.cjs"
72
+ },
73
+ "./health-logging-types": {
74
+ "types": "./dist/health-logging-types.d.ts",
75
+ "import": "./dist/health-logging-types.js",
76
+ "require": "./dist/health-logging-types.cjs"
77
+ },
78
+ "./image-generation-types": {
79
+ "types": "./dist/image-generation-types.d.ts",
80
+ "import": "./dist/image-generation-types.js",
81
+ "require": "./dist/image-generation-types.cjs"
82
+ },
83
+ "./llm-config": {
84
+ "types": "./dist/llm-config.d.ts",
85
+ "import": "./dist/llm-config.js",
86
+ "require": "./dist/llm-config.cjs"
87
+ },
88
+ "./mcp-types": {
89
+ "types": "./dist/mcp-types.d.ts",
90
+ "import": "./dist/mcp-types.js",
91
+ "require": "./dist/mcp-types.cjs"
92
+ },
93
+ "./message-blocks": {
94
+ "types": "./dist/message-blocks.d.ts",
95
+ "import": "./dist/message-blocks.js",
96
+ "require": "./dist/message-blocks.cjs"
97
+ },
98
+ "./pricing-types": {
99
+ "types": "./dist/pricing-types.d.ts",
100
+ "import": "./dist/pricing-types.js",
101
+ "require": "./dist/pricing-types.cjs"
102
+ },
103
+ "./provider-presets": {
104
+ "types": "./dist/provider-presets/index.d.ts",
105
+ "import": "./dist/provider-presets/index.js",
106
+ "require": "./dist/provider-presets/index.cjs"
107
+ },
108
+ "./subscription-model-catalog": {
109
+ "types": "./dist/subscription-model-catalog.d.ts",
110
+ "import": "./dist/subscription-model-catalog.js",
111
+ "require": "./dist/subscription-model-catalog.cjs"
112
+ },
113
+ "./subscription-types": {
114
+ "types": "./dist/subscription-types.d.ts",
115
+ "import": "./dist/subscription-types.js",
116
+ "require": "./dist/subscription-types.cjs"
117
+ },
118
+ "./thinking-config": {
119
+ "types": "./dist/thinking-config.d.ts",
120
+ "import": "./dist/thinking-config.js",
121
+ "require": "./dist/thinking-config.cjs"
122
+ },
123
+ "./usage-stats-types": {
124
+ "types": "./dist/usage-stats-types.d.ts",
125
+ "import": "./dist/usage-stats-types.js",
126
+ "require": "./dist/usage-stats-types.cjs"
127
+ },
128
+ "./usage-types": {
129
+ "types": "./dist/usage-types.d.ts",
130
+ "import": "./dist/usage-types.js",
131
+ "require": "./dist/usage-types.cjs"
132
+ },
133
+ "./voucher-types": {
134
+ "types": "./dist/voucher-types.d.ts",
135
+ "import": "./dist/voucher-types.js",
136
+ "require": "./dist/voucher-types.cjs"
137
+ },
138
+ "./webhook-types": {
139
+ "types": "./dist/webhook-types.d.ts",
140
+ "import": "./dist/webhook-types.js",
141
+ "require": "./dist/webhook-types.cjs"
142
+ },
143
+ "./websearch-types": {
144
+ "types": "./dist/websearch-types.d.ts",
145
+ "import": "./dist/websearch-types.js",
146
+ "require": "./dist/websearch-types.cjs"
147
+ }
148
+ },
149
+ "files": [
150
+ "dist",
151
+ "LICENSE",
152
+ "README.md"
153
+ ],
154
+ "scripts": {
155
+ "build": "tsup",
156
+ "typecheck": "tsc -p tsconfig.typecheck.json --noEmit"
157
+ },
158
+ "dependencies": {
159
+ "zod": "^4.3.6"
160
+ }
161
+ }