tjbot-ce 3.0.1

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.
Files changed (224) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +382 -0
  3. package/dist/camera/camera.d.ts +62 -0
  4. package/dist/camera/camera.d.ts.map +1 -0
  5. package/dist/camera/camera.js +155 -0
  6. package/dist/camera/camera.js.map +1 -0
  7. package/dist/camera/index.d.ts +18 -0
  8. package/dist/camera/index.d.ts.map +1 -0
  9. package/dist/camera/index.js +18 -0
  10. package/dist/camera/index.js.map +1 -0
  11. package/dist/config/config-types.d.ts +75 -0
  12. package/dist/config/config-types.d.ts.map +1 -0
  13. package/dist/config/config-types.generated.d.ts +495 -0
  14. package/dist/config/config-types.generated.d.ts.map +1 -0
  15. package/dist/config/config-types.generated.js +2 -0
  16. package/dist/config/config-types.generated.js.map +1 -0
  17. package/dist/config/config-types.js +175 -0
  18. package/dist/config/config-types.js.map +1 -0
  19. package/dist/config/index.d.ts +20 -0
  20. package/dist/config/index.d.ts.map +1 -0
  21. package/dist/config/index.js +19 -0
  22. package/dist/config/index.js.map +1 -0
  23. package/dist/config/tjbot-config.d.ts +98 -0
  24. package/dist/config/tjbot-config.d.ts.map +1 -0
  25. package/dist/config/tjbot-config.js +309 -0
  26. package/dist/config/tjbot-config.js.map +1 -0
  27. package/dist/config/vendor/colors.yaml +61 -0
  28. package/dist/config/vendor/model-registry.yaml +275 -0
  29. package/dist/config/vendor/tjbot-config.schema.yaml +792 -0
  30. package/dist/config/vendor/tjbot.default.toml +452 -0
  31. package/dist/led/index.d.ts +20 -0
  32. package/dist/led/index.d.ts.map +1 -0
  33. package/dist/led/index.js +20 -0
  34. package/dist/led/index.js.map +1 -0
  35. package/dist/led/led-common-anode.d.ts +38 -0
  36. package/dist/led/led-common-anode.d.ts.map +1 -0
  37. package/dist/led/led-common-anode.js +79 -0
  38. package/dist/led/led-common-anode.js.map +1 -0
  39. package/dist/led/led-neopixel-spi.d.ts +60 -0
  40. package/dist/led/led-neopixel-spi.d.ts.map +1 -0
  41. package/dist/led/led-neopixel-spi.js +216 -0
  42. package/dist/led/led-neopixel-spi.js.map +1 -0
  43. package/dist/led/led-neopixel-ws281x.js +186 -0
  44. package/dist/led/led-neopixel.d.ts +57 -0
  45. package/dist/led/led-neopixel.d.ts.map +1 -0
  46. package/dist/led/led-neopixel.js +235 -0
  47. package/dist/led/led-neopixel.js.map +1 -0
  48. package/dist/microphone/index.d.ts +18 -0
  49. package/dist/microphone/index.d.ts.map +1 -0
  50. package/dist/microphone/index.js +18 -0
  51. package/dist/microphone/index.js.map +1 -0
  52. package/dist/microphone/microphone.d.ts +65 -0
  53. package/dist/microphone/microphone.d.ts.map +1 -0
  54. package/dist/microphone/microphone.js +179 -0
  55. package/dist/microphone/microphone.js.map +1 -0
  56. package/dist/rpi-drivers/index.d.ts +22 -0
  57. package/dist/rpi-drivers/index.d.ts.map +1 -0
  58. package/dist/rpi-drivers/index.js +22 -0
  59. package/dist/rpi-drivers/index.js.map +1 -0
  60. package/dist/rpi-drivers/rpi-detect.d.ts +24 -0
  61. package/dist/rpi-drivers/rpi-detect.d.ts.map +1 -0
  62. package/dist/rpi-drivers/rpi-detect.js +49 -0
  63. package/dist/rpi-drivers/rpi-detect.js.map +1 -0
  64. package/dist/rpi-drivers/rpi-driver.d.ts +116 -0
  65. package/dist/rpi-drivers/rpi-driver.d.ts.map +1 -0
  66. package/dist/rpi-drivers/rpi-driver.js +261 -0
  67. package/dist/rpi-drivers/rpi-driver.js.map +1 -0
  68. package/dist/rpi-drivers/rpi3-driver.d.ts +47 -0
  69. package/dist/rpi-drivers/rpi3-driver.d.ts.map +1 -0
  70. package/dist/rpi-drivers/rpi3-driver.js +145 -0
  71. package/dist/rpi-drivers/rpi3-driver.js.map +1 -0
  72. package/dist/rpi-drivers/rpi4-driver.d.ts +35 -0
  73. package/dist/rpi-drivers/rpi4-driver.d.ts.map +1 -0
  74. package/dist/rpi-drivers/rpi4-driver.js +101 -0
  75. package/dist/rpi-drivers/rpi4-driver.js.map +1 -0
  76. package/dist/rpi-drivers/rpi5-driver.d.ts +33 -0
  77. package/dist/rpi-drivers/rpi5-driver.d.ts.map +1 -0
  78. package/dist/rpi-drivers/rpi5-driver.js +78 -0
  79. package/dist/rpi-drivers/rpi5-driver.js.map +1 -0
  80. package/dist/servo/index.d.ts +19 -0
  81. package/dist/servo/index.d.ts.map +1 -0
  82. package/dist/servo/index.js +19 -0
  83. package/dist/servo/index.js.map +1 -0
  84. package/dist/servo/servo-constants.d.ts +33 -0
  85. package/dist/servo/servo-constants.d.ts.map +1 -0
  86. package/dist/servo/servo-constants.js +34 -0
  87. package/dist/servo/servo-constants.js.map +1 -0
  88. package/dist/servo/servo-lgpio.d.ts +82 -0
  89. package/dist/servo/servo-lgpio.d.ts.map +1 -0
  90. package/dist/servo/servo-lgpio.js +178 -0
  91. package/dist/servo/servo-lgpio.js.map +1 -0
  92. package/dist/speaker/audio-player.d.ts +30 -0
  93. package/dist/speaker/audio-player.d.ts.map +1 -0
  94. package/dist/speaker/audio-player.js +68 -0
  95. package/dist/speaker/audio-player.js.map +1 -0
  96. package/dist/speaker/index.d.ts +18 -0
  97. package/dist/speaker/index.d.ts.map +1 -0
  98. package/dist/speaker/index.js +18 -0
  99. package/dist/speaker/index.js.map +1 -0
  100. package/dist/speaker/speaker.d.ts +53 -0
  101. package/dist/speaker/speaker.d.ts.map +1 -0
  102. package/dist/speaker/speaker.js +125 -0
  103. package/dist/speaker/speaker.js.map +1 -0
  104. package/dist/stt/backends/azure-stt.d.ts +32 -0
  105. package/dist/stt/backends/azure-stt.d.ts.map +1 -0
  106. package/dist/stt/backends/azure-stt.js +227 -0
  107. package/dist/stt/backends/azure-stt.js.map +1 -0
  108. package/dist/stt/backends/google-cloud-stt.d.ts +31 -0
  109. package/dist/stt/backends/google-cloud-stt.d.ts.map +1 -0
  110. package/dist/stt/backends/google-cloud-stt.js +371 -0
  111. package/dist/stt/backends/google-cloud-stt.js.map +1 -0
  112. package/dist/stt/backends/ibm-watson-stt.d.ts +32 -0
  113. package/dist/stt/backends/ibm-watson-stt.d.ts.map +1 -0
  114. package/dist/stt/backends/ibm-watson-stt.js +190 -0
  115. package/dist/stt/backends/ibm-watson-stt.js.map +1 -0
  116. package/dist/stt/backends/sherpa-onnx-stt.d.ts +117 -0
  117. package/dist/stt/backends/sherpa-onnx-stt.d.ts.map +1 -0
  118. package/dist/stt/backends/sherpa-onnx-stt.js +694 -0
  119. package/dist/stt/backends/sherpa-onnx-stt.js.map +1 -0
  120. package/dist/stt/index.d.ts +20 -0
  121. package/dist/stt/index.d.ts.map +1 -0
  122. package/dist/stt/index.js +21 -0
  123. package/dist/stt/index.js.map +1 -0
  124. package/dist/stt/stt-engine.d.ts +68 -0
  125. package/dist/stt/stt-engine.d.ts.map +1 -0
  126. package/dist/stt/stt-engine.js +99 -0
  127. package/dist/stt/stt-engine.js.map +1 -0
  128. package/dist/stt/stt-utils.d.ts +36 -0
  129. package/dist/stt/stt-utils.d.ts.map +1 -0
  130. package/dist/stt/stt-utils.js +112 -0
  131. package/dist/stt/stt-utils.js.map +1 -0
  132. package/dist/stt/stt.d.ts +52 -0
  133. package/dist/stt/stt.d.ts.map +1 -0
  134. package/dist/stt/stt.js +100 -0
  135. package/dist/stt/stt.js.map +1 -0
  136. package/dist/tjbot.d.ts +317 -0
  137. package/dist/tjbot.d.ts.map +1 -0
  138. package/dist/tjbot.js +736 -0
  139. package/dist/tjbot.js.map +1 -0
  140. package/dist/tts/backends/azure-tts.d.ts +30 -0
  141. package/dist/tts/backends/azure-tts.d.ts.map +1 -0
  142. package/dist/tts/backends/azure-tts.js +92 -0
  143. package/dist/tts/backends/azure-tts.js.map +1 -0
  144. package/dist/tts/backends/google-cloud-tts.d.ts +38 -0
  145. package/dist/tts/backends/google-cloud-tts.d.ts.map +1 -0
  146. package/dist/tts/backends/google-cloud-tts.js +116 -0
  147. package/dist/tts/backends/google-cloud-tts.js.map +1 -0
  148. package/dist/tts/backends/ibm-watson-tts.d.ts +42 -0
  149. package/dist/tts/backends/ibm-watson-tts.d.ts.map +1 -0
  150. package/dist/tts/backends/ibm-watson-tts.js +99 -0
  151. package/dist/tts/backends/ibm-watson-tts.js.map +1 -0
  152. package/dist/tts/backends/sherpa-onnx-tts.d.ts +80 -0
  153. package/dist/tts/backends/sherpa-onnx-tts.d.ts.map +1 -0
  154. package/dist/tts/backends/sherpa-onnx-tts.js +237 -0
  155. package/dist/tts/backends/sherpa-onnx-tts.js.map +1 -0
  156. package/dist/tts/index.d.ts +19 -0
  157. package/dist/tts/index.d.ts.map +1 -0
  158. package/dist/tts/index.js +20 -0
  159. package/dist/tts/index.js.map +1 -0
  160. package/dist/tts/tts-engine.d.ts +67 -0
  161. package/dist/tts/tts-engine.d.ts.map +1 -0
  162. package/dist/tts/tts-engine.js +109 -0
  163. package/dist/tts/tts-engine.js.map +1 -0
  164. package/dist/tts/tts.d.ts +47 -0
  165. package/dist/tts/tts.d.ts.map +1 -0
  166. package/dist/tts/tts.js +101 -0
  167. package/dist/tts/tts.js.map +1 -0
  168. package/dist/utils/colors.d.ts +39 -0
  169. package/dist/utils/colors.d.ts.map +1 -0
  170. package/dist/utils/colors.js +155 -0
  171. package/dist/utils/colors.js.map +1 -0
  172. package/dist/utils/constants.d.ts +41 -0
  173. package/dist/utils/constants.d.ts.map +1 -0
  174. package/dist/utils/constants.js +43 -0
  175. package/dist/utils/constants.js.map +1 -0
  176. package/dist/utils/credentials.d.ts +43 -0
  177. package/dist/utils/credentials.d.ts.map +1 -0
  178. package/dist/utils/credentials.js +121 -0
  179. package/dist/utils/credentials.js.map +1 -0
  180. package/dist/utils/errors.d.ts +26 -0
  181. package/dist/utils/errors.d.ts.map +1 -0
  182. package/dist/utils/errors.js +32 -0
  183. package/dist/utils/errors.js.map +1 -0
  184. package/dist/utils/index.d.ts +25 -0
  185. package/dist/utils/index.d.ts.map +1 -0
  186. package/dist/utils/index.js +23 -0
  187. package/dist/utils/index.js.map +1 -0
  188. package/dist/utils/logging.d.ts +44 -0
  189. package/dist/utils/logging.d.ts.map +1 -0
  190. package/dist/utils/logging.js +113 -0
  191. package/dist/utils/logging.js.map +1 -0
  192. package/dist/utils/model-registry.d.ts +142 -0
  193. package/dist/utils/model-registry.d.ts.map +1 -0
  194. package/dist/utils/model-registry.js +391 -0
  195. package/dist/utils/model-registry.js.map +1 -0
  196. package/dist/utils/utils.d.ts +33 -0
  197. package/dist/utils/utils.d.ts.map +1 -0
  198. package/dist/utils/utils.js +50 -0
  199. package/dist/utils/utils.js.map +1 -0
  200. package/dist/vision/backends/azure-vision.d.ts +33 -0
  201. package/dist/vision/backends/azure-vision.d.ts.map +1 -0
  202. package/dist/vision/backends/azure-vision.js +151 -0
  203. package/dist/vision/backends/azure-vision.js.map +1 -0
  204. package/dist/vision/backends/google-cloud-vision.d.ts +32 -0
  205. package/dist/vision/backends/google-cloud-vision.d.ts.map +1 -0
  206. package/dist/vision/backends/google-cloud-vision.js +193 -0
  207. package/dist/vision/backends/google-cloud-vision.js.map +1 -0
  208. package/dist/vision/backends/onnx.d.ts +116 -0
  209. package/dist/vision/backends/onnx.d.ts.map +1 -0
  210. package/dist/vision/backends/onnx.js +781 -0
  211. package/dist/vision/backends/onnx.js.map +1 -0
  212. package/dist/vision/index.d.ts +19 -0
  213. package/dist/vision/index.d.ts.map +1 -0
  214. package/dist/vision/index.js +20 -0
  215. package/dist/vision/index.js.map +1 -0
  216. package/dist/vision/vision-engine.d.ts +131 -0
  217. package/dist/vision/vision-engine.d.ts.map +1 -0
  218. package/dist/vision/vision-engine.js +97 -0
  219. package/dist/vision/vision-engine.js.map +1 -0
  220. package/dist/vision/vision.d.ts +48 -0
  221. package/dist/vision/vision.d.ts.map +1 -0
  222. package/dist/vision/vision.js +83 -0
  223. package/dist/vision/vision.js.map +1 -0
  224. package/package.json +124 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Get the list of all colors recognized by TJBot.
18
+ * @return {string[]} List of all named colors recognized by `shine()` and `pulse()`.
19
+ * @public
20
+ */
21
+ export declare function getShineColors(): string[];
22
+ /**
23
+ * Convert hex color to RGB value.
24
+ * @param {string} hexColor Hex color (e.g. FF8888)
25
+ * @return {array} RGB color (e.g. (255, 128, 128))
26
+ * @private
27
+ */
28
+ export declare function convertHexToRgbColor(hexColor: string): [number, number, number];
29
+ /**
30
+ * Normalize the given color to #RRGGBB.
31
+ * @param {string} color The color to shine the LED. May be specified in a number of
32
+ * formats, including: hexadecimal, (e.g. "0xF12AC4", "11FF22", "#AABB24"), "on", "off",
33
+ * or may be a named color from TJBot's curated LED color list. Hexadecimal colors
34
+ * follow an #RRGGBB format.
35
+ * @return {string} Hex string corresponding to the given color (e.g. "#RRGGBB")
36
+ * @private
37
+ */
38
+ export declare function normalizeColor(color: string): string;
39
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA2DH;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAGzC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAgB/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA6DpD"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { readFileSync } from 'fs';
17
+ import yaml from 'js-yaml';
18
+ import { dirname, join } from 'path';
19
+ import { fileURLToPath } from 'url';
20
+ import { TJBotError } from './errors.js';
21
+ import { getLogger } from './logging.js';
22
+ const logger = getLogger(import.meta.url);
23
+ const DIRNAME = dirname(fileURLToPath(import.meta.url));
24
+ /**
25
+ * Color map: normalized color name (lowercase, no spaces) -> hex value
26
+ * @private
27
+ */
28
+ const colorMap = new Map();
29
+ /**
30
+ * Original color names (for getShineColors())
31
+ * @private
32
+ */
33
+ const colorNames = [];
34
+ let colorsLoaded = false;
35
+ /**
36
+ * Load colors from YAML file
37
+ * @private
38
+ */
39
+ function loadColors() {
40
+ try {
41
+ const colorsPath = join(DIRNAME, '../config/vendor/colors.yaml');
42
+ const colorsYaml = readFileSync(colorsPath, 'utf8');
43
+ const colors = yaml.load(colorsYaml);
44
+ for (const [name, hex] of Object.entries(colors)) {
45
+ // Store original name for listing
46
+ colorNames.push(name);
47
+ // Normalize: remove all whitespace and convert to lowercase
48
+ const normalizedName = name.replace(/\s+/g, '').toLowerCase();
49
+ colorMap.set(normalizedName, hex);
50
+ }
51
+ logger.debug(`loaded ${colorNames.length} colors for LED control`);
52
+ }
53
+ catch (error) {
54
+ logger.error('Failed to load colors.yaml:', error);
55
+ throw new TJBotError('Failed to load LED color definitions');
56
+ }
57
+ }
58
+ function ensureColorsLoaded() {
59
+ if (!colorsLoaded) {
60
+ loadColors();
61
+ colorsLoaded = true;
62
+ }
63
+ }
64
+ /**
65
+ * Get the list of all colors recognized by TJBot.
66
+ * @return {string[]} List of all named colors recognized by `shine()` and `pulse()`.
67
+ * @public
68
+ */
69
+ export function getShineColors() {
70
+ ensureColorsLoaded();
71
+ return [...colorNames];
72
+ }
73
+ /**
74
+ * Convert hex color to RGB value.
75
+ * @param {string} hexColor Hex color (e.g. FF8888)
76
+ * @return {array} RGB color (e.g. (255, 128, 128))
77
+ * @private
78
+ */
79
+ export function convertHexToRgbColor(hexColor) {
80
+ const rgbHex = hexColor
81
+ .replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (_m, r, g, b) => `#${r}${r}${g}${g}${b}${b}`)
82
+ .substring(1)
83
+ .match(/.{2}/g);
84
+ if (rgbHex !== null) {
85
+ const rgb = rgbHex.map((x) => parseInt(x, 16));
86
+ return [rgb[0], rgb[1], rgb[2]];
87
+ }
88
+ else {
89
+ logger.warn(`An error occurred converting hex color ${hexColor} to RGB, returning [0, 0, 0]`);
90
+ return [0, 0, 0];
91
+ }
92
+ }
93
+ /**
94
+ * Normalize the given color to #RRGGBB.
95
+ * @param {string} color The color to shine the LED. May be specified in a number of
96
+ * formats, including: hexadecimal, (e.g. "0xF12AC4", "11FF22", "#AABB24"), "on", "off",
97
+ * or may be a named color from TJBot's curated LED color list. Hexadecimal colors
98
+ * follow an #RRGGBB format.
99
+ * @return {string} Hex string corresponding to the given color (e.g. "#RRGGBB")
100
+ * @private
101
+ */
102
+ export function normalizeColor(color) {
103
+ ensureColorsLoaded();
104
+ let normColor = color;
105
+ // assume undefined == "off"
106
+ if (normColor === undefined) {
107
+ normColor = 'off';
108
+ }
109
+ // strip prefixes if they are present
110
+ if (normColor.startsWith('0x')) {
111
+ normColor = normColor.slice(2);
112
+ }
113
+ if (normColor.startsWith('#')) {
114
+ normColor = normColor.slice(1);
115
+ }
116
+ // is this a hex number or a named color?
117
+ const isHex = /(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i;
118
+ let rgb;
119
+ if (!isHex.test(normColor)) {
120
+ // Look up named color in our curated color map
121
+ const normalizedName = normColor.replace(/\s+/g, '').toLowerCase();
122
+ const hexValue = colorMap.get(normalizedName);
123
+ if (hexValue) {
124
+ rgb = hexValue;
125
+ }
126
+ else {
127
+ rgb = undefined;
128
+ }
129
+ }
130
+ else {
131
+ rgb = normColor;
132
+ }
133
+ // Expand CSS-style short hex (#abc → #aabbcc)
134
+ if (rgb !== undefined && rgb.replace(/^#/, '').length === 3) {
135
+ rgb = rgb
136
+ .replace(/^#/, '')
137
+ .split('')
138
+ .map((ch) => ch + ch)
139
+ .join('');
140
+ }
141
+ // did we get something back?
142
+ if (rgb === undefined) {
143
+ throw new TJBotError(`TJBot did not understand the specified color "${color}"`);
144
+ }
145
+ // prefix rgb with # in case it's not
146
+ if (!rgb.startsWith('#')) {
147
+ rgb = `#${rgb}`;
148
+ }
149
+ // throw an error if we didn't understand this color
150
+ if (rgb.length !== 7) {
151
+ throw new TJBotError(`TJBot did not understand the specified color "${color}"`);
152
+ }
153
+ return rgb;
154
+ }
155
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC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,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,oDAAoD;IACpD,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,UAAU,CAAC,iDAAiD,KAAK,GAAG,CAAC,CAAC;IACpF,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright 2025 IBM Corp. All Rights Reserved.
3
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * TJBot capabilities
19
+ * @readonly
20
+ * @enum {string}
21
+ */
22
+ export declare enum Capability {
23
+ LISTEN = "listen",
24
+ SEE = "see",
25
+ SHINE = "shine",
26
+ SPEAK = "speak",
27
+ WAVE = "wave"
28
+ }
29
+ /**
30
+ * TJBot hardware
31
+ * @readonly
32
+ * @enum {string}
33
+ */
34
+ export declare enum Hardware {
35
+ CAMERA = "camera",
36
+ LED = "led",
37
+ MICROPHONE = "microphone",
38
+ SERVO = "servo",
39
+ SPEAKER = "speaker"
40
+ }
41
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,oBAAY,UAAU;IAClB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;CAChB;AAED;;;;GAIG;AACH,oBAAY,QAAQ;IAChB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;CACtB"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright 2025 IBM Corp. All Rights Reserved.
3
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * TJBot capabilities
19
+ * @readonly
20
+ * @enum {string}
21
+ */
22
+ export var Capability;
23
+ (function (Capability) {
24
+ Capability["LISTEN"] = "listen";
25
+ Capability["SEE"] = "see";
26
+ Capability["SHINE"] = "shine";
27
+ Capability["SPEAK"] = "speak";
28
+ Capability["WAVE"] = "wave";
29
+ })(Capability || (Capability = {}));
30
+ /**
31
+ * TJBot hardware
32
+ * @readonly
33
+ * @enum {string}
34
+ */
35
+ export var Hardware;
36
+ (function (Hardware) {
37
+ Hardware["CAMERA"] = "camera";
38
+ Hardware["LED"] = "led";
39
+ Hardware["MICROPHONE"] = "microphone";
40
+ Hardware["SERVO"] = "servo";
41
+ Hardware["SPEAKER"] = "speaker";
42
+ })(Hardware || (Hardware = {}));
43
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,2BAAa,CAAA;AACjB,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,6BAAiB,CAAA;IACjB,uBAAW,CAAA;IACX,qCAAyB,CAAA;IACzB,2BAAe,CAAA;IACf,+BAAmB,CAAA;AACvB,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export interface AzureCredentials {
17
+ speechKey?: string;
18
+ speechRegion?: string;
19
+ visionKey?: string;
20
+ visionEndpoint?: string;
21
+ }
22
+ /**
23
+ * Resolves a credentials file path by checking provided path, then CWD, then ~/.tjbot.
24
+ * @param filename - The filename to look for (e.g., 'azure-credentials.env')
25
+ * @param providedPath - Optional explicit path to check first
26
+ * @throws {TJBotError} if no credentials file is found
27
+ */
28
+ export declare function resolveCredentialsPath(filename: string, providedPath?: string): string;
29
+ /**
30
+ * Resolves, loads, and exports Azure credentials.
31
+ */
32
+ export declare function loadAzureCredentials(providedPath?: string): AzureCredentials;
33
+ /**
34
+ * Resolves Google Cloud credentials and exports credentials path for ADC.
35
+ */
36
+ export declare function loadGoogleCloudCredentials(providedPath?: string): {
37
+ credentialsPath: string;
38
+ };
39
+ /**
40
+ * Resolves, loads, and exports IBM Watson credentials.
41
+ */
42
+ export declare function loadIBMWatsonCloudCredentials(providedPath?: string): void;
43
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/utils/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,MAAM,WAAW,gBAAgB;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAqBtF;AAiCD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAkB5E;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAW7F;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CASzE"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import fs from 'fs';
17
+ import os from 'os';
18
+ import path from 'path';
19
+ import { TJBotError } from './errors.js';
20
+ import { getLogger } from './logging.js';
21
+ const logger = getLogger(import.meta.url);
22
+ /**
23
+ * Resolves a credentials file path by checking provided path, then CWD, then ~/.tjbot.
24
+ * @param filename - The filename to look for (e.g., 'azure-credentials.env')
25
+ * @param providedPath - Optional explicit path to check first
26
+ * @throws {TJBotError} if no credentials file is found
27
+ */
28
+ export function resolveCredentialsPath(filename, providedPath) {
29
+ if (providedPath) {
30
+ logger.verbose(`Using specified path for credentials: ${providedPath}`);
31
+ if (!fs.existsSync(providedPath)) {
32
+ throw new TJBotError(`Credentials file not found at: ${providedPath}`);
33
+ }
34
+ return providedPath;
35
+ }
36
+ const defaultPaths = [path.join(process.cwd(), filename), path.join(os.homedir(), '.tjbot', filename)];
37
+ for (const defaultPath of defaultPaths) {
38
+ if (fs.existsSync(defaultPath)) {
39
+ logger.verbose(`Found credentials file at: ${defaultPath}`);
40
+ return defaultPath;
41
+ }
42
+ }
43
+ throw new TJBotError(`Credentials file ${filename} not found. Place credentials at: ./${filename} or ~/.tjbot/${filename}`);
44
+ }
45
+ /**
46
+ * Parses a .env format credentials file into key-value pairs.
47
+ */
48
+ function parseEnvCredentialsFile(credentialsPath) {
49
+ const raw = {};
50
+ fs.readFileSync(credentialsPath, 'utf-8')
51
+ .split('\n')
52
+ .forEach((line) => {
53
+ line = line.trim();
54
+ if (line && !line.startsWith('#')) {
55
+ const [key, ...valueParts] = line.split('=');
56
+ if (key) {
57
+ raw[key.trim()] = valueParts.join('=').trim();
58
+ }
59
+ }
60
+ });
61
+ logger.debug(`Parsed ${Object.keys(raw).length} credentials from file: ${credentialsPath}`);
62
+ return raw;
63
+ }
64
+ /**
65
+ * Loads credentials into environment variables.
66
+ * @param credentials - A record of key-value pairs representing credentials
67
+ */
68
+ function loadCredentialsIntoEnvironment(credentials) {
69
+ Object.entries(credentials).forEach(([key, value]) => {
70
+ process.env[key] = value;
71
+ logger.debug(`loaded credential into environment: ${key}=***`);
72
+ });
73
+ }
74
+ /**
75
+ * Resolves, loads, and exports Azure credentials.
76
+ */
77
+ export function loadAzureCredentials(providedPath) {
78
+ const credentialsPath = resolveCredentialsPath('azure-credentials.env', providedPath);
79
+ logger.verbose(`Loading Azure credentials from file: ${credentialsPath}`);
80
+ try {
81
+ const raw = parseEnvCredentialsFile(credentialsPath);
82
+ loadCredentialsIntoEnvironment(raw);
83
+ logger.debug(`Loaded Azure credentials from: ${credentialsPath}`);
84
+ return {
85
+ speechKey: raw.AZURE_SPEECH_KEY,
86
+ speechRegion: raw.AZURE_SPEECH_REGION,
87
+ visionKey: raw.AZURE_VISION_KEY,
88
+ visionEndpoint: raw.AZURE_VISION_ENDPOINT,
89
+ };
90
+ }
91
+ catch (err) {
92
+ throw new TJBotError(`Failed to load Azure credentials from ${credentialsPath}`, { cause: err });
93
+ }
94
+ }
95
+ /**
96
+ * Resolves Google Cloud credentials and exports credentials path for ADC.
97
+ */
98
+ export function loadGoogleCloudCredentials(providedPath) {
99
+ const credentialsPath = resolveCredentialsPath('google-credentials.json', providedPath);
100
+ logger.verbose(`Loading Google Cloud credentials from file: ${credentialsPath}`);
101
+ if (!fs.existsSync(credentialsPath)) {
102
+ throw new TJBotError(`Google Cloud credentials file not found at: ${credentialsPath}`);
103
+ }
104
+ loadCredentialsIntoEnvironment({ GOOGLE_APPLICATION_CREDENTIALS: credentialsPath });
105
+ return { credentialsPath };
106
+ }
107
+ /**
108
+ * Resolves, loads, and exports IBM Watson credentials.
109
+ */
110
+ export function loadIBMWatsonCloudCredentials(providedPath) {
111
+ const credentialsPath = resolveCredentialsPath('ibm-credentials.env', providedPath);
112
+ logger.verbose(`Loading IBM Watson credentials from file: ${credentialsPath}`);
113
+ try {
114
+ const raw = parseEnvCredentialsFile(credentialsPath);
115
+ loadCredentialsIntoEnvironment(raw);
116
+ }
117
+ catch (err) {
118
+ throw new TJBotError(`Failed to load IBM Watson credentials from ${credentialsPath}`, { cause: err });
119
+ }
120
+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AAC,CAAC;IAC/E,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC;QACrD,8BAA8B,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,IAAI,UAAU,CAAC,8CAA8C,eAAe,EAAE,EAAE,EAAE,KAAK,EAAE,GAAY,EAAE,CAAC,CAAC;IACnH,CAAC;AACL,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare class TJBotError extends Error {
17
+ readonly code?: string;
18
+ readonly context?: Record<string, unknown>;
19
+ readonly cause?: Error;
20
+ constructor(message: string, options?: {
21
+ code?: string;
22
+ context?: Record<string, unknown>;
23
+ cause?: Error;
24
+ });
25
+ }
26
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE;CAY7G"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export class TJBotError extends Error {
17
+ code;
18
+ context;
19
+ cause;
20
+ constructor(message, options) {
21
+ super(message);
22
+ this.name = 'TJBotError';
23
+ this.code = options?.code;
24
+ this.context = options?.context;
25
+ this.cause = options?.cause;
26
+ // Maintain proper stack trace for where our error was thrown (only available on V8)
27
+ if (Error.captureStackTrace) {
28
+ Error.captureStackTrace(this, TJBotError);
29
+ }
30
+ }
31
+ }
32
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACxB,IAAI,CAAU;IACd,OAAO,CAA2B;IAClC,KAAK,CAAS;IAEvB,YAAY,OAAe,EAAE,OAA6E;QACtG,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,CAAC;QAE5B,oFAAoF;QACpF,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright 2025 IBM Corp. All Rights Reserved.
3
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export { convertHexToRgbColor, getShineColors, normalizeColor } from './colors.js';
18
+ export { Capability, Hardware } from './constants.js';
19
+ export { TJBotError } from './errors.js';
20
+ export { getLogger, initWinston } from './logging.js';
21
+ export type { TJBotLogLevel } from './logging.js';
22
+ export { ModelRegistry } from './model-registry.js';
23
+ export type { BaseModelMetadata, ModelType, STTModelMetadata, TTSModelMetadata, VADModelMetadata, VisionModelMetadata, } from './model-registry.js';
24
+ export { isCommandAvailable, sleep, sleepSync } from './utils.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright 2025 IBM Corp. All Rights Reserved.
3
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export { convertHexToRgbColor, getShineColors, normalizeColor } from './colors.js';
18
+ export { Capability, Hardware } from './constants.js';
19
+ export { TJBotError } from './errors.js';
20
+ export { getLogger, initWinston } from './logging.js';
21
+ export { ModelRegistry } from './model-registry.js';
22
+ export { isCommandAvailable, sleep, sleepSync } from './utils.js';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Copyright 2026-present TJBot Contributors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import winston from 'winston';
17
+ export type TJBotLogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug';
18
+ export declare enum LogEmoji {
19
+ CAMERA = "\uD83D\uDCF7",
20
+ COLOR = "\uD83C\uDFA8",
21
+ CONFIG = "\u2699\uFE0F",
22
+ GENERAL = "\uD83E\uDD16",
23
+ HARDWARE = "\uD83D\uDD27",
24
+ LED = "\uD83D\uDCA1",
25
+ MIC = "\uD83C\uDFA4",
26
+ MODEL = "\uD83D\uDCE6",
27
+ RPI = "\uD83C\uDF53",
28
+ SERVO = "\uD83E\uDDBE",
29
+ SPEAKER = "\uD83D\uDD08",
30
+ STT = "\uD83E\uDDBB",
31
+ TTS = "\uD83D\uDCAC",
32
+ VISION = "\uD83D\uDC41\uFE0F"
33
+ }
34
+ /**
35
+ * Initialize Winston with TJBot's default formatter.
36
+ * Safe to call repeatedly; only the first call configures transports/format.
37
+ * Later calls only update log level.
38
+ */
39
+ export declare function initWinston(level?: TJBotLogLevel): void;
40
+ /**
41
+ * Get a module-scoped logger that lets the formatter infer a category emoji.
42
+ */
43
+ export declare function getLogger(moduleName: string): winston.Logger;
44
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/utils/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5E,oBAAY,QAAQ;IAChB,MAAM,iBAAO;IACb,KAAK,iBAAO;IACZ,MAAM,iBAAO;IACb,OAAO,iBAAO;IACd,QAAQ,iBAAO;IACf,GAAG,iBAAO;IACV,GAAG,iBAAO;IACV,KAAK,iBAAO;IACZ,GAAG,iBAAO;IACV,KAAK,iBAAO;IACZ,OAAO,iBAAO;IACd,GAAG,iBAAO;IACV,GAAG,iBAAO;IACV,MAAM,uBAAQ;CACjB;AAyED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAE,aAAsB,GAAG,IAAI,CAY/D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAE5D"}