@x12i/openrouter-runtime 2.1.0 → 2.2.1
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/README.md +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _x12i_provider_metadata from '@x12i/provider-metadata';
|
|
2
2
|
import { MetadataPacker, MetadataTrimWarning } from '@x12i/provider-metadata';
|
|
3
|
+
export { METADATA_NORMALIZATION_MAP, NormalizedMetadataKey, canonicalMetadataKey, normalizeMetadata } from '@x12i/provider-metadata';
|
|
3
4
|
|
|
4
5
|
type ApiMode = "chat" | "responses" | "auto";
|
|
5
6
|
type ResolvedApiMode = "chat" | "responses";
|
|
@@ -534,7 +535,10 @@ interface PackedProviderRecord {
|
|
|
534
535
|
declare function toProviderMetadata(metadata: Record<string, unknown> | undefined, agentId: string | undefined, _limits: ProviderMetadataLimits, base: Record<string, unknown> | undefined): Record<string, string> | undefined;
|
|
535
536
|
/** Packs one record. A packer trims; otherwise an oversized record throws. */
|
|
536
537
|
declare function packProviderRecord(metadata: Record<string, unknown> | undefined, agentId: string | undefined, base: Record<string, unknown> | undefined, packer?: MetadataPacker): PackedProviderRecord;
|
|
537
|
-
/**
|
|
538
|
+
/**
|
|
539
|
+
* Restores the string map from the `m.0`, `m.1`, ... pairs stored on a provider log.
|
|
540
|
+
* Accepts the wire object or its JSON string (for example Cloudflare `cf-aig-metadata`).
|
|
541
|
+
*/
|
|
538
542
|
declare function decodeProviderMetadata(wire: unknown): Record<string, string>;
|
|
539
543
|
|
|
540
544
|
export { type AdvisorPolicy, type ApplyPatchPolicy, type CompiledOpenRouterRequest, type DatetimePolicy, type FusionPolicy, type ImageGenerationPolicy, OPENROUTER_METADATA_LIMITS, OpenRouterHttpError, type OpenRouterRuntime, type OpenRouterRuntimeOptions, type ProviderMetadataLimits, type RuntimeCallOptions, type RuntimeCitation, RuntimeConfigError, type RuntimeDefaults, type RuntimeError, type RuntimeFunctionToolDefinition, type RuntimeGeneratedImage, type RuntimeLogger, type RuntimeMessage, type RuntimePatchProposal, type RuntimePolicyViolation, type RuntimeRequest, type RuntimeResponse, type RuntimeServerToolsPolicy, type RuntimeStreamDoneEvent, type RuntimeStreamErrorEvent, type RuntimeStreamEvent, type RuntimeStreamEventType, type RuntimeStreamReasoningDeltaEvent, type RuntimeStreamStartEvent, type RuntimeStreamTextDeltaEvent, type RuntimeStreamToolCallDeltaEvent, type RuntimeStreamUsageEvent, type RuntimeStreamWarningEvent, type RuntimeToolExecutor, type RuntimeToolUsage, type RuntimeUsage, type RuntimeWarning, type ServerToolKey, type ServerToolUsage, type SubagentPolicy, type WebFetchPolicy, type WebSearchPolicy, buildOpenRouterServerTools, compileRuntimeRequest, createConsoleLogger, createOpenRouterRuntime, decodeProviderMetadata, isRuntimeLoggingEnabled, packProviderRecord, toProviderMetadata };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _x12i_provider_metadata from '@x12i/provider-metadata';
|
|
2
2
|
import { MetadataPacker, MetadataTrimWarning } from '@x12i/provider-metadata';
|
|
3
|
+
export { METADATA_NORMALIZATION_MAP, NormalizedMetadataKey, canonicalMetadataKey, normalizeMetadata } from '@x12i/provider-metadata';
|
|
3
4
|
|
|
4
5
|
type ApiMode = "chat" | "responses" | "auto";
|
|
5
6
|
type ResolvedApiMode = "chat" | "responses";
|
|
@@ -534,7 +535,10 @@ interface PackedProviderRecord {
|
|
|
534
535
|
declare function toProviderMetadata(metadata: Record<string, unknown> | undefined, agentId: string | undefined, _limits: ProviderMetadataLimits, base: Record<string, unknown> | undefined): Record<string, string> | undefined;
|
|
535
536
|
/** Packs one record. A packer trims; otherwise an oversized record throws. */
|
|
536
537
|
declare function packProviderRecord(metadata: Record<string, unknown> | undefined, agentId: string | undefined, base: Record<string, unknown> | undefined, packer?: MetadataPacker): PackedProviderRecord;
|
|
537
|
-
/**
|
|
538
|
+
/**
|
|
539
|
+
* Restores the string map from the `m.0`, `m.1`, ... pairs stored on a provider log.
|
|
540
|
+
* Accepts the wire object or its JSON string (for example Cloudflare `cf-aig-metadata`).
|
|
541
|
+
*/
|
|
538
542
|
declare function decodeProviderMetadata(wire: unknown): Record<string, string>;
|
|
539
543
|
|
|
540
544
|
export { type AdvisorPolicy, type ApplyPatchPolicy, type CompiledOpenRouterRequest, type DatetimePolicy, type FusionPolicy, type ImageGenerationPolicy, OPENROUTER_METADATA_LIMITS, OpenRouterHttpError, type OpenRouterRuntime, type OpenRouterRuntimeOptions, type ProviderMetadataLimits, type RuntimeCallOptions, type RuntimeCitation, RuntimeConfigError, type RuntimeDefaults, type RuntimeError, type RuntimeFunctionToolDefinition, type RuntimeGeneratedImage, type RuntimeLogger, type RuntimeMessage, type RuntimePatchProposal, type RuntimePolicyViolation, type RuntimeRequest, type RuntimeResponse, type RuntimeServerToolsPolicy, type RuntimeStreamDoneEvent, type RuntimeStreamErrorEvent, type RuntimeStreamEvent, type RuntimeStreamEventType, type RuntimeStreamReasoningDeltaEvent, type RuntimeStreamStartEvent, type RuntimeStreamTextDeltaEvent, type RuntimeStreamToolCallDeltaEvent, type RuntimeStreamUsageEvent, type RuntimeStreamWarningEvent, type RuntimeToolExecutor, type RuntimeToolUsage, type RuntimeUsage, type RuntimeWarning, type ServerToolKey, type ServerToolUsage, type SubagentPolicy, type WebFetchPolicy, type WebSearchPolicy, buildOpenRouterServerTools, compileRuntimeRequest, createConsoleLogger, createOpenRouterRuntime, decodeProviderMetadata, isRuntimeLoggingEnabled, packProviderRecord, toProviderMetadata };
|
package/dist/index.js
CHANGED
|
@@ -899,6 +899,11 @@ import {
|
|
|
899
899
|
packMetadata,
|
|
900
900
|
metadataTrimWarning
|
|
901
901
|
} from "@x12i/provider-metadata";
|
|
902
|
+
import {
|
|
903
|
+
METADATA_NORMALIZATION_MAP,
|
|
904
|
+
canonicalMetadataKey,
|
|
905
|
+
normalizeMetadata
|
|
906
|
+
} from "@x12i/provider-metadata";
|
|
902
907
|
var OPENROUTER_METADATA_LIMITS = {
|
|
903
908
|
maxPairs: 16,
|
|
904
909
|
maxKeyLength: 64,
|
|
@@ -1870,15 +1875,18 @@ function operatorHintFor(code) {
|
|
|
1870
1875
|
}
|
|
1871
1876
|
}
|
|
1872
1877
|
export {
|
|
1878
|
+
METADATA_NORMALIZATION_MAP,
|
|
1873
1879
|
OPENROUTER_METADATA_LIMITS,
|
|
1874
1880
|
OpenRouterHttpError,
|
|
1875
1881
|
RuntimeConfigError,
|
|
1876
1882
|
buildOpenRouterServerTools,
|
|
1883
|
+
canonicalMetadataKey,
|
|
1877
1884
|
compileRuntimeRequest,
|
|
1878
1885
|
createConsoleLogger,
|
|
1879
1886
|
createOpenRouterRuntime,
|
|
1880
1887
|
decodeProviderMetadata,
|
|
1881
1888
|
isRuntimeLoggingEnabled,
|
|
1889
|
+
normalizeMetadata,
|
|
1882
1890
|
packProviderRecord,
|
|
1883
1891
|
toProviderMetadata
|
|
1884
1892
|
};
|