@memberjunction/ai-provider-bundle 2.105.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 ADDED
@@ -0,0 +1,54 @@
1
+ # @memberjunction/ai-provider-bundle
2
+
3
+ AI Provider Bundle for MemberJunction - automatically loads all standard AI providers to prevent tree shaking in production builds.
4
+
5
+ ## Purpose
6
+
7
+ This package solves a critical issue in production builds where aggressive tree shaking can remove AI provider classes that are registered dynamically at runtime. By explicitly importing and loading all standard providers, this bundle ensures they remain available throughout the application lifecycle.
8
+
9
+ ## Architecture
10
+
11
+ This bundle package maintains clean separation of concerns by keeping provider-specific loading logic separate from the core AI Engine infrastructure. Lower-level packages like `@memberjunction/ai`, `@memberjunction/aiengine`, and `@memberjunction/ai-engine-base` remain focused on core functionality without coupling to specific provider implementations.
12
+
13
+ ## Usage
14
+
15
+ Call `LoadAIProviders()` early in your application startup:
16
+
17
+ ```typescript
18
+ import { LoadAIProviders } from '@memberjunction/ai-provider-bundle';
19
+
20
+ // In your application's entry point (index.ts, server.ts, etc.)
21
+ LoadAIProviders();
22
+ ```
23
+
24
+ ## Included Providers
25
+
26
+ This bundle loads the following AI providers:
27
+
28
+ - **OpenAI** - GPT models and embeddings
29
+ - **Anthropic** - Claude models
30
+ - **Groq** - High-performance inference
31
+ - **Cerebras** - Fast inference models
32
+ - **Mistral** - Open-source LLMs
33
+ - **LMStudio** - Local model hosting
34
+ - **OpenRouter** - Multi-provider routing
35
+ - **Ollama** - Local model management
36
+ - **xAI** - Grok models
37
+ - **LocalEmbeddings** - Local embedding generation
38
+
39
+ ## When to Use
40
+
41
+ Use this package in any MemberJunction application that:
42
+
43
+ 1. Uses production builds with optimization/tree shaking enabled
44
+ 2. Dynamically selects AI providers at runtime based on configuration
45
+ 3. Needs all standard providers available without explicit imports
46
+
47
+ ## When Not to Use
48
+
49
+ If your application only uses a specific subset of providers, you can manually import and load only those providers instead of using this bundle to reduce bundle size.
50
+
51
+ ## See Also
52
+
53
+ - [@memberjunction/aiengine](../Engine/README.md) - Core AI Engine functionality
54
+ - [@memberjunction/ai](../../Core/README.md) - Base AI types and interfaces
@@ -0,0 +1,28 @@
1
+ /**
2
+ * AI Provider Bundle
3
+ *
4
+ * This package loads all standard MemberJunction AI providers to prevent tree shaking
5
+ * in production builds. By importing this bundle, consuming applications ensure that
6
+ * all provider classes are registered and available at runtime.
7
+ *
8
+ * Architecture Note:
9
+ * This bundle package separates provider-specific loading logic from the core AI Engine
10
+ * architecture, maintaining clean separation of concerns between lower-level infrastructure
11
+ * (Core, Engine, EngineBase) and provider implementations.
12
+ */
13
+ /**
14
+ * Loads all standard AI providers to prevent tree shaking.
15
+ * Call this function early in your application startup (e.g., in index.ts or main server file)
16
+ * to ensure all AI providers are available throughout the application lifecycle.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // In your application's entry point
21
+ * import { LoadAIProviders } from '@memberjunction/ai-provider-bundle';
22
+ *
23
+ * // Load all providers at startup
24
+ * LoadAIProviders();
25
+ * ```
26
+ */
27
+ export declare function LoadAIProviders(): void;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAWtC"}
package/dist/index.js ADDED
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * AI Provider Bundle
4
+ *
5
+ * This package loads all standard MemberJunction AI providers to prevent tree shaking
6
+ * in production builds. By importing this bundle, consuming applications ensure that
7
+ * all provider classes are registered and available at runtime.
8
+ *
9
+ * Architecture Note:
10
+ * This bundle package separates provider-specific loading logic from the core AI Engine
11
+ * architecture, maintaining clean separation of concerns between lower-level infrastructure
12
+ * (Core, Engine, EngineBase) and provider implementations.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.LoadAIProviders = void 0;
16
+ // Import all AI provider loaders
17
+ const ai_openai_1 = require("@memberjunction/ai-openai");
18
+ const ai_anthropic_1 = require("@memberjunction/ai-anthropic");
19
+ const ai_groq_1 = require("@memberjunction/ai-groq");
20
+ const ai_cerebras_1 = require("@memberjunction/ai-cerebras");
21
+ const ai_mistral_1 = require("@memberjunction/ai-mistral");
22
+ const ai_lmstudio_1 = require("@memberjunction/ai-lmstudio");
23
+ const ai_openrouter_1 = require("@memberjunction/ai-openrouter");
24
+ const ai_ollama_1 = require("@memberjunction/ai-ollama");
25
+ const ai_xai_1 = require("@memberjunction/ai-xai");
26
+ const ai_local_embeddings_1 = require("@memberjunction/ai-local-embeddings");
27
+ /**
28
+ * Loads all standard AI providers to prevent tree shaking.
29
+ * Call this function early in your application startup (e.g., in index.ts or main server file)
30
+ * to ensure all AI providers are available throughout the application lifecycle.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * // In your application's entry point
35
+ * import { LoadAIProviders } from '@memberjunction/ai-provider-bundle';
36
+ *
37
+ * // Load all providers at startup
38
+ * LoadAIProviders();
39
+ * ```
40
+ */
41
+ function LoadAIProviders() {
42
+ (0, ai_openai_1.LoadOpenAILLM)();
43
+ (0, ai_anthropic_1.LoadAnthropicLLM)();
44
+ (0, ai_groq_1.LoadGroqLLM)();
45
+ (0, ai_cerebras_1.LoadCerebrasLLM)();
46
+ (0, ai_mistral_1.LoadMistralLLM)();
47
+ (0, ai_lmstudio_1.LoadLMStudioLLM)();
48
+ (0, ai_openrouter_1.LoadOpenRouterLLM)();
49
+ (0, ai_ollama_1.LoadOllamaLLM)();
50
+ (0, ai_xai_1.LoadxAILLM)();
51
+ (0, ai_local_embeddings_1.LoadLocalEmbedding)();
52
+ }
53
+ exports.LoadAIProviders = LoadAIProviders;
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,iCAAiC;AACjC,yDAA0D;AAC1D,+DAAgE;AAChE,qDAAsD;AACtD,6DAA8D;AAC9D,2DAA4D;AAC5D,6DAA8D;AAC9D,iEAAkE;AAClE,yDAA0D;AAC1D,mDAAoD;AACpD,6EAAyE;AAEzE;;;;;;;;;;;;;GAaG;AACH,SAAgB,eAAe;IAC3B,IAAA,yBAAa,GAAE,CAAC;IAChB,IAAA,+BAAgB,GAAE,CAAC;IACnB,IAAA,qBAAW,GAAE,CAAC;IACd,IAAA,6BAAe,GAAE,CAAC;IAClB,IAAA,2BAAc,GAAE,CAAC;IACjB,IAAA,6BAAe,GAAE,CAAC;IAClB,IAAA,iCAAiB,GAAE,CAAC;IACpB,IAAA,yBAAa,GAAE,CAAC;IAChB,IAAA,mBAAU,GAAE,CAAC;IACb,IAAA,wCAAkB,GAAE,CAAC;AACzB,CAAC;AAXD,0CAWC"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@memberjunction/ai-provider-bundle",
3
+ "version": "2.105.0",
4
+ "description": "MemberJunction AI Provider Bundle - Loads all standard AI providers to prevent tree shaking",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
14
+ "author": "MemberJunction.com",
15
+ "license": "ISC",
16
+ "devDependencies": {
17
+ "typescript": "^5.4.5"
18
+ },
19
+ "dependencies": {
20
+ "@memberjunction/ai-anthropic": "2.105.0",
21
+ "@memberjunction/ai-cerebras": "2.105.0",
22
+ "@memberjunction/ai-groq": "2.105.0",
23
+ "@memberjunction/ai-lmstudio": "2.105.0",
24
+ "@memberjunction/ai-local-embeddings": "2.105.0",
25
+ "@memberjunction/ai-mistral": "2.105.0",
26
+ "@memberjunction/ai-ollama": "2.105.0",
27
+ "@memberjunction/ai-openai": "2.105.0",
28
+ "@memberjunction/ai-openrouter": "2.105.0",
29
+ "@memberjunction/ai-xai": "2.105.0"
30
+ }
31
+ }