@burtson-labs/bandit-engine 2.0.8 → 2.0.10
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/LICENSE +2 -2
- package/README.md +161 -56
- package/dist/{aiProviderStore-YWJHSWFA.mjs → aiProviderStore-3YS2BZU3.mjs} +2 -2
- package/dist/chat-ZPJNWIXI.mjs +15 -0
- package/dist/chat-provider.js +9608 -0
- package/dist/chat-provider.js.map +1 -0
- package/dist/chat-provider.mjs +17 -0
- package/dist/chunk-2ZNIQD26.mjs +259 -0
- package/dist/chunk-2ZNIQD26.mjs.map +1 -0
- package/dist/chunk-5UVULH77.mjs +9427 -0
- package/dist/chunk-5UVULH77.mjs.map +1 -0
- package/dist/chunk-CY227I4F.mjs +160 -0
- package/dist/chunk-CY227I4F.mjs.map +1 -0
- package/dist/chunk-IFN52MQL.mjs +8763 -0
- package/dist/chunk-IFN52MQL.mjs.map +1 -0
- package/dist/{chunk-AVC6IZJQ.mjs → chunk-IHJPVIGB.mjs} +179 -2
- package/dist/chunk-IHJPVIGB.mjs.map +1 -0
- package/dist/chunk-L7UOQ2Y2.mjs +2810 -0
- package/dist/chunk-L7UOQ2Y2.mjs.map +1 -0
- package/dist/chunk-ONQMRE2G.mjs +26 -0
- package/dist/chunk-ONQMRE2G.mjs.map +1 -0
- package/dist/chunk-RTQDQ6TC.mjs +231 -0
- package/dist/chunk-RTQDQ6TC.mjs.map +1 -0
- package/dist/chunk-UMPVXYVC.mjs +5658 -0
- package/dist/chunk-UMPVXYVC.mjs.map +1 -0
- package/dist/chunk-XEG45Q6V.mjs +8925 -0
- package/dist/chunk-XEG45Q6V.mjs.map +1 -0
- package/dist/{chunk-WYS5CZVG.mjs → chunk-XUBYA5I7.mjs} +2 -2
- package/dist/{chunk-WYS5CZVG.mjs.map → chunk-XUBYA5I7.mjs.map} +1 -1
- package/dist/cli/cli.js +24 -13
- package/dist/cli/cli.js.map +1 -1
- package/dist/gateway-BiHRHJMM.d.mts +314 -0
- package/dist/gateway-BiHRHJMM.d.ts +314 -0
- package/dist/index.d.mts +11 -309
- package/dist/index.d.ts +11 -309
- package/dist/index.js +400 -155
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -11874
- package/dist/index.mjs.map +1 -1
- package/dist/management/management.js +39535 -0
- package/dist/management/management.js.map +1 -0
- package/dist/management/management.mjs +16 -0
- package/dist/management/management.mjs.map +1 -0
- package/dist/{chunk-BIPELT57.mjs → modals/chat-modal/chat-modal.js} +16818 -20860
- package/dist/modals/chat-modal/chat-modal.js.map +1 -0
- package/dist/modals/chat-modal/chat-modal.mjs +19 -0
- package/dist/modals/chat-modal/chat-modal.mjs.map +1 -0
- package/dist/{modelStore-Y3LZWRQC.mjs → modelStore-UMJBDSEF.mjs} +2 -2
- package/dist/modelStore-UMJBDSEF.mjs.map +1 -0
- package/dist/public-types.d.mts +32 -0
- package/dist/public-types.d.ts +32 -0
- package/docs/01_quickstart.md +9 -6
- package/docs/02_gateway_api.md +55 -12
- package/docs/04_local_dev.md +1 -1
- package/docs/api_reference/assets/navigation.js +1 -1
- package/docs/api_reference/assets/search.js +1 -1
- package/docs/api_reference/classes/DebugLogger.html +11 -11
- package/docs/api_reference/classes/FeatureFlagService.html +13 -13
- package/docs/api_reference/classes/NotificationService.html +10 -10
- package/docs/api_reference/classes/StreamingTTSClient.html +9 -9
- package/docs/api_reference/classes/VectorDatabaseService.html +24 -24
- package/docs/api_reference/classes/VectorMigrationService.html +8 -8
- package/docs/api_reference/classes/VoiceService.html +2 -2
- package/docs/api_reference/enums/TTSState.html +2 -2
- package/docs/api_reference/functions/Chat.html +1 -1
- package/docs/api_reference/functions/ChatModal.html +4 -4
- package/docs/api_reference/functions/ChatProvider.html +1 -1
- package/docs/api_reference/functions/FeatureFlagProvider.html +1 -1
- package/docs/api_reference/functions/FeedbackButton.html +1 -1
- package/docs/api_reference/functions/FeedbackModal.html +1 -1
- package/docs/api_reference/functions/Management.html +1 -1
- package/docs/api_reference/functions/NotificationProvider.html +1 -1
- package/docs/api_reference/functions/SubscriptionExpiredGuard.html +1 -1
- package/docs/api_reference/functions/SubscriptionExpiredModal.html +1 -1
- package/docs/api_reference/functions/defineCustomElement.html +1 -1
- package/docs/api_reference/functions/getCriticalConfig.html +1 -1
- package/docs/api_reference/functions/getFeatureMatrix.html +1 -1
- package/docs/api_reference/functions/getStreamingTTSClient.html +1 -1
- package/docs/api_reference/functions/getSystemConstants.html +1 -1
- package/docs/api_reference/functions/getTTSState.html +1 -1
- package/docs/api_reference/functions/handleHttpError.html +1 -1
- package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -1
- package/docs/api_reference/functions/handleValidationError.html +1 -1
- package/docs/api_reference/functions/initializeCoreSystem.html +1 -1
- package/docs/api_reference/functions/pauseTTS.html +1 -1
- package/docs/api_reference/functions/previewTierUpgrade.html +1 -1
- package/docs/api_reference/functions/resumeTTS.html +1 -1
- package/docs/api_reference/functions/showInfoNotification.html +1 -1
- package/docs/api_reference/functions/showSuccessNotification.html +1 -1
- package/docs/api_reference/functions/speakWithStreaming.html +1 -1
- package/docs/api_reference/functions/stopTTS.html +1 -1
- package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -1
- package/docs/api_reference/functions/updateSubscriptionTier.html +1 -1
- package/docs/api_reference/functions/useFeatureFlag.html +1 -1
- package/docs/api_reference/functions/useFeatureVisibility.html +1 -1
- package/docs/api_reference/functions/useFeatures.html +1 -1
- package/docs/api_reference/functions/useGatewayHealth.html +1 -1
- package/docs/api_reference/functions/useGatewayMemory.html +1 -1
- package/docs/api_reference/functions/useGatewayModels.html +1 -1
- package/docs/api_reference/functions/useGlobalTTS.html +1 -1
- package/docs/api_reference/functions/useNotification.html +1 -1
- package/docs/api_reference/functions/useNotificationService.html +1 -1
- package/docs/api_reference/functions/useTTS.html +1 -1
- package/docs/api_reference/functions/useVectorStore.html +1 -1
- package/docs/api_reference/functions/useVoiceStore.html +2 -2
- package/docs/api_reference/functions/useVoices.html +1 -1
- package/docs/api_reference/functions/validateEnvironment.html +1 -1
- package/docs/api_reference/functions/validateSystemIntegrity.html +1 -1
- package/docs/api_reference/index.html +130 -40
- package/docs/api_reference/interfaces/AIChatRequest.html +2 -2
- package/docs/api_reference/interfaces/AIChatResponse.html +2 -2
- package/docs/api_reference/interfaces/AIGenerateRequest.html +2 -2
- package/docs/api_reference/interfaces/AIGenerateResponse.html +2 -2
- package/docs/api_reference/interfaces/AIMessage.html +2 -2
- package/docs/api_reference/interfaces/AIModel.html +2 -2
- package/docs/api_reference/interfaces/AIProviderConfig.html +2 -2
- package/docs/api_reference/interfaces/ChatConfig.html +3 -3
- package/docs/api_reference/interfaces/ChatModalProps.html +7 -0
- package/docs/api_reference/interfaces/CreateMemoryOptions.html +2 -2
- package/docs/api_reference/interfaces/FeatureEvaluation.html +7 -7
- package/docs/api_reference/interfaces/FeatureFlagConfig.html +9 -9
- package/docs/api_reference/interfaces/FeatureFlagContextValue.html +8 -8
- package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +2 -2
- package/docs/api_reference/interfaces/FeedbackButtonProps.html +10 -10
- package/docs/api_reference/interfaces/FeedbackCategories.html +2 -2
- package/docs/api_reference/interfaces/FeedbackModalProps.html +2 -2
- package/docs/api_reference/interfaces/FeedbackPriorities.html +2 -2
- package/docs/api_reference/interfaces/FeedbackRequest.html +2 -2
- package/docs/api_reference/interfaces/FeedbackResponse.html +2 -2
- package/docs/api_reference/interfaces/FileUploadResult.html +2 -2
- package/docs/api_reference/interfaces/GatewayChatRequest.html +2 -2
- package/docs/api_reference/interfaces/GatewayChatResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayContract.html +2 -2
- package/docs/api_reference/interfaces/GatewayGenerateRequest.html +2 -2
- package/docs/api_reference/interfaces/GatewayGenerateResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayHealthResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayMemoryRecord.html +2 -2
- package/docs/api_reference/interfaces/GatewayMemoryResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayMessage.html +2 -2
- package/docs/api_reference/interfaces/GatewayMessageContent.html +2 -2
- package/docs/api_reference/interfaces/GatewayModel.html +2 -2
- package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -2
- package/docs/api_reference/interfaces/MemorySearchFilters.html +2 -2
- package/docs/api_reference/interfaces/MigrationProgress.html +2 -2
- package/docs/api_reference/interfaces/MigrationStatus.html +2 -2
- package/docs/api_reference/interfaces/NotificationConfig.html +2 -2
- package/docs/api_reference/interfaces/NotificationContextType.html +2 -2
- package/docs/api_reference/interfaces/NotificationProviderProps.html +2 -2
- package/docs/api_reference/interfaces/PackageSettings.html +5 -3
- package/docs/api_reference/interfaces/SearchOptions.html +2 -2
- package/docs/api_reference/interfaces/SearchResult.html +2 -2
- package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +2 -2
- package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +2 -2
- package/docs/api_reference/interfaces/TTSOptions.html +2 -2
- package/docs/api_reference/interfaces/TTSProgress.html +2 -2
- package/docs/api_reference/interfaces/TrialUsage.html +2 -2
- package/docs/api_reference/interfaces/UploadRequest.html +3 -3
- package/docs/api_reference/interfaces/UseTTSReturn.html +2 -2
- package/docs/api_reference/interfaces/VectorDocument.html +2 -2
- package/docs/api_reference/interfaces/VectorMemory.html +2 -2
- package/docs/api_reference/interfaces/VectorMemoryMetadata.html +2 -2
- package/docs/api_reference/interfaces/VectorStoreStatus.html +2 -2
- package/docs/api_reference/interfaces/VoiceModelsResponse.html +2 -2
- package/docs/api_reference/interfaces/VoiceState.html +2 -2
- package/docs/api_reference/media/02_gateway_api.md +55 -12
- package/docs/api_reference/media/LICENSE +2 -2
- package/docs/api_reference/media/PROTECTION-README.md +6 -8
- package/docs/api_reference/media/README.md +37 -9
- package/docs/api_reference/modules.html +1 -0
- package/docs/api_reference/types/FeatureKey.html +1 -1
- package/docs/api_reference/types/FeatureMatrix.html +1 -1
- package/docs/api_reference/types/GatewayQueryOptions.html +1 -1
- package/docs/api_reference/types/LogContext.html +1 -1
- package/docs/api_reference/types/SubscriptionTier.html +1 -1
- package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +1 -1
- package/docs/api_reference/variables/FeatureFlagContext.html +1 -1
- package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +1 -1
- package/docs/api_reference/variables/SYSTEM_FLAGS.html +1 -1
- package/docs/api_reference/variables/authenticationService.html +1 -1
- package/docs/api_reference/variables/debugLogger-1.html +1 -1
- package/docs/api_reference/variables/featureFlagService-1.html +1 -1
- package/docs/api_reference/variables/notificationService-1.html +1 -1
- package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -1
- package/docs/api_reference/variables/vectorMigrationService-1.html +1 -1
- package/docs/api_reference/variables/voiceService-1.html +1 -1
- package/package.json +24 -13
- package/dist/chat-QXB526NZ.mjs +0 -11
- package/dist/chunk-AVC6IZJQ.mjs.map +0 -1
- package/dist/chunk-BIPELT57.mjs.map +0 -1
- package/docs/api_reference/media/README-1.md +0 -23
- /package/dist/{aiProviderStore-YWJHSWFA.mjs.map → aiProviderStore-3YS2BZU3.mjs.map} +0 -0
- /package/dist/{chat-QXB526NZ.mjs.map → chat-ZPJNWIXI.mjs.map} +0 -0
- /package/dist/{modelStore-Y3LZWRQC.mjs.map → chat-provider.mjs.map} +0 -0
package/LICENSE
CHANGED
|
@@ -20,14 +20,14 @@ https://burtson.ai/license
|
|
|
20
20
|
Parameters
|
|
21
21
|
|
|
22
22
|
Licensor: Burtson Labs LLC
|
|
23
|
-
Licensed Work: Bandit Engine
|
|
23
|
+
Licensed Work: Bandit Engine UI SDK
|
|
24
24
|
The Licensed Work is © 2025 Burtson Labs
|
|
25
25
|
Additional Use Grant: You may make use of the Licensed Work, provided that you do not use
|
|
26
26
|
the Licensed Work for a Commercial Use. A "Commercial Use" means use of
|
|
27
27
|
the Licensed Work in production, or any other use that is primarily
|
|
28
28
|
intended for or directed toward commercial advantage or monetary
|
|
29
29
|
compensation.
|
|
30
|
-
Change Date:
|
|
30
|
+
Change Date: April 1, 2027
|
|
31
31
|
Change License: Apache License, Version 2.0
|
|
32
32
|
|
|
33
33
|
For information about alternative licensing arrangements for the Licensed Work,
|
package/README.md
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
<a href="https://burtson.ai"
|
|
1
|
+
<a href="https://burtson.ai">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.burtson.ai/logos/burtson-labs-logo-alt.png" />
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://cdn.burtson.ai/logos/burtson-labs-logo.png" />
|
|
5
|
+
<img src="https://cdn.burtson.ai/logos/burtson-labs-logo.png" alt="Burtson Labs Logo" width="120" style="width: 120px !important; max-width: 120px !important; height: auto; display: inline-block;" />
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
# Bandit Engine ⚡
|
|
10
|
+
|
|
11
|
+
An AI chat toolkit built for speed, design, and control. Power branded AI assistants with battle-tested React components and a secure gateway contract.
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/@burtson-labs/bandit-engine)
|
|
14
|
+
[](https://banditailabs.com/npm-package)
|
|
15
|
+
[](https://banditailabs.com/)
|
|
4
16
|
[](https://www.typescriptlang.org/)
|
|
5
17
|
[](./LICENSE)
|
|
6
18
|
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
## Features
|
|
20
|
+
- 🔌 Plug-and-play React chat, modal, and management surfaces
|
|
21
|
+
- 🧠 Memory, vector knowledge, and provider switching behind a secure gateway
|
|
22
|
+
- 🎨 Full MUI theming, dark mode, and branding controls out of the box
|
|
23
|
+
- 🌐 Multimodal support (voice, images, documents) with Ollama, OpenAI, Azure, Anthropic
|
|
24
|
+
- 🛠️ CLI scaffolding, sample gateway, and docs to launch in minutes
|
|
9
25
|
|
|
10
|
-
|
|
26
|
+
## Quick Links
|
|
27
|
+
- 📚 Full docs: [banditailabs.com/npm-package](https://banditailabs.com/npm-package) (mirrors `/docs` in this repo)
|
|
28
|
+
- 🎯 Live demo with OAuth sign-in: [banditailabs.com](https://banditailabs.com/)
|
|
29
|
+
- 🧪 Playground (no auth required): [banditailabs.com/playground](https://banditailabs.com/playground)
|
|
30
|
+
- 🔁 Sample gateway: [`examples/gateway-node`](./examples/gateway-node/README.md)
|
|
11
31
|
|
|
12
|
-
|
|
32
|
+
## Quick Start
|
|
13
33
|
|
|
14
|
-
|
|
34
|
+
### CLI Scaffold
|
|
15
35
|
|
|
16
36
|
Want a working playground instantly? Scaffold a Bandit app and gateway in one command:
|
|
17
37
|
|
|
@@ -37,6 +57,8 @@ Customize the output with options such as:
|
|
|
37
57
|
|
|
38
58
|
> 🗝️ The generated project includes an `.npmrc` that targets `https://npm.pkg.github.com/` and expects a `GITHUB_NPM_TOKEN` environment variable. Run `npm login --registry=https://npm.pkg.github.com --scope=@burtson-labs` (or export `GITHUB_NPM_TOKEN`) before installing dependencies.
|
|
39
59
|
|
|
60
|
+
> ⚠️ The scaffolded gateway focuses on OpenAI/Ollama chat and model discovery. All advanced routes (file storage uploads, vector embedding, voice, MCP, etc.) are generated as `501` placeholders so you can wire them to your own infrastructure. Implement the contracts below before turning on those features in production.
|
|
61
|
+
|
|
40
62
|
Check out the [CLI quick start guide](./docs/05_cli_quickstart.md) for the full walkthrough, option matrix, and project anatomy.
|
|
41
63
|
|
|
42
64
|
### CLI Options
|
|
@@ -51,8 +73,21 @@ Check out the [CLI quick start guide](./docs/05_cli_quickstart.md) for the full
|
|
|
51
73
|
|
|
52
74
|
The CLI prints next steps (install, copy `.env`, run dev server) once scaffolding completes, so you can copy-paste and ship immediately.
|
|
53
75
|
|
|
76
|
+
### Playground (Password-Free Preview)
|
|
77
|
+
|
|
78
|
+
Want to feel the UX without wiring a gateway or signing in? Visit the hosted playground:
|
|
79
|
+
|
|
80
|
+
- **URL:** [`https://banditailabs.com/playground`](https://banditailabs.com/playground)
|
|
81
|
+
- **What you get:** Mock streaming answers, conversation starters, and theming preview powered by the built-in `PlaygroundProvider`.
|
|
82
|
+
- **What’s simulated:** Responses come from canned scripts – no external API keys, tokens, or backend required.
|
|
83
|
+
|
|
84
|
+
The playground is ideal for product demos, initial stakeholder reviews, or QA before you connect real providers. When you’re ready to go live, swap the provider back to your gateway for production traffic.
|
|
85
|
+
|
|
54
86
|
## 🛠️ Getting Started – Plug & Play AI
|
|
55
87
|
|
|
88
|
+
|
|
89
|
+
Bandit ships with responsive layouts baked in — the chat surface, management console, and modal all collapse gracefully on phones and tablets. Install it inside a Vite project and you can ship a polished PWA: the package works offline when cached, supports mobile nav patterns, and plays nicely with add-to-home-screen flows.
|
|
90
|
+
|
|
56
91
|
1. **Add a config.json** to your public folder (or host it on a CDN) and point `brandingConfigUrl` at it:
|
|
57
92
|
|
|
58
93
|
_Host it locally in `/public` or serve it from a CDN and reference it via `brandingConfigUrl`._
|
|
@@ -92,7 +127,7 @@ const chatPackageSettings = {
|
|
|
92
127
|
provider: "openai" // Backend: openai, azure-openai, anthropic, ollama
|
|
93
128
|
},
|
|
94
129
|
|
|
95
|
-
//
|
|
130
|
+
// Direct Ollama configuration (development only)
|
|
96
131
|
// ollamaUrl: import.meta.env.VITE_OLLAMA_URL!,
|
|
97
132
|
|
|
98
133
|
// Model Configuration
|
|
@@ -103,7 +138,7 @@ const chatPackageSettings = {
|
|
|
103
138
|
|
|
104
139
|
// Branding and optional overrides
|
|
105
140
|
brandingConfigUrl: "/config.json",
|
|
106
|
-
//
|
|
141
|
+
// fileStorageApiUrl: import.meta.env.VITE_FILE_STORAGE_API_URL,
|
|
107
142
|
// homeUrl: "https://yourapp.com",
|
|
108
143
|
// feedbackEmail: "feedback@yourapp.com",
|
|
109
144
|
};
|
|
@@ -145,13 +180,34 @@ aiProvider: {
|
|
|
145
180
|
}
|
|
146
181
|
```
|
|
147
182
|
|
|
148
|
-
**Gateway Requirements:**
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
- `
|
|
152
|
-
- `
|
|
153
|
-
- `GET /api/
|
|
154
|
-
-
|
|
183
|
+
**Gateway Requirements:** Implement the endpoints that match the features you turn on:
|
|
184
|
+
|
|
185
|
+
- **Core status & discovery**
|
|
186
|
+
- `GET /api/health` — system health and provider availability
|
|
187
|
+
- `GET /api/models` and `GET /api/models/{provider}` — model inventory
|
|
188
|
+
- `GET /api/memory` — hydrate personal memory when the feature is enabled
|
|
189
|
+
- **Chat & text generation**
|
|
190
|
+
- `POST /api/chat/completions` — default provider routing
|
|
191
|
+
- `POST /api/{provider}/chat/completions` — provider-specific routing (e.g. `openai`, `azure-openai`, `anthropic`)
|
|
192
|
+
- `POST /api/ollama/chat` — native Ollama chat format
|
|
193
|
+
- `POST /api/generate` — non-chat generation (conversation starters, summaries, etc.)
|
|
194
|
+
- `POST /api/{provider}/generate` — same contract, but scoped per provider (required for conversation starters to respect OpenAI vs. Ollama routing)
|
|
195
|
+
- **Knowledge & vector search** (required for memories, knowledge management, and MCP document tools)
|
|
196
|
+
- `POST /api/embedding/embed-memory`
|
|
197
|
+
- `POST /api/embedding/batch-embed-memories`
|
|
198
|
+
- `POST /api/embedding/embed-document`
|
|
199
|
+
- `POST /api/embedding/search` and `POST /api/embedding/search-memories`
|
|
200
|
+
- `GET /api/embedding/my-memories` (with `skip`/`limit`)
|
|
201
|
+
- `DELETE /api/embedding/memory/{memoryId}` and `PUT /api/embedding/memory/{memoryId}/pin`
|
|
202
|
+
- `GET /api/embedding/available-files` and `GET /api/embedding/files`
|
|
203
|
+
- See [File Storage API Contract](#file-storage-api-contract) for the companion `/file/*` routes used to upload and download source documents.
|
|
204
|
+
- **Voice & transcription**
|
|
205
|
+
- `POST /api/tts` — synthesize speech
|
|
206
|
+
- `GET /api/tts/available-models` — advertise available voices
|
|
207
|
+
- `POST /api/stt/transcribe` — speech-to-text ingestion
|
|
208
|
+
- **Feedback & subscriptions** (optional but recommended)
|
|
209
|
+
- `POST /api/feedback` — submit in-app feedback
|
|
210
|
+
- `GET /subscription/{userId}` and `PUT /subscription/{userId}` — synchronize subscription tiers used by the feature-flag system
|
|
155
211
|
|
|
156
212
|
> **⚠️ Important:** The Bandit Engine automatically routes to provider-specific endpoints:
|
|
157
213
|
> - **Ollama** → `/api/ollama/chat` (native Ollama format)
|
|
@@ -192,7 +248,7 @@ The Bandit Engine supports Text-to-Speech (TTS) and Speech-to-Text (STT) through
|
|
|
192
248
|
- **Output**: Audio file (MP3, WAV, etc.) or streaming audio
|
|
193
249
|
- **Compatible with**: OpenAI TTS, Azure Speech, Google Cloud TTS, AWS Polly, local TTS servers, or custom implementations
|
|
194
250
|
|
|
195
|
-
**STT Endpoint (`POST /api/stt`)**
|
|
251
|
+
**STT Endpoint (`POST /api/stt/transcribe`)**
|
|
196
252
|
- **Input**: Audio file upload (multipart/form-data)
|
|
197
253
|
- **Output**: `{ text: string }` or `{ transcription: string }`
|
|
198
254
|
- **Compatible with**: OpenAI Whisper, Azure Speech, Google Speech, AWS Transcribe, local Whisper servers, or custom implementations
|
|
@@ -201,6 +257,8 @@ The Bandit Engine supports Text-to-Speech (TTS) and Speech-to-Text (STT) through
|
|
|
201
257
|
- **Output**: `{ models: string[], defaultModel: string, fallbackModel: string }`
|
|
202
258
|
- Used for automatic service availability detection and voice model selection
|
|
203
259
|
|
|
260
|
+
> Quickstart note: the generated Express gateway ships these TTS/STT routes as `501` placeholders so you can connect your own provider. Voice features remain disabled until you implement them server-side.
|
|
261
|
+
|
|
204
262
|
See the [Gateway API Contract](./docs/02_gateway_api.md) for complete implementation examples in multiple languages.
|
|
205
263
|
|
|
206
264
|
Use the Management interface to switch providers anytime or migrate from direct to gateway setup.
|
|
@@ -516,32 +574,44 @@ Here are some screenshots of Bandit Chat in action:
|
|
|
516
574
|
|
|
517
575
|
**Chat Demo – Your AI-powered UI**
|
|
518
576
|
<p align="center">
|
|
519
|
-
<
|
|
577
|
+
<a href="https://cdn.burtson.ai/images/chat-demo.jpg" target="_blank" rel="noopener">
|
|
578
|
+
<img src="https://cdn.burtson.ai/images/chat-demo.jpg" alt="Bandit chat session showing multi-turn conversation with multi-device layout" width="600" style="width: 100%; max-width: 600px; height: auto;" />
|
|
579
|
+
</a>
|
|
520
580
|
</p>
|
|
521
581
|
|
|
522
582
|
**Conversation Drawer & Project Context**
|
|
523
583
|
<p align="center">
|
|
524
|
-
<
|
|
584
|
+
<a href="https://cdn.burtson.ai/images/chat-demo-2.jpg" target="_blank" rel="noopener">
|
|
585
|
+
<img src="https://cdn.burtson.ai/images/chat-demo-2.jpg" alt="Chat drawer open with projects list and answered question" width="600" style="width: 100%; max-width: 600px; height: auto;" />
|
|
586
|
+
</a>
|
|
525
587
|
</p>
|
|
526
588
|
|
|
527
589
|
**Chat Modal – Quick Assist Anywhere**
|
|
528
590
|
<p align="center">
|
|
529
|
-
<
|
|
591
|
+
<a href="https://cdn.burtson.ai/images/chat-modal.jpg" target="_blank" rel="noopener">
|
|
592
|
+
<img src="https://cdn.burtson.ai/images/chat-modal.jpg" alt="Chat modal with control center options and message composer" width="600" style="width: 100%; max-width: 600px; height: auto;" />
|
|
593
|
+
</a>
|
|
530
594
|
</p>
|
|
531
595
|
|
|
532
596
|
**Management – Branding Controls**
|
|
533
597
|
<p align="center">
|
|
534
|
-
<
|
|
598
|
+
<a href="https://cdn.burtson.ai/images/mgmt-branding.jpg" target="_blank" rel="noopener">
|
|
599
|
+
<img src="https://cdn.burtson.ai/images/mgmt-branding.jpg" alt="Management interface branding tab showing logo and color options" width="600" style="width: 100%; max-width: 600px; height: auto;" />
|
|
600
|
+
</a>
|
|
535
601
|
</p>
|
|
536
602
|
|
|
537
603
|
**Management – Personas**
|
|
538
604
|
<p align="center">
|
|
539
|
-
<
|
|
605
|
+
<a href="https://cdn.burtson.ai/images/mgmt-personalities.jpg" target="_blank" rel="noopener">
|
|
606
|
+
<img src="https://cdn.burtson.ai/images/mgmt-personalities.jpg" alt="Management interface personas tab with configurable AI personalities" width="600" style="width: 100%; max-width: 600px; height: auto;" />
|
|
607
|
+
</a>
|
|
540
608
|
</p>
|
|
541
609
|
|
|
542
610
|
**Management – Preferences**
|
|
543
611
|
<p align="center">
|
|
544
|
-
<
|
|
612
|
+
<a href="https://cdn.burtson.ai/images/mgmt-preferences.jpg" target="_blank" rel="noopener">
|
|
613
|
+
<img src="https://cdn.burtson.ai/images/mgmt-preferences.jpg" alt="Management interface preferences tab with feature toggles" width="600" style="width: 100%; max-width: 600px; height: auto;" />
|
|
614
|
+
</a>
|
|
545
615
|
</p>
|
|
546
616
|
|
|
547
617
|
|
|
@@ -574,11 +644,26 @@ This enables remote control of Bandit appearance, available models, and more —
|
|
|
574
644
|
- `gatewayApiUrl`: Gateway API base URL for AI, TTS, STT, and MCP
|
|
575
645
|
- `aiProvider`: Provider configuration object (recommended for new installs)
|
|
576
646
|
- `ollamaUrl`: Legacy Ollama base URL (deprecated, prefer `aiProvider`)
|
|
577
|
-
- `
|
|
647
|
+
- `fileStorageApiUrl`: Optional file storage API base URL (defaults to `gatewayApiUrl`)
|
|
578
648
|
- `brandingConfigUrl`: Hosted branding JSON used to hydrate UI theming
|
|
579
649
|
- `homeUrl`: Optional URL for the home button in management UI
|
|
580
650
|
- `feedbackEmail`: Optional email address for feedback submissions
|
|
581
651
|
- `featureFlags`: Optional feature flag configuration (see examples below)
|
|
652
|
+
- `types`: Official TypeScript entry point is available at `@burtson-labs/bandit-engine/types`. Importing from that path gives you rich IntelliSense for `ChatProviderProps`, `PackageSettings`, `ChatModalProps`, gateway contracts, and more.
|
|
653
|
+
|
|
654
|
+
### File Storage API Contract
|
|
655
|
+
|
|
656
|
+
Enabling `fileStorageApiUrl` activates document uploads for vector memories, but the CLI quickstart intentionally leaves the backend stubbed. When you point the frontend at a file storage service, Bandit expects these authenticated endpoints:
|
|
657
|
+
|
|
658
|
+
- `POST /file/upload` — `multipart/form-data` body with `file` and optional `shareWithTeam`; returns `{ fileId, message? }`
|
|
659
|
+
- `GET /file/files?skip=0&limit=50` — lists previously uploaded files and metadata (`id`, `filename`, `size`, `contentType`, `updatedAt`)
|
|
660
|
+
- `GET /file/download/{fileId}` — streams the file associated with the supplied identifier
|
|
661
|
+
|
|
662
|
+
All requests include a Bearer token issued by your gateway. Implementers can back these routes with S3, MinIO, or any storage provider — the frontend only requires the contract above.
|
|
663
|
+
|
|
664
|
+
These file operations are invoked in tandem with the `/api/embedding/*` endpoints described earlier to keep the vector index in sync.
|
|
665
|
+
|
|
666
|
+
> Quickstart note: the bundled Express gateway does not implement these upload/download routes; they currently return `501` until you connect real storage.
|
|
582
667
|
|
|
583
668
|
## 🤖 AI Provider System
|
|
584
669
|
|
|
@@ -615,11 +700,13 @@ const chatPackageSettings = {
|
|
|
615
700
|
- 🔄 **Provider Switching**: Change backends without frontend updates
|
|
616
701
|
- 🛡️ **Authentication**: Unified auth across all AI services
|
|
617
702
|
|
|
618
|
-
**Gateway Requirements:**
|
|
703
|
+
**Gateway Requirements:**
|
|
619
704
|
Your gateway API can be built with any technology (Node.js, Python, .NET, Java, etc.) as long as it implements:
|
|
620
|
-
- `GET /api/health`
|
|
621
|
-
- `
|
|
622
|
-
- `POST /api/generate` -
|
|
705
|
+
- `GET /api/health` — Health check endpoint that lists available providers.
|
|
706
|
+
- `GET /api/models` and `GET /api/models/{provider}` — Model discovery for the management UI.
|
|
707
|
+
- `POST /api/chat/completions` and `POST /api/generate` — Default OpenAI-style routes when no provider override is present.
|
|
708
|
+
- `POST /api/{provider}/chat/completions` and `POST /api/{provider}/generate` — Provider-specific routing for `openai`, `azure-openai`, and `anthropic`.
|
|
709
|
+
- `POST /api/ollama/chat` and `POST /api/ollama/generate` — Native Ollama routes (no `/chat/completions` suffix).
|
|
623
710
|
|
|
624
711
|
### Legacy Direct Providers
|
|
625
712
|
|
|
@@ -647,8 +734,6 @@ aiProvider: {
|
|
|
647
734
|
3. **Test Connection**: Use the Management interface to validate
|
|
648
735
|
4. **Update API Keys**: Move keys from frontend to backend config
|
|
649
736
|
|
|
650
|
-
See `GATEWAY_MIGRATION_GUIDE.md` for detailed migration steps.
|
|
651
|
-
|
|
652
737
|
### Image/Multimodal Support
|
|
653
738
|
|
|
654
739
|
The Bandit Engine provides comprehensive image support across all AI providers through the gateway architecture:
|
|
@@ -683,22 +768,32 @@ The Bandit Engine provides comprehensive image support across all AI providers t
|
|
|
683
768
|
Your gateway API should accept images in the standardized format sent by the Bandit Engine and forward them appropriately to each provider. No transformation needed - the frontend handles provider-specific formatting.
|
|
684
769
|
|
|
685
770
|
```javascript
|
|
686
|
-
// Example: Gateway forwards images as-is
|
|
687
|
-
app.post('/api/chat/completions', async (req, res) => {
|
|
688
|
-
const {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
771
|
+
// Example: Gateway forwards images as-is using provider-specific routes
|
|
772
|
+
app.post('/api/openai/chat/completions', async (req, res) => {
|
|
773
|
+
const { messages, ...options } = req.body;
|
|
774
|
+
const response = await fetch('https://api.openai.com/v1/chat/completions', {
|
|
775
|
+
method: 'POST',
|
|
776
|
+
headers: {
|
|
777
|
+
'Content-Type': 'application/json',
|
|
778
|
+
Authorization: `Bearer ${process.env.OPENAI_API_KEY}`
|
|
779
|
+
},
|
|
780
|
+
body: JSON.stringify({ messages, ...options })
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
res.status(response.status);
|
|
784
|
+
response.body?.pipe(res);
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
app.post('/api/ollama/chat', async (req, res) => {
|
|
788
|
+
const { messages, ...options } = req.body;
|
|
789
|
+
const response = await fetch(`${process.env.OLLAMA_URL}/api/chat`, {
|
|
790
|
+
method: 'POST',
|
|
791
|
+
headers: { 'Content-Type': 'application/json' },
|
|
792
|
+
body: JSON.stringify({ messages, ...options })
|
|
793
|
+
});
|
|
794
|
+
|
|
795
|
+
res.status(response.status);
|
|
796
|
+
response.body?.pipe(res);
|
|
702
797
|
});
|
|
703
798
|
```
|
|
704
799
|
|
|
@@ -966,7 +1061,7 @@ Your gateway API should validate subscription tiers and return appropriate featu
|
|
|
966
1061
|
|
|
967
1062
|
```javascript
|
|
968
1063
|
// Example: Gateway API subscription validation
|
|
969
|
-
app.post('/api/chat/completions', authenticateJWT, async (req, res) => {
|
|
1064
|
+
app.post('/api/openai/chat/completions', authenticateJWT, async (req, res) => {
|
|
970
1065
|
const { subscriptionType, isSubscribed } = req.user;
|
|
971
1066
|
|
|
972
1067
|
// Validate tier access for requested features
|
|
@@ -977,8 +1072,17 @@ app.post('/api/chat/completions', authenticateJWT, async (req, res) => {
|
|
|
977
1072
|
}
|
|
978
1073
|
|
|
979
1074
|
// Proceed with AI request
|
|
980
|
-
const response = await
|
|
981
|
-
|
|
1075
|
+
const response = await fetch('https://api.openai.com/v1/chat/completions', {
|
|
1076
|
+
method: 'POST',
|
|
1077
|
+
headers: {
|
|
1078
|
+
'Content-Type': 'application/json',
|
|
1079
|
+
Authorization: `Bearer ${process.env.OPENAI_API_KEY}`
|
|
1080
|
+
},
|
|
1081
|
+
body: JSON.stringify(req.body)
|
|
1082
|
+
});
|
|
1083
|
+
|
|
1084
|
+
res.status(response.status);
|
|
1085
|
+
response.body?.pipe(res);
|
|
982
1086
|
});
|
|
983
1087
|
```
|
|
984
1088
|
|
|
@@ -1043,7 +1147,7 @@ const chatPackageSettings = {
|
|
|
1043
1147
|
// ❌ Deprecated (still works but not recommended)
|
|
1044
1148
|
const oldSettings = {
|
|
1045
1149
|
ttsUrl: "/api/tts",
|
|
1046
|
-
sttUrl: "/api/stt",
|
|
1150
|
+
sttUrl: "/api/stt/transcribe",
|
|
1047
1151
|
ollamaUrl: "http://localhost:11434",
|
|
1048
1152
|
};
|
|
1049
1153
|
|
|
@@ -1077,7 +1181,7 @@ The Bandit Engine uses a **unified gateway approach** for all backend services.
|
|
|
1077
1181
|
- Output: Audio file or streaming audio
|
|
1078
1182
|
- **Technology-agnostic**: Works with OpenAI TTS, Azure Speech, Google TTS, AWS Polly, Whisper.cpp, or custom implementations
|
|
1079
1183
|
|
|
1080
|
-
- `POST /api/stt` - Speech-to-Text transcription
|
|
1184
|
+
- `POST /api/stt/transcribe` - Speech-to-Text transcription
|
|
1081
1185
|
- Input: Audio file upload (multipart/form-data)
|
|
1082
1186
|
- Output: `{ text: string }` or `{ transcription: string }`
|
|
1083
1187
|
- **Technology-agnostic**: Works with OpenAI Whisper, Azure Speech, Google Speech, AWS Transcribe, local Whisper, or custom implementations
|
|
@@ -1126,7 +1230,7 @@ If you're currently using separate `ttsUrl` and `sttUrl` settings, migrate to th
|
|
|
1126
1230
|
```tsx
|
|
1127
1231
|
const settings = {
|
|
1128
1232
|
ttsUrl: "https://your-tts-service.com/api/tts",
|
|
1129
|
-
sttUrl: "https://your-stt-service.com/api/stt",
|
|
1233
|
+
sttUrl: "https://your-stt-service.com/api/stt/transcribe",
|
|
1130
1234
|
ollamaUrl: "https://your-ollama.com",
|
|
1131
1235
|
};
|
|
1132
1236
|
```
|
|
@@ -1202,11 +1306,13 @@ This codebase includes multiple protection layers:
|
|
|
1202
1306
|
|
|
1203
1307
|
### 👨💻 For Contributors & Developers
|
|
1204
1308
|
|
|
1205
|
-
Before contributing or
|
|
1309
|
+
Before contributing or publishing a new Pull Request, run the available validation scripts:
|
|
1206
1310
|
|
|
1207
1311
|
```bash
|
|
1208
|
-
|
|
1209
|
-
npm run
|
|
1312
|
+
npm run lint # Static analysis for the src tree
|
|
1313
|
+
npm run test # Vitest suite
|
|
1314
|
+
npm run build # Generate the dist bundle with tsup
|
|
1315
|
+
npm run validate-protection # Ensure license headers and fingerprints are intact
|
|
1210
1316
|
```
|
|
1211
1317
|
|
|
1212
1318
|
**Developer Resources:**
|
|
@@ -1227,7 +1333,6 @@ All source files must include proper license headers and watermarks. The protect
|
|
|
1227
1333
|
```bash
|
|
1228
1334
|
npm run protect # Apply protection to new files
|
|
1229
1335
|
npm run validate-protection # Check for license violations
|
|
1230
|
-
npm run pre-push # Complete pre-push validation
|
|
1231
1336
|
```
|
|
1232
1337
|
|
|
1233
1338
|
---
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAIProviderStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IHJPVIGB.mjs";
|
|
4
4
|
import "./chunk-KCI46M23.mjs";
|
|
5
5
|
import "./chunk-BJTO5JO5.mjs";
|
|
6
6
|
export {
|
|
7
7
|
useAIProviderStore
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=aiProviderStore-
|
|
9
|
+
//# sourceMappingURL=aiProviderStore-3YS2BZU3.mjs.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chat_default
|
|
3
|
+
} from "./chunk-5UVULH77.mjs";
|
|
4
|
+
import "./chunk-ONQMRE2G.mjs";
|
|
5
|
+
import "./chunk-RTQDQ6TC.mjs";
|
|
6
|
+
import "./chunk-XEG45Q6V.mjs";
|
|
7
|
+
import "./chunk-UMPVXYVC.mjs";
|
|
8
|
+
import "./chunk-XUBYA5I7.mjs";
|
|
9
|
+
import "./chunk-IHJPVIGB.mjs";
|
|
10
|
+
import "./chunk-KCI46M23.mjs";
|
|
11
|
+
import "./chunk-BJTO5JO5.mjs";
|
|
12
|
+
export {
|
|
13
|
+
chat_default as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chat-ZPJNWIXI.mjs.map
|