conduithub 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/core/conduit-hub/index.cjs +1 -1
  2. package/dist/core/conduit-hub/index.d.cts +1 -1
  3. package/dist/core/conduit-hub/index.d.mts +1 -1
  4. package/dist/core/conduit-hub/index.d.ts +1 -1
  5. package/dist/core/conduit-hub/index.mjs +1 -1
  6. package/dist/core/config-manager/index.d.cts +1 -1
  7. package/dist/core/config-manager/index.d.mts +1 -1
  8. package/dist/core/config-manager/index.d.ts +1 -1
  9. package/dist/core/event-bus/index.cjs +4 -4
  10. package/dist/core/event-bus/index.mjs +1 -1
  11. package/dist/core/hook/index.cjs +6 -6
  12. package/dist/core/hook/index.mjs +1 -1
  13. package/dist/core/index.cjs +5 -3
  14. package/dist/core/index.d.cts +8 -184
  15. package/dist/core/index.d.mts +8 -184
  16. package/dist/core/index.d.ts +8 -184
  17. package/dist/core/index.mjs +4 -3
  18. package/dist/core/plugin/index.d.cts +1 -1
  19. package/dist/core/plugin/index.d.mts +1 -1
  20. package/dist/core/plugin/index.d.ts +1 -1
  21. package/dist/core/service-container/index.cjs +9 -9
  22. package/dist/core/service-container/index.mjs +1 -1
  23. package/dist/core/state-manager/index.cjs +3 -3
  24. package/dist/core/state-manager/index.mjs +1 -1
  25. package/dist/{shared/conduithub.BqUYv04j.cjs → error/index.cjs} +3 -0
  26. package/dist/error/index.d.cts +47 -0
  27. package/dist/error/index.d.mts +47 -0
  28. package/dist/error/index.d.ts +47 -0
  29. package/dist/{shared/conduithub.BDwZXllF.mjs → error/index.mjs} +3 -1
  30. package/dist/index.cjs +191 -16
  31. package/dist/index.d.cts +65 -47
  32. package/dist/index.d.mts +65 -47
  33. package/dist/index.d.ts +65 -47
  34. package/dist/index.mjs +161 -5
  35. package/dist/plugins/index.cjs +40 -0
  36. package/dist/plugins/index.d.cts +10 -0
  37. package/dist/plugins/index.d.mts +10 -0
  38. package/dist/plugins/index.d.ts +10 -0
  39. package/dist/plugins/index.mjs +24 -0
  40. package/dist/plugins/kafka/index.cjs +34 -0
  41. package/dist/plugins/kafka/index.d.cts +250 -0
  42. package/dist/plugins/kafka/index.d.mts +250 -0
  43. package/dist/plugins/kafka/index.d.ts +250 -0
  44. package/dist/plugins/kafka/index.mjs +23 -0
  45. package/dist/plugins/redis/index.cjs +33 -0
  46. package/dist/plugins/redis/index.d.cts +151 -0
  47. package/dist/plugins/redis/index.d.mts +151 -0
  48. package/dist/plugins/redis/index.d.ts +151 -0
  49. package/dist/plugins/redis/index.mjs +23 -0
  50. package/dist/shared/conduithub.0FKJet8c.cjs +1130 -0
  51. package/dist/shared/conduithub.B16qn6pY.mjs +174 -0
  52. package/dist/shared/conduithub.BW-S7Bp_.d.cts +181 -0
  53. package/dist/shared/conduithub.BdX_BLza.mjs +1124 -0
  54. package/dist/shared/conduithub.BzuAKyjY.mjs +971 -0
  55. package/dist/shared/conduithub.DSAmRivG.d.ts +181 -0
  56. package/dist/shared/conduithub.DhMIxMx2.cjs +981 -0
  57. package/dist/shared/{conduithub.gF2DFc43.cjs → conduithub.Dlvl2xGE.cjs} +3 -3
  58. package/dist/shared/conduithub.GrtzQn_7.d.mts +181 -0
  59. package/dist/shared/{conduithub.bsiNMTVD.mjs → conduithub.Up0QYVao.mjs} +1 -1
  60. package/dist/shared/conduithub.jH-df3Zd.cjs +181 -0
  61. package/dist/utils/index.cjs +3 -2
  62. package/dist/utils/index.mjs +3 -2
  63. package/package.json +22 -1
@@ -1,184 +1,8 @@
1
- import { z } from 'zod';
2
- import { Hook, HookResult } from './hook/index.js';
3
- export { HookHandler } from './hook/index.js';
4
- import { a as Logger } from '../shared/conduithub.B7aryjPG.js';
5
- import { E as EventBus, a as EventData } from '../shared/conduithub.DQOWQ-Bx.js';
6
- import { ServiceContainer } from './service-container/index.js';
7
- export { ServiceDescriptor } from './service-container/index.js';
8
- import { StateManager } from './state-manager/index.js';
9
- export { StateChangeHandler } from './state-manager/index.js';
10
-
11
- interface PluginStatus {
12
- name: string;
13
- version: string;
14
- status: "registered" | "initialized" | "running" | "stopped" | "destroyed" | "error";
15
- config: PluginConfig;
16
- error?: string;
17
- lastActivity: number;
18
- }
19
- declare class PluginManager {
20
- private eventBus;
21
- private logger;
22
- private serviceContainer;
23
- private stateManager;
24
- private hookSystem;
25
- private configManager;
26
- private plugins;
27
- private pluginStatuses;
28
- private pluginConfigs;
29
- constructor(eventBus: EventBus<Record<string, unknown>>, logger: Logger, serviceContainer: ServiceContainer, stateManager: StateManager, hookSystem: Hook<Record<string, {
30
- input: unknown;
31
- output: unknown;
32
- }>>, configManager: ConfigManager);
33
- private log;
34
- registerPlugin(plugin: BasePlugin, config?: PluginConfig): Promise<void>;
35
- unregisterPlugin(pluginName: string): Promise<void>;
36
- initializePlugin(pluginName: string): Promise<void>;
37
- startPlugin(pluginName: string): Promise<void>;
38
- stopPlugin(pluginName: string): Promise<void>;
39
- shutdownAll(): Promise<void>;
40
- isPluginRegistered(pluginName: string): boolean;
41
- isPluginRunning(pluginName: string): boolean;
42
- getPluginStatus(pluginName: string): PluginStatus | undefined;
43
- listPlugins(): string[];
44
- getAllPluginStatuses(): PluginStatus[];
45
- getPlugin(pluginName: string): BasePlugin | undefined;
46
- getPluginConfig(pluginName: string): PluginConfig | undefined;
47
- updatePluginConfig(pluginName: string, config: Partial<PluginConfig>): Promise<void>;
48
- }
49
-
50
- interface PluginConfig {
51
- name: string;
52
- version: string;
53
- enabled: boolean;
54
- dependencies?: string[];
55
- config?: Record<string, unknown>;
56
- }
57
- interface PluginContext<EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
58
- input: unknown;
59
- output: unknown;
60
- }> = Record<string, {
61
- input: unknown;
62
- output: unknown;
63
- }>> {
64
- eventBus: EventBus<EM>;
65
- logger: Logger;
66
- config: PluginConfig;
67
- serviceContainer: ServiceContainer;
68
- hookSystem: Hook<HM>;
69
- stateManager: StateManager;
70
- }
71
- interface PluginMetadata {
72
- name: string;
73
- version: string;
74
- description?: string;
75
- author?: string;
76
- dependencies?: string[];
77
- hooks: string[];
78
- events: string[];
79
- }
80
- type PluginLifecycle = "beforeInit" | "afterInit" | "beforeStart" | "afterStart" | "beforeStop" | "afterStop" | "beforeDestroy" | "afterDestroy";
81
- declare abstract class BasePlugin<T extends Record<string, unknown> = Record<string, unknown>, EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
82
- input: unknown;
83
- output: unknown;
84
- }> = Record<string, {
85
- input: unknown;
86
- output: unknown;
87
- }>> {
88
- protected config: PluginConfig & {
89
- config: T;
90
- };
91
- protected context: PluginContext<EM, HM>;
92
- protected metadata: PluginMetadata;
93
- protected isInitialized: boolean;
94
- protected isRunning: boolean;
95
- private managedEventHandlers;
96
- private managedHookHandlers;
97
- private lock;
98
- constructor(config: PluginConfig & {
99
- config: T;
100
- });
101
- abstract getMetadata(): PluginMetadata;
102
- initialize(context: PluginContext<EM, HM>): Promise<void>;
103
- start(): Promise<void>;
104
- stop(): Promise<void>;
105
- destroy(): Promise<void>;
106
- protected abstract onInitialize(): Promise<void>;
107
- protected abstract onStart(): Promise<void>;
108
- protected abstract onStop(): Promise<void>;
109
- protected abstract onDestroy(): Promise<void>;
110
- private executeLifecycleHook;
111
- getConfig(): PluginConfig & {
112
- config: T;
113
- };
114
- getContext(): PluginContext<EM, HM>;
115
- isPluginInitialized(): boolean;
116
- isPluginRunning(): boolean;
117
- protected emit<K extends keyof EM>(event: K, data: EM[K]): Promise<void>;
118
- protected on<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
119
- protected once<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
120
- protected onManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
121
- protected onceManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
122
- protected off<K extends keyof EM>(event: K, handlerId: string): void;
123
- protected executeHook<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HM[K]["output"]>;
124
- protected executeHookSeries<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HookResult<HM[K]["output"]>[]>;
125
- protected executeHookSeriesWithContext<K extends keyof HM>(hook: K, input: HM[K]["input"], context: Record<string, unknown>): Promise<HookResult<HM[K]["output"]>[]>;
126
- protected registerHook<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
127
- protected registerHookManaged<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
128
- protected unregisterHook<K extends keyof HM>(hook: K, handlerId: string): Promise<boolean>;
129
- protected getStatus(): {
130
- initialized: boolean;
131
- running: boolean;
132
- };
133
- protected getName(): string;
134
- protected getVersion(): string;
135
- protected isEnabled(): boolean;
136
- protected getState(key: string): unknown;
137
- protected setState(key: string, value: unknown): void;
138
- protected deleteState(key: string): void;
139
- protected get logger(): Logger;
140
- updateConfig(update: Partial<PluginConfig & {
141
- config: T;
142
- }>): void;
143
- private cleanupManagedHandlers;
144
- private cleanupManagedHooks;
145
- private withLock;
146
- }
147
-
148
- declare class ConfigManager {
149
- private config;
150
- private pluginConfigs;
151
- private isInitialized;
152
- initialize(config: Record<string, unknown>): Promise<void>;
153
- shutdown(): Promise<void>;
154
- get<T>(key: string, defaultValue?: T): T | undefined;
155
- set<T>(key: string, value: T): void;
156
- has(key: string): boolean;
157
- delete(key: string): boolean;
158
- loadConfig(config: Record<string, unknown>): void;
159
- clearConfig(): void;
160
- getPluginConfig(pluginName: string): PluginConfig | undefined;
161
- setPluginConfig(pluginName: string, config: PluginConfig): void;
162
- updatePluginConfig(pluginName: string, updates: Partial<PluginConfig>): void;
163
- hasPluginConfig(pluginName: string): boolean;
164
- deletePluginConfig(pluginName: string): boolean;
165
- getAllPluginConfigs(): Record<string, PluginConfig>;
166
- loadPluginConfigs(configs: Record<string, PluginConfig>): void;
167
- validateConfig(schema: z.ZodTypeAny, config: unknown): {
168
- valid: boolean;
169
- errors: string[];
170
- };
171
- exportConfig(format?: "json"): string;
172
- importConfig(configJson: string): void;
173
- getPluginConfigNames(): string[];
174
- getStats(): {
175
- totalConfigKeys: number;
176
- totalPluginConfigs: number;
177
- configKeys: string[];
178
- pluginConfigNames: string[];
179
- };
180
- watchConfig(key: string, callback: (value: unknown) => void): () => void;
181
- }
182
-
183
- export { BasePlugin, ConfigManager, EventBus, Hook, HookResult, PluginManager, ServiceContainer, StateManager };
184
- export type { PluginConfig, PluginContext, PluginLifecycle, PluginMetadata, PluginStatus };
1
+ export { ConduitHub } from './conduit-hub/index.js';
2
+ export { B as BasePlugin, C as ConfigManager, P as PluginConfig, a as PluginContext, c as PluginLifecycle, e as PluginManager, b as PluginMetadata, d as PluginStatus } from '../shared/conduithub.DSAmRivG.js';
3
+ export { E as EventBus } from '../shared/conduithub.DQOWQ-Bx.js';
4
+ export { Hook, HookHandler, HookResult } from './hook/index.js';
5
+ export { ServiceContainer, ServiceDescriptor } from './service-container/index.js';
6
+ export { StateChangeHandler, StateManager } from './state-manager/index.js';
7
+ import '../shared/conduithub.B7aryjPG.js';
8
+ import 'zod';
@@ -1,3 +1,4 @@
1
+ export { ConduitHub } from './conduit-hub/index.mjs';
1
2
  export { ConfigManager } from './config-manager/index.mjs';
2
3
  export { EventBus } from './event-bus/index.mjs';
3
4
  export { Hook } from './hook/index.mjs';
@@ -5,11 +6,11 @@ export { BasePlugin } from './plugin/index.mjs';
5
6
  export { ServiceContainer } from './service-container/index.mjs';
6
7
  export { StateManager } from './state-manager/index.mjs';
7
8
  export { P as PluginManager } from '../shared/conduithub.DyQQrHW9.mjs';
8
- import '../shared/conduithub.G7ICpZIy.mjs';
9
- import '../shared/conduithub.alPiaJax.mjs';
10
9
  import '../shared/conduithub.BNefRQsK.mjs';
11
10
  import 'process';
12
11
  import 'readline';
13
12
  import 'uuid';
14
- import '../shared/conduithub.BDwZXllF.mjs';
13
+ import '../shared/conduithub.G7ICpZIy.mjs';
14
+ import '../shared/conduithub.alPiaJax.mjs';
15
+ import '../error/index.mjs';
15
16
  import '../shared/conduithub.CkOQG3cD.mjs';
@@ -3,5 +3,5 @@ import '../../shared/conduithub.B7aryjPG.cjs';
3
3
  import '../../shared/conduithub.BZQmkQy7.cjs';
4
4
  import '../service-container/index.cjs';
5
5
  import '../state-manager/index.cjs';
6
- export { BasePlugin, PluginConfig, PluginContext, PluginLifecycle, PluginManager, PluginMetadata, PluginStatus } from '../index.cjs';
6
+ export { B as BasePlugin, P as PluginConfig, a as PluginContext, c as PluginLifecycle, e as PluginManager, b as PluginMetadata, d as PluginStatus } from '../../shared/conduithub.BW-S7Bp_.cjs';
7
7
  import 'zod';
@@ -3,5 +3,5 @@ import '../../shared/conduithub.B7aryjPG.mjs';
3
3
  import '../../shared/conduithub.BzLwccre.mjs';
4
4
  import '../service-container/index.mjs';
5
5
  import '../state-manager/index.mjs';
6
- export { BasePlugin, PluginConfig, PluginContext, PluginLifecycle, PluginManager, PluginMetadata, PluginStatus } from '../index.mjs';
6
+ export { B as BasePlugin, P as PluginConfig, a as PluginContext, c as PluginLifecycle, e as PluginManager, b as PluginMetadata, d as PluginStatus } from '../../shared/conduithub.GrtzQn_7.mjs';
7
7
  import 'zod';
@@ -3,5 +3,5 @@ import '../../shared/conduithub.B7aryjPG.js';
3
3
  import '../../shared/conduithub.DQOWQ-Bx.js';
4
4
  import '../service-container/index.js';
5
5
  import '../state-manager/index.js';
6
- export { BasePlugin, PluginConfig, PluginContext, PluginLifecycle, PluginManager, PluginMetadata, PluginStatus } from '../index.js';
6
+ export { B as BasePlugin, P as PluginConfig, a as PluginContext, c as PluginLifecycle, e as PluginManager, b as PluginMetadata, d as PluginStatus } from '../../shared/conduithub.DSAmRivG.js';
7
7
  import 'zod';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('../../shared/conduithub.BqUYv04j.cjs');
3
+ const error_index = require('../../error/index.cjs');
4
4
  const logger = require('../../shared/conduithub.BNQsddJO.cjs');
5
5
  require('process');
6
6
  require('readline');
@@ -30,7 +30,7 @@ class ServiceContainer {
30
30
  }
31
31
  ensureInitialized() {
32
32
  if (!this.isInitialized) {
33
- throw new index.ConduithubError(code.ERROR_CODE.SERVICE_CONTAINER_NOT_INITIALIZED);
33
+ throw new error_index.ConduithubError(code.ERROR_CODE.SERVICE_CONTAINER_NOT_INITIALIZED);
34
34
  }
35
35
  }
36
36
  register(name, factory, singleton = true, dependencies, metadata) {
@@ -49,7 +49,7 @@ class ServiceContainer {
49
49
  this.ensureInitialized();
50
50
  const service = this.services.get(name);
51
51
  if (!service) {
52
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
52
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
53
53
  }
54
54
  if (service.singleton && this.instances.has(name)) {
55
55
  return this.instances.get(name);
@@ -58,7 +58,7 @@ class ServiceContainer {
58
58
  return this.pendingResolutions.get(name);
59
59
  }
60
60
  if (this.resolutionStack.has(name)) {
61
- throw new index.ConduithubError(
61
+ throw new error_index.ConduithubError(
62
62
  `${code.ERROR_CODE.CIRCULAR_DEPENDENCY_DETECTED}: ${name}`
63
63
  );
64
64
  }
@@ -93,7 +93,7 @@ class ServiceContainer {
93
93
  remove(name) {
94
94
  this.ensureInitialized();
95
95
  if (!this.services.has(name)) {
96
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
96
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
97
97
  }
98
98
  this.instances.delete(name);
99
99
  this.services.delete(name);
@@ -123,10 +123,10 @@ class ServiceContainer {
123
123
  this.ensureInitialized();
124
124
  const descriptor = this.services.get(name);
125
125
  if (!descriptor) {
126
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
126
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
127
127
  }
128
128
  if (descriptor.singleton) {
129
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_IS_SINGLETON}: ${name}`);
129
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_IS_SINGLETON}: ${name}`);
130
130
  }
131
131
  if (this.instances.has(name)) {
132
132
  return this.instances.get(name);
@@ -139,7 +139,7 @@ class ServiceContainer {
139
139
  return instance;
140
140
  } catch (error) {
141
141
  logger.logger.error(`Failed to create instance for service: ${name}`, error);
142
- throw new index.ConduithubError(
142
+ throw new error_index.ConduithubError(
143
143
  `${code.ERROR_CODE.SERVICE_CREATION_FAILED}: ${name}`,
144
144
  {
145
145
  code: "SERVICE_CREATION_FAILED",
@@ -286,7 +286,7 @@ class ServiceContainer {
286
286
  dispose(name) {
287
287
  this.ensureInitialized();
288
288
  if (!this.services.has(name)) {
289
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
289
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
290
290
  }
291
291
  const instance = this.instances.get(name);
292
292
  if (instance && typeof instance === "object" && "dispose" in instance) {
@@ -1,4 +1,4 @@
1
- import { C as ConduithubError } from '../../shared/conduithub.BDwZXllF.mjs';
1
+ import { ConduithubError } from '../../error/index.mjs';
2
2
  import { a as logger } from '../../shared/conduithub.BNefRQsK.mjs';
3
3
  import 'process';
4
4
  import 'readline';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('../../shared/conduithub.BqUYv04j.cjs');
3
+ const error_index = require('../../error/index.cjs');
4
4
  const logger = require('../../shared/conduithub.BNQsddJO.cjs');
5
5
  require('process');
6
6
  require('readline');
@@ -26,7 +26,7 @@ class StateManager {
26
26
  }
27
27
  ensureInitialized() {
28
28
  if (!this.isInitialized) {
29
- throw new index.ConduithubError(code.ERROR_CODE.STATE_MANAGER_NOT_INITIALIZED);
29
+ throw new error_index.ConduithubError(code.ERROR_CODE.STATE_MANAGER_NOT_INITIALIZED);
30
30
  }
31
31
  }
32
32
  get(key) {
@@ -187,7 +187,7 @@ class StateManager {
187
187
  logger.logger.success("State imported successfully");
188
188
  } catch (error) {
189
189
  logger.logger.error("Failed to import state", error);
190
- throw new index.ConduithubError(code.ERROR_CODE.INVALID_STATE_JSON_FORMAT);
190
+ throw new error_index.ConduithubError(code.ERROR_CODE.INVALID_STATE_JSON_FORMAT);
191
191
  }
192
192
  }
193
193
  }
@@ -1,4 +1,4 @@
1
- import { C as ConduithubError } from '../../shared/conduithub.BDwZXllF.mjs';
1
+ import { ConduithubError } from '../../error/index.mjs';
2
2
  import { a as logger } from '../../shared/conduithub.BNefRQsK.mjs';
3
3
  import 'process';
4
4
  import 'readline';
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const code = require('../shared/conduithub.CmZo_Vuc.cjs');
4
+
3
5
  class ConduithubError extends Error {
4
6
  code;
5
7
  details;
@@ -62,6 +64,7 @@ class MissingDependencyError extends ConduithubError {
62
64
  }
63
65
  }
64
66
 
67
+ exports.ERROR_CODE = code.ERROR_CODE;
65
68
  exports.ConduithubError = ConduithubError;
66
69
  exports.MissingDependencyError = MissingDependencyError;
67
70
  exports.getPkgManager = getPkgManager;
@@ -0,0 +1,47 @@
1
+ declare const ERROR_CODE: {
2
+ readonly INVALID_JSON: "Invalid JSON format";
3
+ readonly INVALID_CONFIG: "Configuration validation failed";
4
+ readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
5
+ readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
6
+ readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
7
+ readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
8
+ readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
9
+ readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
10
+ readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
11
+ readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
12
+ readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
13
+ readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
14
+ readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
15
+ readonly UNKNOWN_ERROR: "Unknown error";
16
+ readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
17
+ readonly SERVICE_NOT_FOUND: "Service not found";
18
+ readonly SERVICE_CREATION_FAILED: "Service creation failed";
19
+ readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
20
+ readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
21
+ readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
22
+ readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
23
+ readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
24
+ readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
25
+ };
26
+ type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
27
+
28
+ interface ErrorContext {
29
+ readonly code?: string;
30
+ readonly details?: Record<string, unknown>;
31
+ readonly timestamp?: number;
32
+ }
33
+ declare class ConduithubError extends Error {
34
+ readonly code?: string;
35
+ readonly details?: Record<string, unknown>;
36
+ readonly timestamp: number;
37
+ constructor(message: string, context?: ErrorContext);
38
+ toJSON(): Record<string, unknown>;
39
+ }
40
+ declare function setPkgManager(manager: string): void;
41
+ declare function getPkgManager(): string;
42
+ declare class MissingDependencyError extends ConduithubError {
43
+ constructor(pkgName: string);
44
+ }
45
+
46
+ export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
47
+ export type { ErrorCode };
@@ -0,0 +1,47 @@
1
+ declare const ERROR_CODE: {
2
+ readonly INVALID_JSON: "Invalid JSON format";
3
+ readonly INVALID_CONFIG: "Configuration validation failed";
4
+ readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
5
+ readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
6
+ readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
7
+ readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
8
+ readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
9
+ readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
10
+ readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
11
+ readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
12
+ readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
13
+ readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
14
+ readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
15
+ readonly UNKNOWN_ERROR: "Unknown error";
16
+ readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
17
+ readonly SERVICE_NOT_FOUND: "Service not found";
18
+ readonly SERVICE_CREATION_FAILED: "Service creation failed";
19
+ readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
20
+ readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
21
+ readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
22
+ readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
23
+ readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
24
+ readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
25
+ };
26
+ type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
27
+
28
+ interface ErrorContext {
29
+ readonly code?: string;
30
+ readonly details?: Record<string, unknown>;
31
+ readonly timestamp?: number;
32
+ }
33
+ declare class ConduithubError extends Error {
34
+ readonly code?: string;
35
+ readonly details?: Record<string, unknown>;
36
+ readonly timestamp: number;
37
+ constructor(message: string, context?: ErrorContext);
38
+ toJSON(): Record<string, unknown>;
39
+ }
40
+ declare function setPkgManager(manager: string): void;
41
+ declare function getPkgManager(): string;
42
+ declare class MissingDependencyError extends ConduithubError {
43
+ constructor(pkgName: string);
44
+ }
45
+
46
+ export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
47
+ export type { ErrorCode };
@@ -0,0 +1,47 @@
1
+ declare const ERROR_CODE: {
2
+ readonly INVALID_JSON: "Invalid JSON format";
3
+ readonly INVALID_CONFIG: "Configuration validation failed";
4
+ readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
5
+ readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
6
+ readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
7
+ readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
8
+ readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
9
+ readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
10
+ readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
11
+ readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
12
+ readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
13
+ readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
14
+ readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
15
+ readonly UNKNOWN_ERROR: "Unknown error";
16
+ readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
17
+ readonly SERVICE_NOT_FOUND: "Service not found";
18
+ readonly SERVICE_CREATION_FAILED: "Service creation failed";
19
+ readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
20
+ readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
21
+ readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
22
+ readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
23
+ readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
24
+ readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
25
+ };
26
+ type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
27
+
28
+ interface ErrorContext {
29
+ readonly code?: string;
30
+ readonly details?: Record<string, unknown>;
31
+ readonly timestamp?: number;
32
+ }
33
+ declare class ConduithubError extends Error {
34
+ readonly code?: string;
35
+ readonly details?: Record<string, unknown>;
36
+ readonly timestamp: number;
37
+ constructor(message: string, context?: ErrorContext);
38
+ toJSON(): Record<string, unknown>;
39
+ }
40
+ declare function setPkgManager(manager: string): void;
41
+ declare function getPkgManager(): string;
42
+ declare class MissingDependencyError extends ConduithubError {
43
+ constructor(pkgName: string);
44
+ }
45
+
46
+ export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
47
+ export type { ErrorCode };
@@ -1,3 +1,5 @@
1
+ export { E as ERROR_CODE } from '../shared/conduithub.G7ICpZIy.mjs';
2
+
1
3
  class ConduithubError extends Error {
2
4
  code;
3
5
  details;
@@ -60,4 +62,4 @@ class MissingDependencyError extends ConduithubError {
60
62
  }
61
63
  }
62
64
 
63
- export { ConduithubError as C, MissingDependencyError as M, getPkgManager as g, setPkgManager as s };
65
+ export { ConduithubError, MissingDependencyError, getPkgManager, setPkgManager };