@metatell/bot-core 0.0.3 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metatell/bot-core",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,6 +29,11 @@
29
29
  "devDependencies": {
30
30
  "@types/phoenix": "^1.6.6"
31
31
  },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/urth-inc/metatell-ai-bot",
35
+ "directory": "packages/core"
36
+ },
32
37
  "publishConfig": {
33
38
  "access": "public",
34
39
  "registry": "https://registry.npmjs.org/"
@@ -1,38 +0,0 @@
1
- /**
2
- * Event emitter for log-related events
3
- * Provides reactive log updates to consumers
4
- */
5
- import type { CoreLogRecord } from './index.js';
6
- export type LogEventHandler = (records: CoreLogRecord[]) => void;
7
- export interface ILogEventEmitter {
8
- /**
9
- * Subscribe to new log events
10
- */
11
- onNewLogs(handler: LogEventHandler): () => void;
12
- /**
13
- * Emit new log records
14
- */
15
- emitNewLogs(records: CoreLogRecord[]): void;
16
- /**
17
- * Remove all log event listeners
18
- */
19
- removeAllListeners(): void;
20
- }
21
- /**
22
- * Implementation of log event emitter
23
- */
24
- export declare class LogEventEmitter implements ILogEventEmitter {
25
- private handlers;
26
- onNewLogs(handler: LogEventHandler): () => void;
27
- emitNewLogs(records: CoreLogRecord[]): void;
28
- removeAllListeners(): void;
29
- }
30
- /**
31
- * Get the global log event emitter
32
- */
33
- export declare function getLogEventEmitter(): ILogEventEmitter;
34
- /**
35
- * Reset the log event emitter (mainly for testing)
36
- */
37
- export declare function resetLogEventEmitter(): void;
38
- //# sourceMappingURL=LogEventEmitter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogEventEmitter.d.ts","sourceRoot":"","sources":["../../src/logging/LogEventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,CAAA;AAEhE,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,IAAI,CAAA;IAE/C;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI,CAAA;IAE3C;;OAEG;IACH,kBAAkB,IAAI,IAAI,CAAA;CAC3B;AAED;;GAEG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,OAAO,CAAC,QAAQ,CAAkC;IAElD,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,IAAI;IAS/C,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI;IAa3C,kBAAkB,IAAI,IAAI;CAG3B;AAKD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAKrD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C"}
@@ -1,54 +0,0 @@
1
- /**
2
- * Event emitter for log-related events
3
- * Provides reactive log updates to consumers
4
- */
5
- /**
6
- * Implementation of log event emitter
7
- */
8
- export class LogEventEmitter {
9
- handlers = new Set();
10
- onNewLogs(handler) {
11
- this.handlers.add(handler);
12
- // Return unsubscribe function
13
- return () => {
14
- this.handlers.delete(handler);
15
- };
16
- }
17
- emitNewLogs(records) {
18
- if (records.length === 0)
19
- return;
20
- // Notify all handlers
21
- for (const handler of this.handlers) {
22
- try {
23
- handler(records);
24
- }
25
- catch (error) {
26
- console.error('Error in log event handler:', error);
27
- }
28
- }
29
- }
30
- removeAllListeners() {
31
- this.handlers.clear();
32
- }
33
- }
34
- // Global singleton instance
35
- let globalLogEventEmitter = null;
36
- /**
37
- * Get the global log event emitter
38
- */
39
- export function getLogEventEmitter() {
40
- if (!globalLogEventEmitter) {
41
- globalLogEventEmitter = new LogEventEmitter();
42
- }
43
- return globalLogEventEmitter;
44
- }
45
- /**
46
- * Reset the log event emitter (mainly for testing)
47
- */
48
- export function resetLogEventEmitter() {
49
- if (globalLogEventEmitter) {
50
- globalLogEventEmitter.removeAllListeners();
51
- }
52
- globalLogEventEmitter = null;
53
- }
54
- //# sourceMappingURL=LogEventEmitter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogEventEmitter.js","sourceRoot":"","sources":["../../src/logging/LogEventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH;;GAEG;AACH,MAAM,OAAO,eAAe;IAClB,QAAQ,GAAyB,IAAI,GAAG,EAAE,CAAA;IAElD,SAAS,CAAC,OAAwB;QAChC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAE1B,8BAA8B;QAC9B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC/B,CAAC,CAAA;IACH,CAAC;IAED,WAAW,CAAC,OAAwB;QAClC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAM;QAEhC,sBAAsB;QACtB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,IAAI,CAAC;gBACH,OAAO,CAAC,OAAO,CAAC,CAAA;YAClB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAA;YACrD,CAAC;QACH,CAAC;IACH,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC;CACF;AAED,4BAA4B;AAC5B,IAAI,qBAAqB,GAA4B,IAAI,CAAA;AAEzD;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,qBAAqB,GAAG,IAAI,eAAe,EAAE,CAAA;IAC/C,CAAC;IACD,OAAO,qBAAqB,CAAA;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,IAAI,qBAAqB,EAAE,CAAC;QAC1B,qBAAqB,CAAC,kBAAkB,EAAE,CAAA;IAC5C,CAAC;IACD,qBAAqB,GAAG,IAAI,CAAA;AAC9B,CAAC"}