@x12i/ai-tools 1.0.2
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 +214 -0
- package/dist/AiModelsCatalogClient-4RF5BCDL.cjs +9 -0
- package/dist/AiModelsCatalogClient-4RF5BCDL.cjs.map +1 -0
- package/dist/AiModelsCatalogClient-B-dNLXX0.d.ts +29 -0
- package/dist/AiModelsCatalogClient-CSVlKql5.d.cts +29 -0
- package/dist/AiModelsCatalogClient-NUF3CBLW.js +9 -0
- package/dist/AiModelsCatalogClient-NUF3CBLW.js.map +1 -0
- package/dist/aliases/index.cjs +11 -0
- package/dist/aliases/index.cjs.map +1 -0
- package/dist/aliases/index.d.cts +21 -0
- package/dist/aliases/index.d.ts +21 -0
- package/dist/aliases/index.js +11 -0
- package/dist/aliases/index.js.map +1 -0
- package/dist/catalox/index.cjs +21 -0
- package/dist/catalox/index.cjs.map +1 -0
- package/dist/catalox/index.d.cts +23 -0
- package/dist/catalox/index.d.ts +23 -0
- package/dist/catalox/index.js +21 -0
- package/dist/catalox/index.js.map +1 -0
- package/dist/chunk-2PYACSZ5.cjs +1 -0
- package/dist/chunk-2PYACSZ5.cjs.map +1 -0
- package/dist/chunk-3E67S427.cjs +1 -0
- package/dist/chunk-3E67S427.cjs.map +1 -0
- package/dist/chunk-4NAY6HRP.js +137 -0
- package/dist/chunk-4NAY6HRP.js.map +1 -0
- package/dist/chunk-5HNFAYTO.cjs +254 -0
- package/dist/chunk-5HNFAYTO.cjs.map +1 -0
- package/dist/chunk-6QGDZTGH.js +127 -0
- package/dist/chunk-6QGDZTGH.js.map +1 -0
- package/dist/chunk-7Q742NI3.cjs +106 -0
- package/dist/chunk-7Q742NI3.cjs.map +1 -0
- package/dist/chunk-AJEKEWWB.js +106 -0
- package/dist/chunk-AJEKEWWB.js.map +1 -0
- package/dist/chunk-AV6OE2YQ.cjs +127 -0
- package/dist/chunk-AV6OE2YQ.cjs.map +1 -0
- package/dist/chunk-COK34C6P.js +1 -0
- package/dist/chunk-COK34C6P.js.map +1 -0
- package/dist/chunk-DJ5SWJDY.js +729 -0
- package/dist/chunk-DJ5SWJDY.js.map +1 -0
- package/dist/chunk-F2F4UEFD.cjs +75 -0
- package/dist/chunk-F2F4UEFD.cjs.map +1 -0
- package/dist/chunk-G2G4KSC5.js +30 -0
- package/dist/chunk-G2G4KSC5.js.map +1 -0
- package/dist/chunk-HHNHWYTP.cjs +105 -0
- package/dist/chunk-HHNHWYTP.cjs.map +1 -0
- package/dist/chunk-HN6UAQAE.cjs +83 -0
- package/dist/chunk-HN6UAQAE.cjs.map +1 -0
- package/dist/chunk-KHODXGPV.js +1 -0
- package/dist/chunk-KHODXGPV.js.map +1 -0
- package/dist/chunk-KQOALKKX.js +75 -0
- package/dist/chunk-KQOALKKX.js.map +1 -0
- package/dist/chunk-LYOU7CA2.cjs +30 -0
- package/dist/chunk-LYOU7CA2.cjs.map +1 -0
- package/dist/chunk-ML2FRR4L.js +105 -0
- package/dist/chunk-ML2FRR4L.js.map +1 -0
- package/dist/chunk-MLRHYOCD.js +160 -0
- package/dist/chunk-MLRHYOCD.js.map +1 -0
- package/dist/chunk-O2A6OVEH.js +240 -0
- package/dist/chunk-O2A6OVEH.js.map +1 -0
- package/dist/chunk-ONA73BU6.cjs +160 -0
- package/dist/chunk-ONA73BU6.cjs.map +1 -0
- package/dist/chunk-QCRLKVB3.cjs +137 -0
- package/dist/chunk-QCRLKVB3.cjs.map +1 -0
- package/dist/chunk-QWAX7VQO.cjs +240 -0
- package/dist/chunk-QWAX7VQO.cjs.map +1 -0
- package/dist/chunk-TF4L2NEC.cjs +729 -0
- package/dist/chunk-TF4L2NEC.cjs.map +1 -0
- package/dist/chunk-XRBZQQQU.js +254 -0
- package/dist/chunk-XRBZQQQU.js.map +1 -0
- package/dist/chunk-YHO57D2V.js +83 -0
- package/dist/chunk-YHO57D2V.js.map +1 -0
- package/dist/cli/index.cjs +403 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +403 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cost/index.cjs +7 -0
- package/dist/cost/index.cjs.map +1 -0
- package/dist/cost/index.d.cts +52 -0
- package/dist/cost/index.d.ts +52 -0
- package/dist/cost/index.js +7 -0
- package/dist/cost/index.js.map +1 -0
- package/dist/index.cjs +104 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +58 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/modelNameResolver-Bn8QnkSj.d.ts +80 -0
- package/dist/modelNameResolver-bZD-eBSJ.d.cts +80 -0
- package/dist/models/index.cjs +33 -0
- package/dist/models/index.cjs.map +1 -0
- package/dist/models/index.d.cts +75 -0
- package/dist/models/index.d.ts +75 -0
- package/dist/models/index.js +33 -0
- package/dist/models/index.js.map +1 -0
- package/dist/sync/index.cjs +38 -0
- package/dist/sync/index.cjs.map +1 -0
- package/dist/sync/index.d.cts +12 -0
- package/dist/sync/index.d.ts +12 -0
- package/dist/sync/index.js +38 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/toolbox/index.cjs +7 -0
- package/dist/toolbox/index.cjs.map +1 -0
- package/dist/toolbox/index.d.cts +72 -0
- package/dist/toolbox/index.d.ts +72 -0
- package/dist/toolbox/index.js +7 -0
- package/dist/toolbox/index.js.map +1 -0
- package/dist/types-DdGB3YaA.d.cts +278 -0
- package/dist/types-DdGB3YaA.d.ts +278 -0
- package/package.json +115 -0
- package/schemas/aliases.json +28 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/** OpenRouter Models API — https://openrouter.ai/api/v1/models */
|
|
2
|
+
type OpenRouterOutputModality = "text" | "image" | "audio" | "embeddings" | "video" | "speech" | "transcription" | "all";
|
|
3
|
+
type OpenRouterModelsQuery = {
|
|
4
|
+
/** Comma-separated or "all" — default on our sync is "all". */
|
|
5
|
+
output_modalities?: string;
|
|
6
|
+
supported_parameters?: string;
|
|
7
|
+
};
|
|
8
|
+
type OpenRouterPricingApi = {
|
|
9
|
+
prompt: string;
|
|
10
|
+
completion: string;
|
|
11
|
+
request: string;
|
|
12
|
+
image: string;
|
|
13
|
+
web_search?: string;
|
|
14
|
+
internal_reasoning?: string;
|
|
15
|
+
input_cache_read?: string;
|
|
16
|
+
input_cache_write?: string;
|
|
17
|
+
};
|
|
18
|
+
type OpenRouterArchitectureApi = {
|
|
19
|
+
modality?: string;
|
|
20
|
+
input_modalities: string[];
|
|
21
|
+
output_modalities: string[];
|
|
22
|
+
tokenizer: string;
|
|
23
|
+
instruct_type: string | null;
|
|
24
|
+
};
|
|
25
|
+
type OpenRouterTopProviderApi = {
|
|
26
|
+
context_length: number;
|
|
27
|
+
max_completion_tokens: number | null;
|
|
28
|
+
is_moderated: boolean;
|
|
29
|
+
};
|
|
30
|
+
type OpenRouterDefaultParametersApi = {
|
|
31
|
+
temperature?: number | null;
|
|
32
|
+
top_p?: number | null;
|
|
33
|
+
top_k?: number | null;
|
|
34
|
+
frequency_penalty?: number | null;
|
|
35
|
+
presence_penalty?: number | null;
|
|
36
|
+
repetition_penalty?: number | null;
|
|
37
|
+
};
|
|
38
|
+
type OpenRouterModelApi = {
|
|
39
|
+
id: string;
|
|
40
|
+
canonical_slug: string;
|
|
41
|
+
hugging_face_id?: string | null;
|
|
42
|
+
name: string;
|
|
43
|
+
created: number;
|
|
44
|
+
description: string;
|
|
45
|
+
context_length: number;
|
|
46
|
+
architecture: OpenRouterArchitectureApi;
|
|
47
|
+
pricing: OpenRouterPricingApi;
|
|
48
|
+
top_provider: OpenRouterTopProviderApi;
|
|
49
|
+
per_request_limits: unknown | null;
|
|
50
|
+
supported_parameters: string[];
|
|
51
|
+
default_parameters: OpenRouterDefaultParametersApi | null;
|
|
52
|
+
supported_voices?: unknown | null;
|
|
53
|
+
knowledge_cutoff?: string | null;
|
|
54
|
+
expiration_date?: string | null;
|
|
55
|
+
links?: {
|
|
56
|
+
details?: string;
|
|
57
|
+
} | null;
|
|
58
|
+
};
|
|
59
|
+
type OpenRouterModelsResponse = {
|
|
60
|
+
data: OpenRouterModelApi[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type AiModelPricing = {
|
|
64
|
+
promptUsdPerToken: number;
|
|
65
|
+
completionUsdPerToken: number;
|
|
66
|
+
imageUsdPerUnit: number;
|
|
67
|
+
requestUsdPerRequest: number;
|
|
68
|
+
cacheReadUsdPerToken?: number;
|
|
69
|
+
cacheWriteUsdPerToken?: number;
|
|
70
|
+
reasoningUsdPerToken?: number;
|
|
71
|
+
webSearchUsdPerRequest?: number;
|
|
72
|
+
openRouterMarkupUsdPerInputToken?: number;
|
|
73
|
+
openRouterMarkupUsdPerOutputToken?: number;
|
|
74
|
+
pricedAt: string;
|
|
75
|
+
source: "openrouter" | "direct" | "manual";
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Canonical catalog record — mirrors OpenRouter Models API fields plus normalized pricing.
|
|
79
|
+
* Stored as-is in Catalox `data`; scalar fields duplicated in `indexed` for queries.
|
|
80
|
+
*/
|
|
81
|
+
type AiModelRecord = {
|
|
82
|
+
modelId: string;
|
|
83
|
+
name: string;
|
|
84
|
+
providerId: string;
|
|
85
|
+
canonicalSlug: string;
|
|
86
|
+
status: "active" | "deprecated" | "unknown";
|
|
87
|
+
description: string;
|
|
88
|
+
created: number;
|
|
89
|
+
expirationDate: string | null;
|
|
90
|
+
contextLength: number;
|
|
91
|
+
maxCompletionTokens: number | null;
|
|
92
|
+
isModerated: boolean;
|
|
93
|
+
modality: string;
|
|
94
|
+
inputModalities: string[];
|
|
95
|
+
outputModalities: string[];
|
|
96
|
+
tokenizer: string;
|
|
97
|
+
instructType: string | null;
|
|
98
|
+
supportedParameters: string[];
|
|
99
|
+
defaultParameters: OpenRouterDefaultParametersApi | null;
|
|
100
|
+
perRequestLimits: unknown | null;
|
|
101
|
+
pricing: AiModelPricing;
|
|
102
|
+
/** Raw OpenRouter pricing strings (USD per token/request/unit). */
|
|
103
|
+
openRouterPricing: OpenRouterPricingApi;
|
|
104
|
+
architecture: OpenRouterArchitectureApi;
|
|
105
|
+
topProvider: OpenRouterTopProviderApi;
|
|
106
|
+
/** Full OpenRouter API object — complete mirror for forward compatibility. */
|
|
107
|
+
openRouter: OpenRouterModelApi;
|
|
108
|
+
aliases: string[];
|
|
109
|
+
availableOnOpenRouter: boolean;
|
|
110
|
+
supportsStreaming: boolean;
|
|
111
|
+
supportsTools: boolean;
|
|
112
|
+
/** Exposes reasoning/thinking tokens (OpenRouter `reasoning` param and/or `internal_reasoning` pricing). */
|
|
113
|
+
supportsReasoning: boolean;
|
|
114
|
+
primaryOutputModality: string;
|
|
115
|
+
syncedAt: string;
|
|
116
|
+
syncSource: "openrouter" | "manual";
|
|
117
|
+
};
|
|
118
|
+
type ModelListFilters = {
|
|
119
|
+
providerId?: string;
|
|
120
|
+
status?: AiModelRecord["status"];
|
|
121
|
+
outputModality?: string;
|
|
122
|
+
inputModality?: string;
|
|
123
|
+
supportedParameter?: string;
|
|
124
|
+
supportsTools?: boolean;
|
|
125
|
+
supportsReasoning?: boolean;
|
|
126
|
+
search?: string;
|
|
127
|
+
limit?: number;
|
|
128
|
+
offset?: number;
|
|
129
|
+
};
|
|
130
|
+
type ModelListResult = {
|
|
131
|
+
models: AiModelRecord[];
|
|
132
|
+
total: number;
|
|
133
|
+
limit: number;
|
|
134
|
+
offset: number;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
type AliasEntry = {
|
|
138
|
+
modelId: string;
|
|
139
|
+
provider: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
tags?: string[];
|
|
142
|
+
addedAt: string;
|
|
143
|
+
updatedAt: string;
|
|
144
|
+
};
|
|
145
|
+
type AliasFileSchema = {
|
|
146
|
+
$schema?: string;
|
|
147
|
+
version: 1;
|
|
148
|
+
updatedAt: string;
|
|
149
|
+
aliases: Record<string, AliasEntry>;
|
|
150
|
+
};
|
|
151
|
+
type ResolvedModelRef = {
|
|
152
|
+
alias: string;
|
|
153
|
+
entry: AliasEntry;
|
|
154
|
+
modelRecord: AiModelRecord | null;
|
|
155
|
+
modelId: string;
|
|
156
|
+
provider: string;
|
|
157
|
+
name: string;
|
|
158
|
+
};
|
|
159
|
+
type AliasValidationReport = {
|
|
160
|
+
total: number;
|
|
161
|
+
ok: number;
|
|
162
|
+
unknown: number;
|
|
163
|
+
broken: number;
|
|
164
|
+
entries: Array<{
|
|
165
|
+
name: string;
|
|
166
|
+
status: "ok" | "unknown" | "broken";
|
|
167
|
+
modelId: string;
|
|
168
|
+
resolvedName?: string;
|
|
169
|
+
issue?: string;
|
|
170
|
+
}>;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
type AliasRegistryOptions = {
|
|
174
|
+
aliasesPath?: string;
|
|
175
|
+
};
|
|
176
|
+
declare class AliasRegistry {
|
|
177
|
+
private readonly aliasesPath;
|
|
178
|
+
constructor(options?: AliasRegistryOptions);
|
|
179
|
+
get path(): string;
|
|
180
|
+
exists(): boolean;
|
|
181
|
+
init(): void;
|
|
182
|
+
load(): AliasFileSchema;
|
|
183
|
+
get(aliasName: string): AliasEntry | null;
|
|
184
|
+
list(filter?: {
|
|
185
|
+
tag?: string;
|
|
186
|
+
}): Array<{
|
|
187
|
+
name: string;
|
|
188
|
+
} & AliasEntry>;
|
|
189
|
+
set(aliasName: string, entry: Omit<AliasEntry, "addedAt" | "updatedAt">): AliasEntry;
|
|
190
|
+
remove(aliasName: string): boolean;
|
|
191
|
+
rename(from: string, to: string, options?: {
|
|
192
|
+
force?: boolean;
|
|
193
|
+
}): void;
|
|
194
|
+
private writeFile;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Env naming for vendor direct API keys: `{VENDOR}_API_KEY`
|
|
199
|
+
* where VENDOR is the provider id in UPPER_SNAKE (hyphens → underscores).
|
|
200
|
+
*
|
|
201
|
+
* Examples: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `META_LLAMA_API_KEY`, `X_AI_API_KEY`
|
|
202
|
+
*/
|
|
203
|
+
declare function providerIdToEnvKeyPrefix(providerId: string): string;
|
|
204
|
+
declare function vendorApiKeyEnvName(providerId: string): string;
|
|
205
|
+
type OpenRouterRoutingConfig = {
|
|
206
|
+
/** OPENROUTER_API_KEY is set and non-empty */
|
|
207
|
+
hasOpenRouterKey: boolean;
|
|
208
|
+
/** USE_OPENROUTER=true or USE_OPENROUTER=1 */
|
|
209
|
+
useOpenRouterExplicit: boolean;
|
|
210
|
+
/** Read `{PROVIDER}_API_KEY` for a catalog provider id */
|
|
211
|
+
getVendorApiKey(providerId: string): string | undefined;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Load routing hints from process env and optional `.env` (via @x12/env).
|
|
215
|
+
*/
|
|
216
|
+
declare function loadOpenRouterRoutingEnv(env?: Record<string, string | undefined>): OpenRouterRoutingConfig;
|
|
217
|
+
/**
|
|
218
|
+
* Default route via OpenRouter when:
|
|
219
|
+
* 1. OPENROUTER_API_KEY is set AND USE_OPENROUTER=true|1, or
|
|
220
|
+
* 2. OPENROUTER_API_KEY is set AND the vendor's `{VENDOR}_API_KEY` is missing.
|
|
221
|
+
*/
|
|
222
|
+
declare function shouldDefaultRouteViaOpenRouter(providerId: string | undefined, config: OpenRouterRoutingConfig): boolean;
|
|
223
|
+
|
|
224
|
+
type ModelResolutionInput = {
|
|
225
|
+
/** Provider hint (openrouter, openai, anthropic, …). May be omitted. */
|
|
226
|
+
provider?: string;
|
|
227
|
+
/** Model id, alias, shorthand, or partial name. Required. */
|
|
228
|
+
model: string;
|
|
229
|
+
};
|
|
230
|
+
type ResolutionStrategy = "alias-registry" | "alias-as-provider-correction" | "exact-match" | "catalog-alias-match" | "canonical-slug-match" | "provider-prefix-injection" | "cross-provider-correction" | "version-suffix-strip" | "date-suffix-strip" | "shorthand-expansion" | "partial-name-match" | "local-provider-passthrough";
|
|
231
|
+
type ModelResolutionSuccess = {
|
|
232
|
+
found: true;
|
|
233
|
+
modelId: string;
|
|
234
|
+
record: AiModelRecord | null;
|
|
235
|
+
routedViaOpenRouter: boolean;
|
|
236
|
+
confidence: number;
|
|
237
|
+
resolvedVia: ResolutionStrategy[];
|
|
238
|
+
resolvedReason: string;
|
|
239
|
+
normalisedInput: string;
|
|
240
|
+
};
|
|
241
|
+
type ModelResolutionNotFound = {
|
|
242
|
+
found: false;
|
|
243
|
+
modelId: null;
|
|
244
|
+
record: null;
|
|
245
|
+
attemptedStrategies: ResolutionStrategy[];
|
|
246
|
+
bestRejectedCandidate?: {
|
|
247
|
+
modelId: string;
|
|
248
|
+
confidence: number;
|
|
249
|
+
reason: string;
|
|
250
|
+
};
|
|
251
|
+
reason: string;
|
|
252
|
+
};
|
|
253
|
+
type ModelResolutionResult = ModelResolutionSuccess | ModelResolutionNotFound;
|
|
254
|
+
type ModelResolverOptions = {
|
|
255
|
+
confidenceThreshold?: number;
|
|
256
|
+
aliasRegistry?: AliasRegistry;
|
|
257
|
+
additionalShorthands?: Record<string, string>;
|
|
258
|
+
additionalProviderPatterns?: Array<{
|
|
259
|
+
pattern: RegExp;
|
|
260
|
+
provider: string;
|
|
261
|
+
}>;
|
|
262
|
+
additionalLocalProviders?: string[];
|
|
263
|
+
/** Env-based OpenRouter vs direct routing. Defaults to loadOpenRouterRoutingEnv(). */
|
|
264
|
+
routingEnv?: OpenRouterRoutingConfig;
|
|
265
|
+
};
|
|
266
|
+
type CatalogIndexes = {
|
|
267
|
+
aliasIndex: Map<string, string>;
|
|
268
|
+
slugIndex: Map<string, string>;
|
|
269
|
+
providerPrefixesBySize: string[];
|
|
270
|
+
};
|
|
271
|
+
/** @deprecated Use ModelResolutionSuccess via ModelNameResolver */
|
|
272
|
+
type ResolvedModel = {
|
|
273
|
+
catalogModel: AiModelRecord;
|
|
274
|
+
matchedAlias: string;
|
|
275
|
+
routedViaOpenRouter: boolean;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export { type AiModelPricing as A, type CatalogIndexes as C, type ModelListFilters as M, type OpenRouterArchitectureApi as O, type ResolutionStrategy as R, type AiModelRecord as a, type AliasEntry as b, type AliasFileSchema as c, AliasRegistry as d, type AliasRegistryOptions as e, type AliasValidationReport as f, type ModelListResult as g, type ModelResolutionInput as h, type ModelResolutionNotFound as i, type ModelResolutionResult as j, type ModelResolutionSuccess as k, type ModelResolverOptions as l, type OpenRouterModelApi as m, type OpenRouterModelsQuery as n, type OpenRouterModelsResponse as o, type OpenRouterOutputModality as p, type OpenRouterPricingApi as q, type OpenRouterRoutingConfig as r, type OpenRouterTopProviderApi as s, type ResolvedModel as t, type ResolvedModelRef as u, loadOpenRouterRoutingEnv as v, providerIdToEnvKeyPrefix as w, shouldDefaultRouteViaOpenRouter as x, vendorApiKeyEnvName as y };
|
package/package.json
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@x12i/ai-tools",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "AI model catalog, cost calculation, and LLM utility belt backed by Catalox",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"bin": {
|
|
11
|
+
"ai-tools": "dist/cli/index.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"./cost": {
|
|
20
|
+
"types": "./dist/cost/index.d.ts",
|
|
21
|
+
"import": "./dist/cost/index.js",
|
|
22
|
+
"require": "./dist/cost/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./toolbox": {
|
|
25
|
+
"types": "./dist/toolbox/index.d.ts",
|
|
26
|
+
"import": "./dist/toolbox/index.js",
|
|
27
|
+
"require": "./dist/toolbox/index.cjs"
|
|
28
|
+
},
|
|
29
|
+
"./sync": {
|
|
30
|
+
"types": "./dist/sync/index.d.ts",
|
|
31
|
+
"import": "./dist/sync/index.js",
|
|
32
|
+
"require": "./dist/sync/index.cjs"
|
|
33
|
+
},
|
|
34
|
+
"./catalox": {
|
|
35
|
+
"types": "./dist/catalox/index.d.ts",
|
|
36
|
+
"import": "./dist/catalox/index.js",
|
|
37
|
+
"require": "./dist/catalox/index.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./aliases": {
|
|
40
|
+
"types": "./dist/aliases/index.d.ts",
|
|
41
|
+
"import": "./dist/aliases/index.js",
|
|
42
|
+
"require": "./dist/aliases/index.cjs"
|
|
43
|
+
},
|
|
44
|
+
"./models": {
|
|
45
|
+
"types": "./dist/models/index.d.ts",
|
|
46
|
+
"import": "./dist/models/index.js",
|
|
47
|
+
"require": "./dist/models/index.cjs"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"schemas"
|
|
53
|
+
],
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=20"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:live": "vitest run --config vitest.live.config.ts",
|
|
61
|
+
"test:all": "npm test && npm run test:live",
|
|
62
|
+
"test:watch": "vitest",
|
|
63
|
+
"test:coverage": "vitest run --coverage",
|
|
64
|
+
"seed": "tsx scripts/seed.ts",
|
|
65
|
+
"seed:verbose": "tsx scripts/seed.ts --verbose",
|
|
66
|
+
"prepublishOnly": "npm run build && npm test"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"@x12i/catalox": "^4.0.0"
|
|
70
|
+
},
|
|
71
|
+
"peerDependenciesMeta": {
|
|
72
|
+
"@x12i/helpers": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"firebase-admin": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"openai": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
81
|
+
"better-sqlite3": {
|
|
82
|
+
"optional": true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"dependencies": {
|
|
86
|
+
"@x12i/env": "^4.0.1",
|
|
87
|
+
"commander": "^12.1.0",
|
|
88
|
+
"dotenv": "^16.4.7",
|
|
89
|
+
"nx-cache": "^1.0.2",
|
|
90
|
+
"zod": "^3.24.2"
|
|
91
|
+
},
|
|
92
|
+
"devDependencies": {
|
|
93
|
+
"@types/node": "^22.13.10",
|
|
94
|
+
"@x12i/catalox": "^4.0.0",
|
|
95
|
+
"tsup": "^8.4.0",
|
|
96
|
+
"tsx": "^4.19.3",
|
|
97
|
+
"typescript": "^5.8.2",
|
|
98
|
+
"vitest": "^1.6.1"
|
|
99
|
+
},
|
|
100
|
+
"keywords": [
|
|
101
|
+
"ai",
|
|
102
|
+
"openrouter",
|
|
103
|
+
"catalox",
|
|
104
|
+
"llm",
|
|
105
|
+
"cost",
|
|
106
|
+
"models"
|
|
107
|
+
],
|
|
108
|
+
"repository": {
|
|
109
|
+
"type": "git",
|
|
110
|
+
"url": "https://github.com/x12i/ai-tools.git"
|
|
111
|
+
},
|
|
112
|
+
"publishConfig": {
|
|
113
|
+
"access": "public"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://unpkg.com/@x12i/ai-tools/schemas/aliases.json",
|
|
4
|
+
"title": "AI Tools Alias File",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["version", "updatedAt", "aliases"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": { "type": "string" },
|
|
10
|
+
"version": { "const": 1 },
|
|
11
|
+
"updatedAt": { "type": "string", "format": "date-time" },
|
|
12
|
+
"aliases": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": ["modelId", "provider", "addedAt", "updatedAt"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"modelId": { "type": "string", "minLength": 1 },
|
|
19
|
+
"provider": { "type": "string", "minLength": 1 },
|
|
20
|
+
"description": { "type": "string" },
|
|
21
|
+
"tags": { "type": "array", "items": { "type": "string" } },
|
|
22
|
+
"addedAt": { "type": "string", "format": "date-time" },
|
|
23
|
+
"updatedAt": { "type": "string", "format": "date-time" }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|