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/dist/index.d.ts CHANGED
@@ -265,14 +265,17 @@ interface ProviderLogo {
265
265
  png?: string;
266
266
  }
267
267
  /**
268
- * Known provider logos from official brand assets and CDNs.
269
- * Keys match provider IDs used throughout noosphere.
268
+ * All known provider IDs with logo assets.
270
269
  */
271
- declare const PROVIDER_LOGOS: Record<string, ProviderLogo>;
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 logo for a provider by its ID.
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 PROVIDER_LOGOS = {
113
- // --- Cloud LLM Providers ---
114
- openai: {
115
- svg: "https://cdn.simpleicons.org/openai",
116
- png: "https://cdn.brandfetch.io/idR3duQxYl/w/512/h/512/theme/dark/icon.png"
117
- },
118
- anthropic: {
119
- svg: "https://cdn.simpleicons.org/anthropic",
120
- png: "https://cdn.brandfetch.io/id2S-kXbuM/w/512/h/512/theme/dark/icon.png"
121
- },
122
- google: {
123
- svg: "https://cdn.simpleicons.org/google",
124
- png: "https://cdn.brandfetch.io/id6O2oGzv-/w/512/h/512/theme/dark/icon.png"
125
- },
126
- groq: {
127
- svg: "https://cdn.simpleicons.org/groq",
128
- png: "https://cdn.brandfetch.io/idTEBPz5KO/w/512/h/512/theme/dark/icon.png"
129
- },
130
- mistral: {
131
- svg: "https://cdn.simpleicons.org/mistral",
132
- png: "https://cdn.brandfetch.io/idnBOFq5eF/w/512/h/512/theme/dark/icon.png"
133
- },
134
- xai: {
135
- svg: "https://cdn.simpleicons.org/x",
136
- png: "https://cdn.brandfetch.io/idS5WhqBbM/w/512/h/512/theme/dark/icon.png"
137
- },
138
- openrouter: {
139
- svg: "https://openrouter.ai/favicon.svg",
140
- png: "https://openrouter.ai/favicon.png"
141
- },
142
- cerebras: {
143
- svg: "https://cdn.simpleicons.org/cerebras",
144
- png: "https://cdn.brandfetch.io/idGa4PRFP0/w/512/h/512/theme/dark/icon.png"
145
- },
146
- // --- Media Providers ---
147
- fal: {
148
- svg: "https://fal.ai/favicon.svg",
149
- png: "https://fal.ai/favicon.png"
150
- },
151
- huggingface: {
152
- svg: "https://cdn.simpleicons.org/huggingface",
153
- png: "https://cdn.brandfetch.io/idnrPPHe87/w/512/h/512/theme/dark/icon.png"
154
- },
155
- // --- Local Providers ---
156
- comfyui: {
157
- svg: "https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/web/assets/icon.svg",
158
- png: "https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/web/assets/icon.png"
159
- },
160
- piper: {
161
- png: "https://raw.githubusercontent.com/rhasspy/piper/master/logo.png"
162
- },
163
- kokoro: {
164
- png: "https://raw.githubusercontent.com/hexgrad/kokoro/main/assets/icon.png"
165
- },
166
- ollama: {
167
- svg: "https://cdn.simpleicons.org/ollama",
168
- png: "https://cdn.brandfetch.io/idtesMoSFj/w/512/h/512/theme/dark/icon.png"
169
- },
170
- // --- Model Org Providers (from OpenRouter model prefixes) ---
171
- meta: {
172
- svg: "https://cdn.simpleicons.org/meta",
173
- png: "https://cdn.brandfetch.io/idmKk_rq7Y/w/512/h/512/theme/dark/icon.png"
174
- },
175
- deepseek: {
176
- png: "https://cdn.brandfetch.io/id1BWKUVWI/w/512/h/512/theme/dark/icon.png"
177
- },
178
- microsoft: {
179
- svg: "https://cdn.simpleicons.org/microsoft",
180
- png: "https://cdn.brandfetch.io/idchmboHEZ/w/512/h/512/theme/dark/icon.png"
181
- },
182
- nvidia: {
183
- svg: "https://cdn.simpleicons.org/nvidia",
184
- png: "https://cdn.brandfetch.io/id1JcGHuZN/w/512/h/512/theme/dark/icon.png"
185
- },
186
- qwen: {
187
- png: "https://img.alicdn.com/imgextra/i1/O1CN01BUp2gU1sRZigvazUo_!!6000000005764-2-tps-228-228.png"
188
- },
189
- cohere: {
190
- svg: "https://cdn.simpleicons.org/cohere",
191
- png: "https://cdn.brandfetch.io/idiDnz1fvB/w/512/h/512/theme/dark/icon.png"
192
- },
193
- perplexity: {
194
- svg: "https://cdn.simpleicons.org/perplexity",
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
- if (PROVIDER_LOGOS[providerId]) return PROVIDER_LOGOS[providerId];
197
+ const cached = _cache.get(providerId);
198
+ if (cached) return cached;
230
199
  const normalized = providerId.toLowerCase().replace(/[-_\s]/g, "");
231
- for (const [key, logo] of Object.entries(PROVIDER_LOGOS)) {
232
- if (key.replace(/[-_\s]/g, "") === normalized) return logo;
200
+ let matchedId = null;
201
+ for (const id of PROVIDER_IDS) {
202
+ if (id === providerId) {
203
+ matchedId = id;
204
+ break;
205
+ }
233
206
  }
234
- return void 0;
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