@burtson-labs/bandit-engine 2.0.8
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 +43 -0
- package/README.md +1235 -0
- package/dist/aiProviderStore-YWJHSWFA.mjs +9 -0
- package/dist/aiProviderStore-YWJHSWFA.mjs.map +1 -0
- package/dist/chat-QXB526NZ.mjs +11 -0
- package/dist/chat-QXB526NZ.mjs.map +1 -0
- package/dist/chunk-AVC6IZJQ.mjs +2157 -0
- package/dist/chunk-AVC6IZJQ.mjs.map +1 -0
- package/dist/chunk-BIPELT57.mjs +24183 -0
- package/dist/chunk-BIPELT57.mjs.map +1 -0
- package/dist/chunk-BJTO5JO5.mjs +11 -0
- package/dist/chunk-BJTO5JO5.mjs.map +1 -0
- package/dist/chunk-IXIM7BNO.mjs +39 -0
- package/dist/chunk-IXIM7BNO.mjs.map +1 -0
- package/dist/chunk-KCI46M23.mjs +106 -0
- package/dist/chunk-KCI46M23.mjs.map +1 -0
- package/dist/chunk-WYS5CZVG.mjs +843 -0
- package/dist/chunk-WYS5CZVG.mjs.map +1 -0
- package/dist/cli/cli.js +1808 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/index.d.mts +1636 -0
- package/dist/index.d.ts +1636 -0
- package/dist/index.js +40601 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12477 -0
- package/dist/index.mjs.map +1 -0
- package/dist/memoryUtils-33TZKHSQ.mjs +223 -0
- package/dist/memoryUtils-33TZKHSQ.mjs.map +1 -0
- package/dist/modelStore-Y3LZWRQC.mjs +9 -0
- package/dist/modelStore-Y3LZWRQC.mjs.map +1 -0
- package/dist/shared/custom-element.js +73 -0
- package/dist/shared/custom-element.js.map +1 -0
- package/dist/shared/custom-element.mjs +8 -0
- package/dist/shared/custom-element.mjs.map +1 -0
- package/docs/00_intro.md +26 -0
- package/docs/01_quickstart.md +54 -0
- package/docs/02_gateway_api.md +64 -0
- package/docs/03_provider_integration.md +38 -0
- package/docs/04_local_dev.md +43 -0
- package/docs/05_cli_quickstart.md +89 -0
- package/docs/05_contributing.md +33 -0
- package/docs/06_busl_licensing.md +25 -0
- package/docs/README.md +9 -0
- package/docs/api_reference/.nojekyll +1 -0
- package/docs/api_reference/assets/highlight.css +141 -0
- package/docs/api_reference/assets/icons.js +18 -0
- package/docs/api_reference/assets/icons.svg +1 -0
- package/docs/api_reference/assets/main.js +60 -0
- package/docs/api_reference/assets/navigation.js +1 -0
- package/docs/api_reference/assets/search.js +1 -0
- package/docs/api_reference/assets/style.css +1493 -0
- package/docs/api_reference/classes/DebugLogger.html +29 -0
- package/docs/api_reference/classes/FeatureFlagService.html +28 -0
- package/docs/api_reference/classes/NotificationService.html +21 -0
- package/docs/api_reference/classes/StreamingTTSClient.html +19 -0
- package/docs/api_reference/classes/VectorDatabaseService.html +63 -0
- package/docs/api_reference/classes/VectorMigrationService.html +27 -0
- package/docs/api_reference/classes/VoiceService.html +4 -0
- package/docs/api_reference/enums/TTSState.html +6 -0
- package/docs/api_reference/functions/Chat.html +1 -0
- package/docs/api_reference/functions/ChatModal.html +29 -0
- package/docs/api_reference/functions/ChatProvider.html +29 -0
- package/docs/api_reference/functions/FeatureFlagProvider.html +30 -0
- package/docs/api_reference/functions/FeedbackButton.html +29 -0
- package/docs/api_reference/functions/FeedbackModal.html +29 -0
- package/docs/api_reference/functions/Management.html +1 -0
- package/docs/api_reference/functions/NotificationProvider.html +29 -0
- package/docs/api_reference/functions/SubscriptionExpiredGuard.html +31 -0
- package/docs/api_reference/functions/SubscriptionExpiredModal.html +31 -0
- package/docs/api_reference/functions/defineCustomElement.html +1 -0
- package/docs/api_reference/functions/getCriticalConfig.html +1 -0
- package/docs/api_reference/functions/getFeatureMatrix.html +1 -0
- package/docs/api_reference/functions/getStreamingTTSClient.html +1 -0
- package/docs/api_reference/functions/getSystemConstants.html +1 -0
- package/docs/api_reference/functions/getTTSState.html +1 -0
- package/docs/api_reference/functions/handleHttpError.html +2 -0
- package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -0
- package/docs/api_reference/functions/handleValidationError.html +2 -0
- package/docs/api_reference/functions/initializeCoreSystem.html +1 -0
- package/docs/api_reference/functions/pauseTTS.html +1 -0
- package/docs/api_reference/functions/previewTierUpgrade.html +1 -0
- package/docs/api_reference/functions/resumeTTS.html +1 -0
- package/docs/api_reference/functions/showInfoNotification.html +2 -0
- package/docs/api_reference/functions/showSuccessNotification.html +2 -0
- package/docs/api_reference/functions/speakWithStreaming.html +1 -0
- package/docs/api_reference/functions/stopTTS.html +1 -0
- package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -0
- package/docs/api_reference/functions/updateSubscriptionTier.html +2 -0
- package/docs/api_reference/functions/useFeatureFlag.html +2 -0
- package/docs/api_reference/functions/useFeatureVisibility.html +2 -0
- package/docs/api_reference/functions/useFeatures.html +2 -0
- package/docs/api_reference/functions/useGatewayHealth.html +1 -0
- package/docs/api_reference/functions/useGatewayMemory.html +1 -0
- package/docs/api_reference/functions/useGatewayModels.html +1 -0
- package/docs/api_reference/functions/useGlobalTTS.html +2 -0
- package/docs/api_reference/functions/useNotification.html +1 -0
- package/docs/api_reference/functions/useNotificationService.html +6 -0
- package/docs/api_reference/functions/useTTS.html +2 -0
- package/docs/api_reference/functions/useVectorStore.html +13 -0
- package/docs/api_reference/functions/useVoiceStore.html +8 -0
- package/docs/api_reference/functions/useVoices.html +3 -0
- package/docs/api_reference/functions/validateEnvironment.html +1 -0
- package/docs/api_reference/functions/validateSystemIntegrity.html +1 -0
- package/docs/api_reference/index.html +756 -0
- package/docs/api_reference/interfaces/AIChatRequest.html +8 -0
- package/docs/api_reference/interfaces/AIChatResponse.html +3 -0
- package/docs/api_reference/interfaces/AIGenerateRequest.html +5 -0
- package/docs/api_reference/interfaces/AIGenerateResponse.html +3 -0
- package/docs/api_reference/interfaces/AIMessage.html +4 -0
- package/docs/api_reference/interfaces/AIModel.html +6 -0
- package/docs/api_reference/interfaces/AIProviderConfig.html +9 -0
- package/docs/api_reference/interfaces/ChatConfig.html +5 -0
- package/docs/api_reference/interfaces/CreateMemoryOptions.html +7 -0
- package/docs/api_reference/interfaces/FeatureEvaluation.html +14 -0
- package/docs/api_reference/interfaces/FeatureFlagConfig.html +18 -0
- package/docs/api_reference/interfaces/FeatureFlagContextValue.html +16 -0
- package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +4 -0
- package/docs/api_reference/interfaces/FeedbackButtonProps.html +19 -0
- package/docs/api_reference/interfaces/FeedbackCategories.html +6 -0
- package/docs/api_reference/interfaces/FeedbackModalProps.html +4 -0
- package/docs/api_reference/interfaces/FeedbackPriorities.html +5 -0
- package/docs/api_reference/interfaces/FeedbackRequest.html +12 -0
- package/docs/api_reference/interfaces/FeedbackResponse.html +7 -0
- package/docs/api_reference/interfaces/FileUploadResult.html +4 -0
- package/docs/api_reference/interfaces/GatewayChatRequest.html +12 -0
- package/docs/api_reference/interfaces/GatewayChatResponse.html +7 -0
- package/docs/api_reference/interfaces/GatewayContract.html +4 -0
- package/docs/api_reference/interfaces/GatewayGenerateRequest.html +8 -0
- package/docs/api_reference/interfaces/GatewayGenerateResponse.html +12 -0
- package/docs/api_reference/interfaces/GatewayHealthResponse.html +5 -0
- package/docs/api_reference/interfaces/GatewayMemoryRecord.html +7 -0
- package/docs/api_reference/interfaces/GatewayMemoryResponse.html +4 -0
- package/docs/api_reference/interfaces/GatewayMessage.html +5 -0
- package/docs/api_reference/interfaces/GatewayMessageContent.html +4 -0
- package/docs/api_reference/interfaces/GatewayModel.html +9 -0
- package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -0
- package/docs/api_reference/interfaces/MemorySearchFilters.html +5 -0
- package/docs/api_reference/interfaces/MigrationProgress.html +6 -0
- package/docs/api_reference/interfaces/MigrationStatus.html +7 -0
- package/docs/api_reference/interfaces/NotificationConfig.html +5 -0
- package/docs/api_reference/interfaces/NotificationContextType.html +6 -0
- package/docs/api_reference/interfaces/NotificationProviderProps.html +4 -0
- package/docs/api_reference/interfaces/PackageSettings.html +11 -0
- package/docs/api_reference/interfaces/SearchOptions.html +6 -0
- package/docs/api_reference/interfaces/SearchResult.html +5 -0
- package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +7 -0
- package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +6 -0
- package/docs/api_reference/interfaces/TTSOptions.html +5 -0
- package/docs/api_reference/interfaces/TTSProgress.html +6 -0
- package/docs/api_reference/interfaces/TrialUsage.html +6 -0
- package/docs/api_reference/interfaces/UploadRequest.html +9 -0
- package/docs/api_reference/interfaces/UseTTSReturn.html +14 -0
- package/docs/api_reference/interfaces/VectorDocument.html +11 -0
- package/docs/api_reference/interfaces/VectorMemory.html +12 -0
- package/docs/api_reference/interfaces/VectorMemoryMetadata.html +7 -0
- package/docs/api_reference/interfaces/VectorStoreStatus.html +7 -0
- package/docs/api_reference/interfaces/VoiceModelsResponse.html +4 -0
- package/docs/api_reference/interfaces/VoiceState.html +12 -0
- package/docs/api_reference/media/02_gateway_api.md +64 -0
- package/docs/api_reference/media/05_cli_quickstart.md +89 -0
- package/docs/api_reference/media/LICENSE +43 -0
- package/docs/api_reference/media/PRE-PUSH-CHECKLIST.md +10 -0
- package/docs/api_reference/media/PROTECTION-NOTICE.md +60 -0
- package/docs/api_reference/media/PROTECTION-README.md +41 -0
- package/docs/api_reference/media/README-1.md +23 -0
- package/docs/api_reference/media/README.md +9 -0
- package/docs/api_reference/modules.html +123 -0
- package/docs/api_reference/types/FeatureKey.html +2 -0
- package/docs/api_reference/types/FeatureMatrix.html +2 -0
- package/docs/api_reference/types/GatewayQueryOptions.html +1 -0
- package/docs/api_reference/types/LogContext.html +14 -0
- package/docs/api_reference/types/SubscriptionTier.html +2 -0
- package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +2 -0
- package/docs/api_reference/variables/FeatureFlagContext.html +1 -0
- package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +2 -0
- package/docs/api_reference/variables/SYSTEM_FLAGS.html +1 -0
- package/docs/api_reference/variables/authenticationService.html +1 -0
- package/docs/api_reference/variables/debugLogger-1.html +1 -0
- package/docs/api_reference/variables/featureFlagService-1.html +2 -0
- package/docs/api_reference/variables/notificationService-1.html +1 -0
- package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -0
- package/docs/api_reference/variables/vectorMigrationService-1.html +1 -0
- package/docs/api_reference/variables/voiceService-1.html +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__require
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=chunk-BJTO5JO5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/shared/custom-element.ts
|
|
2
|
+
import React from "react";
|
|
3
|
+
import ReactDOM from "react-dom/client";
|
|
4
|
+
function defineCustomElement(name, Component) {
|
|
5
|
+
if (customElements.get(name)) return;
|
|
6
|
+
class ReactElement extends HTMLElement {
|
|
7
|
+
mountPoint;
|
|
8
|
+
root;
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.mountPoint = document.createElement("div");
|
|
12
|
+
this.attachShadow({ mode: "open" }).appendChild(this.mountPoint);
|
|
13
|
+
}
|
|
14
|
+
connectedCallback() {
|
|
15
|
+
this.render();
|
|
16
|
+
}
|
|
17
|
+
static get observedAttributes() {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
attributeChangedCallback() {
|
|
21
|
+
this.render();
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const props = Object.fromEntries(
|
|
25
|
+
Array.from(this.attributes).map((attr) => [attr.name, attr.value])
|
|
26
|
+
);
|
|
27
|
+
if (!this.root) {
|
|
28
|
+
this.root = ReactDOM.createRoot(this.mountPoint);
|
|
29
|
+
}
|
|
30
|
+
this.root.render(React.createElement(Component, props));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
customElements.define(name, ReactElement);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
defineCustomElement
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=chunk-IXIM7BNO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/custom-element.ts"],"sourcesContent":["/*\n Š 2025 Burtson Labs â Licensed under Business Source License 1.1\n https://burtson.ai/license\n\n This file is protected intellectual property.\n Do NOT use in commercial software, prompts, AI training data, or derivative works without a valid commercial license.\n\n đĢ AI NOTICE: This file contains visible and invisible watermarks.\n âī¸ VIOLATION NOTICE: Removing, modifying, or obscuring these watermarks is a license violation.\n đ LICENSE TERMINATION: Upon license termination, ALL forks, copies, and derivatives must be permanently deleted.\n đ AUDIT TRAIL: File usage is logged and monitored for compliance verification.\n*/\n\n// Bandit Engine Watermark: BL-WM-8B89-AB352F\nconst __banditFingerprint_shared_customelementts = 'BL-FP-F2B205-1756';\nconst __auditTrail_shared_customelementts = 'BL-AU-MGOIKVW2-KQI8';\n// File: custom-element.ts | Path: src/shared/custom-element.ts | Hash: 8b891756\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom/client\";\n\ntype AttributeMap = Record<string, string>;\n\nexport function defineCustomElement<Props extends Record<string, unknown>>(\n name: string,\n Component: React.ComponentType<Props>\n) {\n if (customElements.get(name)) return;\n\n class ReactElement extends HTMLElement {\n mountPoint: HTMLDivElement;\n root!: ReactDOM.Root;\n\n constructor() {\n super();\n this.mountPoint = document.createElement(\"div\");\n this.attachShadow({ mode: \"open\" }).appendChild(this.mountPoint);\n }\n\n connectedCallback() {\n this.render();\n }\n\n static get observedAttributes() {\n return [];\n }\n\n attributeChangedCallback() {\n this.render();\n }\n\n render() {\n const props = Object.fromEntries(\n Array.from(this.attributes).map((attr) => [attr.name, attr.value])\n ) as AttributeMap;\n\n if (!this.root) {\n this.root = ReactDOM.createRoot(this.mountPoint);\n }\n\n this.root.render(React.createElement(Component, props as Props));\n }\n }\n\n customElements.define(name, ReactElement);\n}\n"],"mappings":";AAkBA,OAAO,WAAW;AAClB,OAAO,cAAc;AAId,SAAS,oBACd,MACA,WACA;AACA,MAAI,eAAe,IAAI,IAAI,EAAG;AAAA,EAE9B,MAAM,qBAAqB,YAAY;AAAA,IACrC;AAAA,IACA;AAAA,IAEA,cAAc;AACZ,YAAM;AACN,WAAK,aAAa,SAAS,cAAc,KAAK;AAC9C,WAAK,aAAa,EAAE,MAAM,OAAO,CAAC,EAAE,YAAY,KAAK,UAAU;AAAA,IACjE;AAAA,IAEA,oBAAoB;AAClB,WAAK,OAAO;AAAA,IACd;AAAA,IAEA,WAAW,qBAAqB;AAC9B,aAAO,CAAC;AAAA,IACV;AAAA,IAEA,2BAA2B;AACzB,WAAK,OAAO;AAAA,IACd;AAAA,IAEA,SAAS;AACP,YAAM,QAAQ,OAAO;AAAA,QACnB,MAAM,KAAK,KAAK,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,MAAM,KAAK,KAAK,CAAC;AAAA,MACnE;AAEA,UAAI,CAAC,KAAK,MAAM;AACd,aAAK,OAAO,SAAS,WAAW,KAAK,UAAU;AAAA,MACjD;AAEA,WAAK,KAAK,OAAO,MAAM,cAAc,WAAW,KAAc,CAAC;AAAA,IACjE;AAAA,EACF;AAEA,iBAAe,OAAO,MAAM,YAAY;AAC1C;","names":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// src/services/logging/debugLogger.ts
|
|
2
|
+
var DebugLogger = class {
|
|
3
|
+
isDevelopment;
|
|
4
|
+
constructor() {
|
|
5
|
+
this.isDevelopment = this.detectDevelopmentMode();
|
|
6
|
+
}
|
|
7
|
+
detectDevelopmentMode() {
|
|
8
|
+
try {
|
|
9
|
+
const globalFlags = globalThis;
|
|
10
|
+
if (typeof window !== "undefined" && typeof globalFlags.__VITE_IS_PRODUCTION__ !== "undefined") {
|
|
11
|
+
return !globalFlags.__VITE_IS_PRODUCTION__;
|
|
12
|
+
}
|
|
13
|
+
const proc = globalFlags.process;
|
|
14
|
+
if (proc && proc.env) {
|
|
15
|
+
return proc.env.NODE_ENV === "development";
|
|
16
|
+
}
|
|
17
|
+
if (typeof window !== "undefined" && window.location) {
|
|
18
|
+
const devHosts = ["localhost", "127.0.0.1"];
|
|
19
|
+
const devPorts = ["5173", "5183"];
|
|
20
|
+
return devHosts.includes(window.location.hostname) || devPorts.includes(window.location.port);
|
|
21
|
+
}
|
|
22
|
+
} catch (e) {
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Set development mode manually (useful for testing or runtime configuration)
|
|
28
|
+
*/
|
|
29
|
+
setDevelopmentMode(isDev) {
|
|
30
|
+
this.isDevelopment = isDev;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Debug logs - only shown in development mode
|
|
34
|
+
* These are obfuscated/hidden in production builds
|
|
35
|
+
* DISABLED to prevent console flooding during chat processing
|
|
36
|
+
*/
|
|
37
|
+
debug(message, context) {
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Info logs - shown in both development and production
|
|
41
|
+
* Used for important user-facing information
|
|
42
|
+
*/
|
|
43
|
+
info(message, context) {
|
|
44
|
+
const prefix = this.isDevelopment ? "\u2139\uFE0F [INFO]" : "[INFO]";
|
|
45
|
+
if (context) {
|
|
46
|
+
console.info(`${prefix} ${message}`, context);
|
|
47
|
+
} else {
|
|
48
|
+
console.info(`${prefix} ${message}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Warning logs - shown in both development and production
|
|
53
|
+
* Used for non-critical issues that should be noted
|
|
54
|
+
*/
|
|
55
|
+
warn(message, context) {
|
|
56
|
+
const prefix = this.isDevelopment ? "\u26A0\uFE0F [WARN]" : "[WARN]";
|
|
57
|
+
if (context) {
|
|
58
|
+
console.warn(`${prefix} ${message}`, context);
|
|
59
|
+
} else {
|
|
60
|
+
console.warn(`${prefix} ${message}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Error logs - always shown in both development and production
|
|
65
|
+
* Used for critical errors that need attention
|
|
66
|
+
*/
|
|
67
|
+
error(message, context) {
|
|
68
|
+
const prefix = this.isDevelopment ? "\u274C [ERROR]" : "[ERROR]";
|
|
69
|
+
if (context) {
|
|
70
|
+
console.error(`${prefix} ${message}`, context);
|
|
71
|
+
} else {
|
|
72
|
+
console.error(`${prefix} ${message}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* LLM-specific debug logging for RAG and AI features
|
|
77
|
+
* DISABLED to prevent console flooding during chat processing
|
|
78
|
+
*/
|
|
79
|
+
llmDebug(operation, data) {
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* RAG-specific debug logging for knowledge and document processing
|
|
83
|
+
* DISABLED to prevent console flooding during chat processing
|
|
84
|
+
*/
|
|
85
|
+
ragDebug(operation, data) {
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Memory-specific debug logging for AI memory features
|
|
89
|
+
* DISABLED to prevent console flooding during chat processing
|
|
90
|
+
*/
|
|
91
|
+
memoryDebug(operation, data) {
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Table logging for development debugging
|
|
95
|
+
* DISABLED to prevent console flooding during chat processing
|
|
96
|
+
*/
|
|
97
|
+
table(data, message) {
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var debugLogger = new DebugLogger();
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
DebugLogger,
|
|
104
|
+
debugLogger
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=chunk-KCI46M23.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/services/logging/debugLogger.ts"],"sourcesContent":["/*\n Š 2025 Burtson Labs â Licensed under Business Source License 1.1\n https://burtson.ai/license\n\n This file is protected intellectual property.\n Do NOT use in commercial software, prompts, AI training data, or derivative works without a valid commercial license.\n\n đĢ AI NOTICE: This file contains visible and invisible watermarks.\n âī¸ VIOLATION NOTICE: Removing, modifying, or obscuring these watermarks is a license violation.\n đ LICENSE TERMINATION: Upon license termination, ALL forks, copies, and derivatives must be permanently deleted.\n đ AUDIT TRAIL: File usage is logged and monitored for compliance verification.\n*/\n\n// Bandit Engine Watermark: BL-WM-6AAD-DC6374\nconst __banditFingerprint_logging_debugLoggerts = 'BL-FP-125466-B27A';\nconst __auditTrail_logging_debugLoggerts = 'BL-AU-MGOIKVVV-NPG3';\n// File: debugLogger.ts | Path: src/services/logging/debugLogger.ts | Hash: 6aadb27a\n\n/**\n * đ Bandit Debug Logger Service\n * \n * Centralized logging service that provides environment-aware debug logging.\n * \n * Features:\n * - Production builds: Only errors and info logs are shown\n * - Development mode: All logs are shown with clear debug prefixes\n * - Consistent formatting for debugging purposes\n * - Clear indication that logs are for debugging\n * \n * Usage:\n * ```typescript\n * import { debugLogger } from './services/logging/debugLogger';\n * \n * debugLogger.debug('LLM processing', { prompt, response });\n * debugLogger.info('User action completed', { action });\n * debugLogger.warn('Performance warning', { timing });\n * debugLogger.error('Operation failed', { error });\n * ```\n */\n\nexport type LogContext = unknown;\n\nclass DebugLogger {\n private isDevelopment: boolean;\n\n constructor() {\n // Check if we're in development mode using multiple detection methods\n this.isDevelopment = this.detectDevelopmentMode();\n }\n\n private detectDevelopmentMode(): boolean {\n // Check if we're in a development environment\n // This uses a safe approach that works in both ESM and CJS contexts\n try {\n // For browser environments using Vite - check the build-time flag\n const globalFlags = globalThis as typeof globalThis & {\n __VITE_IS_PRODUCTION__?: boolean;\n process?: { env?: { NODE_ENV?: string } };\n };\n\n if (typeof window !== 'undefined' && typeof globalFlags.__VITE_IS_PRODUCTION__ !== 'undefined') {\n return !globalFlags.__VITE_IS_PRODUCTION__;\n }\n \n // For Node.js environments - use try-catch to avoid type errors\n const proc = globalFlags.process;\n if (proc && proc.env) {\n return proc.env.NODE_ENV === 'development';\n }\n \n // For runtime detection, we can also check URL patterns in browser\n if (typeof window !== 'undefined' && window.location) {\n const devHosts = ['localhost', '127.0.0.1'];\n const devPorts = ['5173', '5183']; // common Vite dev ports\n return devHosts.includes(window.location.hostname) ||\n devPorts.includes(window.location.port);\n }\n } catch (e) {\n // If any detection fails, default to development for safety in debug scenarios\n }\n \n // Default to development for safety in debug scenarios\n return true;\n }\n\n /**\n * Set development mode manually (useful for testing or runtime configuration)\n */\n setDevelopmentMode(isDev: boolean): void {\n this.isDevelopment = isDev;\n }\n\n /**\n * Debug logs - only shown in development mode\n * These are obfuscated/hidden in production builds\n * DISABLED to prevent console flooding during chat processing\n */\n debug(message: string, context?: LogContext): void {\n // Debug logging disabled to prevent console flooding\n // Can be re-enabled for specific debugging sessions by uncommenting below:\n // if (this.isDevelopment) {\n // const prefix = 'đ [DEBUG]';\n // if (context) {\n // console.log(`${prefix} ${message}`, context);\n // } else {\n // console.log(`${prefix} ${message}`);\n // }\n // }\n }\n\n /**\n * Info logs - shown in both development and production\n * Used for important user-facing information\n */\n info(message: string, context?: LogContext): void {\n const prefix = this.isDevelopment ? 'âšī¸ [INFO]' : '[INFO]';\n if (context) {\n console.info(`${prefix} ${message}`, context);\n } else {\n console.info(`${prefix} ${message}`);\n }\n }\n\n /**\n * Warning logs - shown in both development and production\n * Used for non-critical issues that should be noted\n */\n warn(message: string, context?: LogContext): void {\n const prefix = this.isDevelopment ? 'â ī¸ [WARN]' : '[WARN]';\n if (context) {\n console.warn(`${prefix} ${message}`, context);\n } else {\n console.warn(`${prefix} ${message}`);\n }\n }\n\n /**\n * Error logs - always shown in both development and production\n * Used for critical errors that need attention\n */\n error(message: string, context?: LogContext): void {\n const prefix = this.isDevelopment ? 'â [ERROR]' : '[ERROR]';\n if (context) {\n console.error(`${prefix} ${message}`, context);\n } else {\n console.error(`${prefix} ${message}`);\n }\n }\n\n /**\n * LLM-specific debug logging for RAG and AI features\n * DISABLED to prevent console flooding during chat processing\n */\n llmDebug(operation: string, data: LogContext): void {\n // LLM debug logging disabled to prevent console flooding\n // Can be re-enabled for specific debugging sessions\n }\n\n /**\n * RAG-specific debug logging for knowledge and document processing\n * DISABLED to prevent console flooding during chat processing\n */\n ragDebug(operation: string, data: LogContext): void {\n // RAG debug logging disabled to prevent console flooding\n // Can be re-enabled for specific debugging sessions\n }\n\n /**\n * Memory-specific debug logging for AI memory features\n * DISABLED to prevent console flooding during chat processing\n */\n memoryDebug(operation: string, data: LogContext): void {\n // Memory debug logging disabled to prevent console flooding\n // Can be re-enabled for specific debugging sessions\n }\n\n /**\n * Table logging for development debugging\n * DISABLED to prevent console flooding during chat processing\n */\n table(data: unknown[], message?: string): void {\n // Table logging disabled to prevent console flooding\n // Can be re-enabled for specific debugging sessions\n }\n}\n\n// Export a singleton instance\nexport const debugLogger = new DebugLogger();\n\n// Export the class for testing purposes\nexport { DebugLogger };\n"],"mappings":";AA0CA,IAAM,cAAN,MAAkB;AAAA,EACR;AAAA,EAER,cAAc;AAEZ,SAAK,gBAAgB,KAAK,sBAAsB;AAAA,EAClD;AAAA,EAEQ,wBAAiC;AAGvC,QAAI;AAEF,YAAM,cAAc;AAKpB,UAAI,OAAO,WAAW,eAAe,OAAO,YAAY,2BAA2B,aAAa;AAC9F,eAAO,CAAC,YAAY;AAAA,MACtB;AAGA,YAAM,OAAO,YAAY;AACzB,UAAI,QAAQ,KAAK,KAAK;AACpB,eAAO,KAAK,IAAI,aAAa;AAAA,MAC/B;AAGA,UAAI,OAAO,WAAW,eAAe,OAAO,UAAU;AACpD,cAAM,WAAW,CAAC,aAAa,WAAW;AAC1C,cAAM,WAAW,CAAC,QAAQ,MAAM;AAChC,eAAO,SAAS,SAAS,OAAO,SAAS,QAAQ,KAC1C,SAAS,SAAS,OAAO,SAAS,IAAI;AAAA,MAC/C;AAAA,IACF,SAAS,GAAG;AAAA,IAEZ;AAGA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,mBAAmB,OAAsB;AACvC,SAAK,gBAAgB;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,SAAiB,SAA4B;AAAA,EAWnD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KAAK,SAAiB,SAA4B;AAChD,UAAM,SAAS,KAAK,gBAAgB,wBAAc;AAClD,QAAI,SAAS;AACX,cAAQ,KAAK,GAAG,MAAM,IAAI,OAAO,IAAI,OAAO;AAAA,IAC9C,OAAO;AACL,cAAQ,KAAK,GAAG,MAAM,IAAI,OAAO,EAAE;AAAA,IACrC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KAAK,SAAiB,SAA4B;AAChD,UAAM,SAAS,KAAK,gBAAgB,wBAAc;AAClD,QAAI,SAAS;AACX,cAAQ,KAAK,GAAG,MAAM,IAAI,OAAO,IAAI,OAAO;AAAA,IAC9C,OAAO;AACL,cAAQ,KAAK,GAAG,MAAM,IAAI,OAAO,EAAE;AAAA,IACrC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,SAAiB,SAA4B;AACjD,UAAM,SAAS,KAAK,gBAAgB,mBAAc;AAClD,QAAI,SAAS;AACX,cAAQ,MAAM,GAAG,MAAM,IAAI,OAAO,IAAI,OAAO;AAAA,IAC/C,OAAO;AACL,cAAQ,MAAM,GAAG,MAAM,IAAI,OAAO,EAAE;AAAA,IACtC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS,WAAmB,MAAwB;AAAA,EAGpD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS,WAAmB,MAAwB;AAAA,EAGpD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAY,WAAmB,MAAwB;AAAA,EAGvD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAiB,SAAwB;AAAA,EAG/C;AACF;AAGO,IAAM,cAAc,IAAI,YAAY;","names":[]}
|