noosphere 0.3.0 → 0.5.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/README.md +26 -14
- package/dist/index.cjs +156 -120
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +154 -120
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -265,14 +265,17 @@ interface ProviderLogo {
|
|
|
265
265
|
png?: string;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
|
-
*
|
|
269
|
-
* Keys match provider IDs used throughout noosphere.
|
|
268
|
+
* All known provider IDs with logo assets.
|
|
270
269
|
*/
|
|
271
|
-
declare const
|
|
270
|
+
declare const PROVIDER_IDS: readonly ["openai", "anthropic", "google", "groq", "mistral", "xai", "openrouter", "cerebras", "pi-ai", "fal", "huggingface", "comfyui", "piper", "kokoro", "ollama", "meta", "deepseek", "microsoft", "nvidia", "qwen", "cohere", "perplexity", "amazon", "zai", "minimax", "baidu", "bytedance", "tencent", "xiaomi", "ibm", "ai21", "inflection", "upstage", "sambanova", "together", "fireworks-ai", "replicate", "nebius", "novita"];
|
|
272
271
|
/**
|
|
273
|
-
* Get
|
|
274
|
-
* Tries exact match first, then case-insensitive partial match.
|
|
272
|
+
* Get CDN URLs for a provider's logo.
|
|
275
273
|
*/
|
|
276
274
|
declare function getProviderLogo(providerId: string | undefined | null): ProviderLogo | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Get all provider logos as a map.
|
|
277
|
+
*/
|
|
278
|
+
declare function getAllProviderLogos(): Record<string, ProviderLogo>;
|
|
279
|
+
declare const PROVIDER_LOGOS: Record<string, ProviderLogo>;
|
|
277
280
|
|
|
278
|
-
export { type BaseOptions, type ChatOptions, type ImageOptions, type LocalServiceConfig, type Modality, type ModelInfo, Noosphere, type NoosphereConfig, NoosphereError, type NoosphereErrorCode, type NoosphereProvider, type NoosphereResult, type NoosphereStream, PROVIDER_LOGOS, type ProviderInfo, type ProviderLogo$1 as ProviderLogo, type SpeakOptions, type StreamEvent, type SyncResult, type UsageEvent, type UsageQueryOptions, type UsageSummary, type VideoOptions, getProviderLogo };
|
|
281
|
+
export { type BaseOptions, type ChatOptions, type ImageOptions, type LocalServiceConfig, type Modality, type ModelInfo, Noosphere, type NoosphereConfig, NoosphereError, type NoosphereErrorCode, type NoosphereProvider, type NoosphereResult, type NoosphereStream, PROVIDER_IDS, PROVIDER_LOGOS, type ProviderInfo, type ProviderLogo$1 as ProviderLogo, type SpeakOptions, type StreamEvent, type SyncResult, type UsageEvent, type UsageQueryOptions, type UsageSummary, type VideoOptions, getAllProviderLogos, getProviderLogo };
|
package/dist/index.js
CHANGED
|
@@ -109,130 +109,149 @@ function resolveConfig(input) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// src/logos.ts
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
meta
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
png: "https://cdn.brandfetch.io/idwWX3Neii/w/512/h/512/theme/dark/icon.png"
|
|
196
|
-
},
|
|
197
|
-
amazon: {
|
|
198
|
-
svg: "https://cdn.simpleicons.org/amazonaws",
|
|
199
|
-
png: "https://cdn.brandfetch.io/idawORoPJZ/w/512/h/512/theme/dark/icon.png"
|
|
200
|
-
},
|
|
201
|
-
// --- HuggingFace Inference Providers ---
|
|
202
|
-
"hf-inference": {
|
|
203
|
-
svg: "https://cdn.simpleicons.org/huggingface",
|
|
204
|
-
png: "https://cdn.brandfetch.io/idnrPPHe87/w/512/h/512/theme/dark/icon.png"
|
|
205
|
-
},
|
|
206
|
-
"sambanova": {
|
|
207
|
-
png: "https://cdn.brandfetch.io/id__2e5yMY/w/512/h/512/theme/dark/icon.png"
|
|
208
|
-
},
|
|
209
|
-
"together": {
|
|
210
|
-
svg: "https://cdn.simpleicons.org/togetherai",
|
|
211
|
-
png: "https://cdn.brandfetch.io/idH5EoFVaH/w/512/h/512/theme/dark/icon.png"
|
|
212
|
-
},
|
|
213
|
-
"fireworks-ai": {
|
|
214
|
-
png: "https://cdn.brandfetch.io/idj1VQ2O4C/w/512/h/512/theme/dark/icon.png"
|
|
215
|
-
},
|
|
216
|
-
"replicate": {
|
|
217
|
-
svg: "https://cdn.simpleicons.org/replicate",
|
|
218
|
-
png: "https://cdn.brandfetch.io/idWKE4rRaH/w/512/h/512/theme/dark/icon.png"
|
|
219
|
-
},
|
|
220
|
-
"nebius": {
|
|
221
|
-
png: "https://cdn.brandfetch.io/idiUqSQ52b/w/512/h/512/theme/dark/icon.png"
|
|
222
|
-
},
|
|
223
|
-
"novita": {
|
|
224
|
-
png: "https://novita.ai/favicon.png"
|
|
225
|
-
}
|
|
226
|
-
};
|
|
112
|
+
var CDN_BASE = "https://blockchainstarter.nyc3.digitaloceanspaces.com/noosphere/logos";
|
|
113
|
+
var PROVIDER_IDS = [
|
|
114
|
+
// Cloud LLM
|
|
115
|
+
"openai",
|
|
116
|
+
"anthropic",
|
|
117
|
+
"google",
|
|
118
|
+
"groq",
|
|
119
|
+
"mistral",
|
|
120
|
+
"xai",
|
|
121
|
+
"openrouter",
|
|
122
|
+
"cerebras",
|
|
123
|
+
"pi-ai",
|
|
124
|
+
// Media
|
|
125
|
+
"fal",
|
|
126
|
+
"huggingface",
|
|
127
|
+
// Local
|
|
128
|
+
"comfyui",
|
|
129
|
+
"piper",
|
|
130
|
+
"kokoro",
|
|
131
|
+
"ollama",
|
|
132
|
+
// Model orgs (from OpenRouter prefixes)
|
|
133
|
+
"meta",
|
|
134
|
+
"deepseek",
|
|
135
|
+
"microsoft",
|
|
136
|
+
"nvidia",
|
|
137
|
+
"qwen",
|
|
138
|
+
"cohere",
|
|
139
|
+
"perplexity",
|
|
140
|
+
"amazon",
|
|
141
|
+
// Additional model orgs
|
|
142
|
+
"zai",
|
|
143
|
+
"minimax",
|
|
144
|
+
"baidu",
|
|
145
|
+
"bytedance",
|
|
146
|
+
"tencent",
|
|
147
|
+
"xiaomi",
|
|
148
|
+
"ibm",
|
|
149
|
+
"ai21",
|
|
150
|
+
"inflection",
|
|
151
|
+
"upstage",
|
|
152
|
+
// HuggingFace inference providers
|
|
153
|
+
"sambanova",
|
|
154
|
+
"together",
|
|
155
|
+
"fireworks-ai",
|
|
156
|
+
"replicate",
|
|
157
|
+
"nebius",
|
|
158
|
+
"novita"
|
|
159
|
+
];
|
|
160
|
+
var HAS_SVG = /* @__PURE__ */ new Set([
|
|
161
|
+
"openai",
|
|
162
|
+
"anthropic",
|
|
163
|
+
"google",
|
|
164
|
+
"groq",
|
|
165
|
+
"mistral",
|
|
166
|
+
"xai",
|
|
167
|
+
"openrouter",
|
|
168
|
+
"cerebras",
|
|
169
|
+
"huggingface",
|
|
170
|
+
"ollama",
|
|
171
|
+
"meta",
|
|
172
|
+
"deepseek",
|
|
173
|
+
"microsoft",
|
|
174
|
+
"nvidia",
|
|
175
|
+
"qwen",
|
|
176
|
+
"cohere",
|
|
177
|
+
"perplexity",
|
|
178
|
+
"amazon",
|
|
179
|
+
"baidu",
|
|
180
|
+
"together",
|
|
181
|
+
"fireworks-ai",
|
|
182
|
+
"replicate",
|
|
183
|
+
"nebius",
|
|
184
|
+
"novita",
|
|
185
|
+
"comfyui",
|
|
186
|
+
"fal",
|
|
187
|
+
"kokoro",
|
|
188
|
+
"piper",
|
|
189
|
+
"sambanova",
|
|
190
|
+
"pi-ai",
|
|
191
|
+
"zai"
|
|
192
|
+
// NO SVG: bytedance, tencent, xiaomi, ibm, ai21, inflection, upstage, minimax
|
|
193
|
+
]);
|
|
194
|
+
var _cache = /* @__PURE__ */ new Map();
|
|
227
195
|
function getProviderLogo(providerId) {
|
|
228
196
|
if (!providerId) return void 0;
|
|
229
|
-
|
|
197
|
+
const cached = _cache.get(providerId);
|
|
198
|
+
if (cached) return cached;
|
|
230
199
|
const normalized = providerId.toLowerCase().replace(/[-_\s]/g, "");
|
|
231
|
-
|
|
232
|
-
|
|
200
|
+
let matchedId = null;
|
|
201
|
+
for (const id of PROVIDER_IDS) {
|
|
202
|
+
if (id === providerId) {
|
|
203
|
+
matchedId = id;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
233
206
|
}
|
|
234
|
-
|
|
207
|
+
if (!matchedId) {
|
|
208
|
+
for (const id of PROVIDER_IDS) {
|
|
209
|
+
if (id.replace(/[-_\s]/g, "") === normalized) {
|
|
210
|
+
matchedId = id;
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (!matchedId) return void 0;
|
|
216
|
+
const logo = {
|
|
217
|
+
png: `${CDN_BASE}/png/${matchedId}.png`
|
|
218
|
+
};
|
|
219
|
+
if (HAS_SVG.has(matchedId)) {
|
|
220
|
+
logo.svg = `${CDN_BASE}/svg/${matchedId}.svg`;
|
|
221
|
+
}
|
|
222
|
+
_cache.set(providerId, logo);
|
|
223
|
+
return logo;
|
|
235
224
|
}
|
|
225
|
+
function getAllProviderLogos() {
|
|
226
|
+
const result = {};
|
|
227
|
+
for (const id of PROVIDER_IDS) {
|
|
228
|
+
const logo = getProviderLogo(id);
|
|
229
|
+
if (logo) result[id] = logo;
|
|
230
|
+
}
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
var _allLogos = null;
|
|
234
|
+
var PROVIDER_LOGOS = new Proxy({}, {
|
|
235
|
+
get(_, prop) {
|
|
236
|
+
if (!_allLogos) _allLogos = getAllProviderLogos();
|
|
237
|
+
return _allLogos[prop];
|
|
238
|
+
},
|
|
239
|
+
ownKeys() {
|
|
240
|
+
if (!_allLogos) _allLogos = getAllProviderLogos();
|
|
241
|
+
return Object.keys(_allLogos);
|
|
242
|
+
},
|
|
243
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
244
|
+
if (!_allLogos) _allLogos = getAllProviderLogos();
|
|
245
|
+
if (prop in _allLogos) {
|
|
246
|
+
return { configurable: true, enumerable: true, value: _allLogos[prop] };
|
|
247
|
+
}
|
|
248
|
+
return void 0;
|
|
249
|
+
},
|
|
250
|
+
has(_, prop) {
|
|
251
|
+
if (!_allLogos) _allLogos = getAllProviderLogos();
|
|
252
|
+
return prop in _allLogos;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
236
255
|
|
|
237
256
|
// src/registry.ts
|
|
238
257
|
var Registry = class {
|
|
@@ -770,7 +789,20 @@ var PiAiProvider = class {
|
|
|
770
789
|
"qwen/": "qwen",
|
|
771
790
|
"cohere/": "cohere",
|
|
772
791
|
"perplexity/": "perplexity",
|
|
773
|
-
"amazon/": "amazon"
|
|
792
|
+
"amazon/": "amazon",
|
|
793
|
+
"z-ai/": "zai",
|
|
794
|
+
"minimax/": "minimax",
|
|
795
|
+
"baidu/": "baidu",
|
|
796
|
+
"bytedance/": "bytedance",
|
|
797
|
+
"bytedance-seed/": "bytedance",
|
|
798
|
+
"tencent/": "tencent",
|
|
799
|
+
"xiaomi/": "xiaomi",
|
|
800
|
+
"ibm-granite/": "ibm",
|
|
801
|
+
"ibm/": "ibm",
|
|
802
|
+
"ai21/": "ai21",
|
|
803
|
+
"inflection/": "inflection",
|
|
804
|
+
"upstage/": "upstage",
|
|
805
|
+
"alibaba/": "qwen"
|
|
774
806
|
};
|
|
775
807
|
const lower = modelId.toLowerCase();
|
|
776
808
|
for (const [prefix, provider] of Object.entries(MODEL_PREFIX_TO_PROVIDER)) {
|
|
@@ -1722,7 +1754,9 @@ var Noosphere = class {
|
|
|
1722
1754
|
export {
|
|
1723
1755
|
Noosphere,
|
|
1724
1756
|
NoosphereError,
|
|
1757
|
+
PROVIDER_IDS,
|
|
1725
1758
|
PROVIDER_LOGOS,
|
|
1759
|
+
getAllProviderLogos,
|
|
1726
1760
|
getProviderLogo
|
|
1727
1761
|
};
|
|
1728
1762
|
//# sourceMappingURL=index.js.map
|