claude-flow 2.0.0-alpha.43 → 2.0.0-alpha.45
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/bin/claude-flow +1 -1
- package/dist/__tests__/features/mocks/MockFeatureManager.d.ts +26 -0
- package/dist/__tests__/features/mocks/MockFeatureManager.d.ts.map +1 -0
- package/dist/__tests__/features/mocks/MockFeatureManager.js +200 -0
- package/dist/__tests__/features/mocks/MockFeatureManager.js.map +1 -0
- package/dist/__tests__/features/setup.d.ts +24 -0
- package/dist/__tests__/features/setup.d.ts.map +1 -0
- package/dist/__tests__/features/setup.js +42 -0
- package/dist/__tests__/features/setup.js.map +1 -0
- package/dist/__tests__/features/utils/test-helpers.d.ts +96 -0
- package/dist/__tests__/features/utils/test-helpers.d.ts.map +1 -0
- package/dist/__tests__/features/utils/test-helpers.js +281 -0
- package/dist/__tests__/features/utils/test-helpers.js.map +1 -0
- package/dist/cli/commands/features.d.ts +3 -0
- package/dist/cli/commands/features.d.ts.map +1 -0
- package/dist/cli/commands/features.js +77 -0
- package/dist/cli/commands/features.js.map +1 -0
- package/dist/cli/simple-commands/features.d.ts +2 -0
- package/dist/cli/simple-commands/features.d.ts.map +1 -0
- package/dist/cli/simple-commands/features.js +92 -0
- package/dist/cli/simple-commands/features.js.map +1 -0
- package/dist/features/adapters/CliFeatureAdapter.d.ts +36 -0
- package/dist/features/adapters/CliFeatureAdapter.d.ts.map +1 -0
- package/dist/features/adapters/CliFeatureAdapter.js +311 -0
- package/dist/features/adapters/CliFeatureAdapter.js.map +1 -0
- package/dist/features/adapters/McpFeatureAdapter.d.ts +61 -0
- package/dist/features/adapters/McpFeatureAdapter.d.ts.map +1 -0
- package/dist/features/adapters/McpFeatureAdapter.js +487 -0
- package/dist/features/adapters/McpFeatureAdapter.js.map +1 -0
- package/dist/features/adapters/index.d.ts +7 -0
- package/dist/features/adapters/index.d.ts.map +1 -0
- package/dist/features/adapters/index.js +7 -0
- package/dist/features/adapters/index.js.map +1 -0
- package/dist/features/built-in/index.d.ts +53 -0
- package/dist/features/built-in/index.d.ts.map +1 -0
- package/dist/features/built-in/index.js +286 -0
- package/dist/features/built-in/index.js.map +1 -0
- package/dist/features/core/FeatureManager.d.ts +37 -0
- package/dist/features/core/FeatureManager.d.ts.map +1 -0
- package/dist/features/core/FeatureManager.js +291 -0
- package/dist/features/core/FeatureManager.js.map +1 -0
- package/dist/features/core/FeatureRegistry.d.ts +24 -0
- package/dist/features/core/FeatureRegistry.d.ts.map +1 -0
- package/dist/features/core/FeatureRegistry.js +75 -0
- package/dist/features/core/FeatureRegistry.js.map +1 -0
- package/dist/features/core/configuration-manager.d.ts +16 -0
- package/dist/features/core/configuration-manager.d.ts.map +1 -0
- package/dist/features/core/configuration-manager.js +94 -0
- package/dist/features/core/configuration-manager.js.map +1 -0
- package/dist/features/core/feature-manager.d.ts +23 -0
- package/dist/features/core/feature-manager.d.ts.map +1 -0
- package/dist/features/core/feature-manager.js +163 -0
- package/dist/features/core/feature-manager.js.map +1 -0
- package/dist/features/core/feature-registry.d.ts +16 -0
- package/dist/features/core/feature-registry.d.ts.map +1 -0
- package/dist/features/core/feature-registry.js +175 -0
- package/dist/features/core/feature-registry.js.map +1 -0
- package/dist/features/core/feature.d.ts +25 -0
- package/dist/features/core/feature.d.ts.map +1 -0
- package/dist/features/core/feature.js +113 -0
- package/dist/features/core/feature.js.map +1 -0
- package/dist/features/core/index.d.ts +10 -0
- package/dist/features/core/index.d.ts.map +1 -0
- package/dist/features/core/index.js +11 -0
- package/dist/features/core/index.js.map +1 -0
- package/dist/features/core/transparency-layer.d.ts +16 -0
- package/dist/features/core/transparency-layer.d.ts.map +1 -0
- package/dist/features/core/transparency-layer.js +61 -0
- package/dist/features/core/transparency-layer.js.map +1 -0
- package/dist/features/hooks/command-hooks.d.ts +40 -0
- package/dist/features/hooks/command-hooks.d.ts.map +1 -0
- package/dist/features/hooks/command-hooks.js +159 -0
- package/dist/features/hooks/command-hooks.js.map +1 -0
- package/dist/features/index.d.ts +6 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +8 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/initializer.d.ts +17 -0
- package/dist/features/initializer.d.ts.map +1 -0
- package/dist/features/initializer.js +41 -0
- package/dist/features/initializer.js.map +1 -0
- package/dist/features/tests/manual-test.d.ts +6 -0
- package/dist/features/tests/manual-test.d.ts.map +1 -0
- package/dist/features/tests/manual-test.js +130 -0
- package/dist/features/tests/manual-test.js.map +1 -0
- package/dist/features/types/IFeature.d.ts +148 -0
- package/dist/features/types/IFeature.d.ts.map +1 -0
- package/dist/features/types/IFeature.js +43 -0
- package/dist/features/types/IFeature.js.map +1 -0
- package/dist/features/types/IFeatureAdapter.d.ts +298 -0
- package/dist/features/types/IFeatureAdapter.d.ts.map +1 -0
- package/dist/features/types/IFeatureAdapter.js +2 -0
- package/dist/features/types/IFeatureAdapter.js.map +1 -0
- package/dist/features/types/IFeatureConfiguration.d.ts +380 -0
- package/dist/features/types/IFeatureConfiguration.d.ts.map +1 -0
- package/dist/features/types/IFeatureConfiguration.js +2 -0
- package/dist/features/types/IFeatureConfiguration.js.map +1 -0
- package/dist/features/types/IFeatureManager.d.ts +216 -0
- package/dist/features/types/IFeatureManager.d.ts.map +1 -0
- package/dist/features/types/IFeatureManager.js +2 -0
- package/dist/features/types/IFeatureManager.js.map +1 -0
- package/dist/features/types/IFeatureMetrics.d.ts +543 -0
- package/dist/features/types/IFeatureMetrics.d.ts.map +1 -0
- package/dist/features/types/IFeatureMetrics.js +25 -0
- package/dist/features/types/IFeatureMetrics.js.map +1 -0
- package/dist/features/types/ITransparencyLayer.d.ts +552 -0
- package/dist/features/types/ITransparencyLayer.d.ts.map +1 -0
- package/dist/features/types/ITransparencyLayer.js +60 -0
- package/dist/features/types/ITransparencyLayer.js.map +1 -0
- package/dist/features/types/feature-types.d.ts +153 -0
- package/dist/features/types/feature-types.d.ts.map +1 -0
- package/dist/features/types/feature-types.js +40 -0
- package/dist/features/types/feature-types.js.map +1 -0
- package/dist/features/types/index.d.ts +13 -0
- package/dist/features/types/index.d.ts.map +1 -0
- package/dist/features/types/index.js +16 -0
- package/dist/features/types/index.js.map +1 -0
- package/dist/features/types/type-guards.d.ts +100 -0
- package/dist/features/types/type-guards.d.ts.map +1 -0
- package/dist/features/types/type-guards.js +212 -0
- package/dist/features/types/type-guards.js.map +1 -0
- package/dist/features/types/utility-types.d.ts +440 -0
- package/dist/features/types/utility-types.d.ts.map +1 -0
- package/dist/features/types/utility-types.js +2 -0
- package/dist/features/types/utility-types.js.map +1 -0
- package/dist/mcp/feature-tools.d.ts +24 -0
- package/dist/mcp/feature-tools.d.ts.map +1 -0
- package/dist/mcp/feature-tools.js +65 -0
- package/dist/mcp/feature-tools.js.map +1 -0
- package/dist/memory/shared-memory.js +656 -0
- package/dist/memory/shared-memory.js.map +1 -0
- package/dist/memory/sqlite-store.js +0 -38
- package/dist/memory/sqlite-store.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/features.ts +84 -0
- package/src/cli/help-text.js +2 -2
- package/src/cli/simple-cli.js +1 -1
- package/src/cli/simple-commands/init/templates/CLAUDE.md +195 -42
- package/src/mcp/mcp-server.js +0 -33
- package/src/memory/sqlite-store.js +0 -42
- package/src/cli/simple-commands/hooks-complete.js +0 -677
- package/src/cli/simple-commands/hooks-enhanced-integration.js +0 -231
- package/src/cli/simple-commands/hooks-enhanced.js +0 -424
- package/src/cli/simple-commands/hooks-memory-bridge.js +0 -97
- package/src/cli/simple-commands/hooks-original.js +0 -377
package/bin/claude-flow
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock FeatureManager for testing
|
|
3
|
+
* Provides a mock implementation of the FeatureManager
|
|
4
|
+
*/
|
|
5
|
+
export declare class MockFeatureManager {
|
|
6
|
+
private features;
|
|
7
|
+
private activeFeatures;
|
|
8
|
+
private activationOrder;
|
|
9
|
+
private deactivationOrder;
|
|
10
|
+
register: jest.Mock<any, any, any>;
|
|
11
|
+
activate: jest.Mock<any, any, any>;
|
|
12
|
+
deactivate: jest.Mock<any, any, any>;
|
|
13
|
+
configure: jest.Mock<any, any, any>;
|
|
14
|
+
getFeature: jest.Mock<any, any, any>;
|
|
15
|
+
isActive: jest.Mock<any, any, any>;
|
|
16
|
+
listFeatures: jest.Mock<any, any, any>;
|
|
17
|
+
getMetadata: jest.Mock<any, any, any>;
|
|
18
|
+
getActivationOrder(): string[];
|
|
19
|
+
getDeactivationOrder(): string[];
|
|
20
|
+
reset(): void;
|
|
21
|
+
private getDependentFeatures;
|
|
22
|
+
private wasActiveBeforeOperation;
|
|
23
|
+
private validateConfigMock;
|
|
24
|
+
}
|
|
25
|
+
export declare function createMockFeatureManager(): MockFeatureManager;
|
|
26
|
+
//# sourceMappingURL=MockFeatureManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockFeatureManager.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/features/mocks/MockFeatureManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAmC;IACnD,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,iBAAiB,CAAgB;IAGzC,QAAQ,2BAeL;IAEH,QAAQ,2BAwCL;IAEH,UAAU,2BA2BP;IAEH,SAAS,2BAiBN;IAEH,UAAU,2BAEP;IAEH,QAAQ,2BAEL;IAEH,YAAY,2BAYT;IAEH,WAAW,2BAeR;IAGH,kBAAkB,IAAI,MAAM,EAAE;IAI9B,oBAAoB,IAAI,MAAM,EAAE;IAIhC,KAAK,IAAI,IAAI;IASb,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,kBAAkB;CAuC3B;AAGD,wBAAgB,wBAAwB,IAAI,kBAAkB,CAE7D"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock FeatureManager for testing
|
|
3
|
+
* Provides a mock implementation of the FeatureManager
|
|
4
|
+
*/
|
|
5
|
+
export class MockFeatureManager {
|
|
6
|
+
features = new Map();
|
|
7
|
+
activeFeatures = new Set();
|
|
8
|
+
activationOrder = [];
|
|
9
|
+
deactivationOrder = [];
|
|
10
|
+
// Mock methods
|
|
11
|
+
register = jest.fn().mockImplementation((feature) => {
|
|
12
|
+
if (this.features.has(feature.id)) {
|
|
13
|
+
throw new Error(`Feature ${feature.id} already registered`);
|
|
14
|
+
}
|
|
15
|
+
// Validate dependencies
|
|
16
|
+
if (feature.dependencies) {
|
|
17
|
+
for (const dep of feature.dependencies) {
|
|
18
|
+
if (!this.features.has(dep)) {
|
|
19
|
+
throw new Error(`Missing dependency: ${dep}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
this.features.set(feature.id, feature);
|
|
24
|
+
});
|
|
25
|
+
activate = jest.fn().mockImplementation(async (featureId) => {
|
|
26
|
+
const feature = this.features.get(featureId);
|
|
27
|
+
if (!feature) {
|
|
28
|
+
throw new Error(`Feature ${featureId} not found`);
|
|
29
|
+
}
|
|
30
|
+
if (this.activeFeatures.has(featureId)) {
|
|
31
|
+
return; // Already active
|
|
32
|
+
}
|
|
33
|
+
// Activate dependencies first
|
|
34
|
+
if (feature.dependencies) {
|
|
35
|
+
for (const dep of feature.dependencies) {
|
|
36
|
+
await this.activate(dep);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
if (feature.onBeforeActivate) {
|
|
41
|
+
await feature.onBeforeActivate();
|
|
42
|
+
}
|
|
43
|
+
await feature.activate();
|
|
44
|
+
this.activeFeatures.add(featureId);
|
|
45
|
+
this.activationOrder.push(featureId);
|
|
46
|
+
if (feature.onAfterActivate) {
|
|
47
|
+
await feature.onAfterActivate();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
// Rollback on error
|
|
52
|
+
if (feature.dependencies) {
|
|
53
|
+
for (const dep of feature.dependencies) {
|
|
54
|
+
if (!this.wasActiveBeforeOperation(dep)) {
|
|
55
|
+
await this.deactivate(dep);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
throw new Error(`Failed to activate feature ${featureId}: ${error.message}`);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
deactivate = jest.fn().mockImplementation(async (featureId) => {
|
|
63
|
+
const feature = this.features.get(featureId);
|
|
64
|
+
if (!feature) {
|
|
65
|
+
throw new Error(`Feature ${featureId} not found`);
|
|
66
|
+
}
|
|
67
|
+
if (!this.activeFeatures.has(featureId)) {
|
|
68
|
+
return; // Already inactive
|
|
69
|
+
}
|
|
70
|
+
// Deactivate dependent features first
|
|
71
|
+
const dependents = this.getDependentFeatures(featureId);
|
|
72
|
+
for (const dependent of dependents) {
|
|
73
|
+
await this.deactivate(dependent);
|
|
74
|
+
}
|
|
75
|
+
if (feature.onBeforeDeactivate) {
|
|
76
|
+
await feature.onBeforeDeactivate();
|
|
77
|
+
}
|
|
78
|
+
await feature.deactivate();
|
|
79
|
+
this.activeFeatures.delete(featureId);
|
|
80
|
+
this.deactivationOrder.push(featureId);
|
|
81
|
+
if (feature.onAfterDeactivate) {
|
|
82
|
+
await feature.onAfterDeactivate();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
configure = jest.fn().mockImplementation(async (featureId, config) => {
|
|
86
|
+
const feature = this.features.get(featureId);
|
|
87
|
+
if (!feature) {
|
|
88
|
+
throw new Error(`Feature ${featureId} not found`);
|
|
89
|
+
}
|
|
90
|
+
if (feature.configSchema) {
|
|
91
|
+
// Simple validation mock
|
|
92
|
+
const result = this.validateConfigMock(config, feature.configSchema);
|
|
93
|
+
if (!result.valid) {
|
|
94
|
+
throw new Error('Invalid configuration');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (feature.configure) {
|
|
98
|
+
await feature.configure(config);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
getFeature = jest.fn().mockImplementation((featureId) => {
|
|
102
|
+
return this.features.get(featureId);
|
|
103
|
+
});
|
|
104
|
+
isActive = jest.fn().mockImplementation((featureId) => {
|
|
105
|
+
return this.activeFeatures.has(featureId);
|
|
106
|
+
});
|
|
107
|
+
listFeatures = jest.fn().mockImplementation((filter) => {
|
|
108
|
+
const features = Array.from(this.features.values());
|
|
109
|
+
if (filter?.status === 'active') {
|
|
110
|
+
return features.filter(f => this.activeFeatures.has(f.id));
|
|
111
|
+
}
|
|
112
|
+
if (filter?.status === 'inactive') {
|
|
113
|
+
return features.filter(f => !this.activeFeatures.has(f.id));
|
|
114
|
+
}
|
|
115
|
+
return features;
|
|
116
|
+
});
|
|
117
|
+
getMetadata = jest.fn().mockImplementation((featureId) => {
|
|
118
|
+
const feature = this.features.get(featureId);
|
|
119
|
+
if (!feature) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
id: feature.id,
|
|
124
|
+
name: feature.name,
|
|
125
|
+
version: feature.version,
|
|
126
|
+
description: feature.description,
|
|
127
|
+
isActive: this.activeFeatures.has(featureId),
|
|
128
|
+
dependencies: feature.dependencies || [],
|
|
129
|
+
dependents: this.getDependentFeatures(featureId),
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
// Helper methods for testing
|
|
133
|
+
getActivationOrder() {
|
|
134
|
+
return [...this.activationOrder];
|
|
135
|
+
}
|
|
136
|
+
getDeactivationOrder() {
|
|
137
|
+
return [...this.deactivationOrder];
|
|
138
|
+
}
|
|
139
|
+
reset() {
|
|
140
|
+
this.features.clear();
|
|
141
|
+
this.activeFeatures.clear();
|
|
142
|
+
this.activationOrder = [];
|
|
143
|
+
this.deactivationOrder = [];
|
|
144
|
+
jest.clearAllMocks();
|
|
145
|
+
}
|
|
146
|
+
// Private helper methods
|
|
147
|
+
getDependentFeatures(featureId) {
|
|
148
|
+
const dependents = [];
|
|
149
|
+
for (const [id, feature] of this.features) {
|
|
150
|
+
if (feature.dependencies?.includes(featureId)) {
|
|
151
|
+
dependents.push(id);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return dependents;
|
|
155
|
+
}
|
|
156
|
+
wasActiveBeforeOperation(featureId) {
|
|
157
|
+
// This is a simplified check for testing
|
|
158
|
+
return this.activationOrder.includes(featureId) &&
|
|
159
|
+
!this.deactivationOrder.includes(featureId);
|
|
160
|
+
}
|
|
161
|
+
validateConfigMock(config, schema) {
|
|
162
|
+
// Very simple validation for testing
|
|
163
|
+
const errors = [];
|
|
164
|
+
if (schema.required) {
|
|
165
|
+
for (const required of schema.required) {
|
|
166
|
+
if (!config.settings || !(required in config.settings)) {
|
|
167
|
+
errors.push({
|
|
168
|
+
path: `/settings/${required}`,
|
|
169
|
+
message: `Property ${required} is required`,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (schema.properties) {
|
|
175
|
+
for (const [key, propSchema] of Object.entries(schema.properties)) {
|
|
176
|
+
const value = config.settings?.[key];
|
|
177
|
+
if (value !== undefined && propSchema.type) {
|
|
178
|
+
if (propSchema.type === 'string' && typeof value !== 'string') {
|
|
179
|
+
errors.push({
|
|
180
|
+
path: `/settings/${key}`,
|
|
181
|
+
message: `Property ${key} must be a string`,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (propSchema.minLength && value.length < propSchema.minLength) {
|
|
185
|
+
errors.push({
|
|
186
|
+
path: `/settings/${key}`,
|
|
187
|
+
message: `Property ${key} must have minLength ${propSchema.minLength}`,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return { valid: errors.length === 0, errors };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Export a factory function for creating instances
|
|
197
|
+
export function createMockFeatureManager() {
|
|
198
|
+
return new MockFeatureManager();
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=MockFeatureManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockFeatureManager.js","sourceRoot":"","sources":["../../../../src/__tests__/features/mocks/MockFeatureManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,OAAO,kBAAkB;IACrB,QAAQ,GAAyB,IAAI,GAAG,EAAE,CAAC;IAC3C,cAAc,GAAgB,IAAI,GAAG,EAAE,CAAC;IACxC,eAAe,GAAa,EAAE,CAAC;IAC/B,iBAAiB,GAAa,EAAE,CAAC;IAEzC,eAAe;IACf,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,OAAgB,EAAE,EAAE;QAC3D,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC;QAC9D,CAAC;QAED,wBAAwB;QACxB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACzB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;gBACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC5B,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAC;gBAChD,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,EAAE,SAAiB,EAAE,EAAE;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,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AG,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;gBAErC,IAAI,KAAK,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;oBAC3C,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;wBAC9D,MAAM,CAAC,IAAI,CAAC;4BACV,IAAI,EAAE,aAAa,GAAG,EAAE;4BACxB,OAAO,EAAE,YAAY,GAAG,mBAAmB;yBAC5C,CAAC,CAAC;oBACL,CAAC;oBAED,IAAI,UAAU,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;wBAChE,MAAM,CAAC,IAAI,CAAC;4BACV,IAAI,EAAE,aAAa,GAAG,EAAE;4BACxB,OAAO,EAAE,YAAY,GAAG,wBAAwB,UAAU,CAAC,SAAS,EAAE;yBACvE,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAChD,CAAC;CACF;AAED,mDAAmD;AACnD,MAAM,UAAU,wBAAwB;IACtC,OAAO,IAAI,kBAAkB,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test setup for feature system tests
|
|
3
|
+
* Configures Jest environment and custom matchers
|
|
4
|
+
*/
|
|
5
|
+
declare global {
|
|
6
|
+
namespace jest {
|
|
7
|
+
interface Matchers<R> {
|
|
8
|
+
toBeActivated(): R;
|
|
9
|
+
toBeDeactivated(): R;
|
|
10
|
+
toHaveBeenCalledBefore(other: jest.Mock): R;
|
|
11
|
+
toHaveBeenCalledAfter(other: jest.Mock): R;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
namespace NodeJS {
|
|
15
|
+
interface Global {
|
|
16
|
+
testUtils: {
|
|
17
|
+
waitFor: (ms: number) => Promise<void>;
|
|
18
|
+
mockConsole: () => void;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/__tests__/features/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,IAAI,CAAC;QACb,UAAU,QAAQ,CAAC,CAAC;YAClB,aAAa,IAAI,CAAC,CAAC;YACnB,eAAe,IAAI,CAAC,CAAC;YACrB,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;YAC5C,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;SAC5C;KACF;IAED,UAAU,MAAM,CAAC;QACf,UAAU,MAAM;YACd,SAAS,EAAE;gBACT,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;gBACvC,WAAW,EAAE,MAAM,IAAI,CAAC;aACzB,CAAC;SACH;KACF;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test setup for feature system tests
|
|
3
|
+
* Configures Jest environment and custom matchers
|
|
4
|
+
*/
|
|
5
|
+
import { featureMatchers } from './utils/test-helpers.js';
|
|
6
|
+
// Add custom matchers to Jest
|
|
7
|
+
expect.extend(featureMatchers);
|
|
8
|
+
// Configure test environment
|
|
9
|
+
beforeAll(() => {
|
|
10
|
+
// Set test environment variables
|
|
11
|
+
process.env.NODE_ENV = 'test';
|
|
12
|
+
process.env.FEATURE_SYSTEM_ENV = 'test';
|
|
13
|
+
// Increase test timeout for integration tests
|
|
14
|
+
jest.setTimeout(10000);
|
|
15
|
+
});
|
|
16
|
+
// Clean up after all tests
|
|
17
|
+
afterAll(() => {
|
|
18
|
+
// Clear any remaining timers
|
|
19
|
+
jest.clearAllTimers();
|
|
20
|
+
});
|
|
21
|
+
// Global test utilities
|
|
22
|
+
global.testUtils = {
|
|
23
|
+
// Add any global test utilities here
|
|
24
|
+
waitFor: (ms) => new Promise(resolve => setTimeout(resolve, ms)),
|
|
25
|
+
// Mock console methods to reduce noise in tests
|
|
26
|
+
mockConsole: () => {
|
|
27
|
+
const originalConsole = { ...console };
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
console.log = jest.fn();
|
|
30
|
+
console.error = jest.fn();
|
|
31
|
+
console.warn = jest.fn();
|
|
32
|
+
console.info = jest.fn();
|
|
33
|
+
});
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
console.log = originalConsole.log;
|
|
36
|
+
console.error = originalConsole.error;
|
|
37
|
+
console.warn = originalConsole.warn;
|
|
38
|
+
console.info = originalConsole.info;
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/__tests__/features/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,8BAA8B;AAC9B,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAE/B,6BAA6B;AAC7B,SAAS,CAAC,GAAG,EAAE;IACb,iCAAiC;IACjC,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC;IAC9B,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,MAAM,CAAC;IAExC,8CAA8C;IAC9C,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,2BAA2B;AAC3B,QAAQ,CAAC,GAAG,EAAE;IACZ,6BAA6B;IAC7B,IAAI,CAAC,cAAc,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,wBAAwB;AACxB,MAAM,CAAC,SAAS,GAAG;IACjB,qCAAqC;IACrC,OAAO,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAExE,gDAAgD;IAChD,WAAW,EAAE,GAAG,EAAE;QAChB,MAAM,eAAe,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QAEvC,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,GAAG,EAAE;YACb,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC;YAClC,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;YACtC,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;YACpC,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Helpers and Utilities
|
|
3
|
+
* Common utilities for feature system testing
|
|
4
|
+
*/
|
|
5
|
+
import { Feature, FeatureConfig, AdapterContext } from '../../../features/types.js';
|
|
6
|
+
import { EventEmitter } from 'events';
|
|
7
|
+
/**
|
|
8
|
+
* Creates a mock feature for testing
|
|
9
|
+
*/
|
|
10
|
+
export declare function createMockFeature(overrides?: Partial<Feature>): Feature;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a mock adapter context for testing
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMockAdapterContext(overrides?: Partial<AdapterContext>): AdapterContext;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a mock feature configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare function createMockConfig(overrides?: Partial<FeatureConfig>): FeatureConfig;
|
|
19
|
+
/**
|
|
20
|
+
* Waits for an event to be emitted
|
|
21
|
+
*/
|
|
22
|
+
export declare function waitForEvent(emitter: EventEmitter, eventName: string, timeout?: number): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a spy that tracks method calls with timing information
|
|
25
|
+
*/
|
|
26
|
+
export declare function createTimingSpy(): any;
|
|
27
|
+
/**
|
|
28
|
+
* Delays execution for testing async operations
|
|
29
|
+
*/
|
|
30
|
+
export declare function delay(ms: number): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a mock storage provider
|
|
33
|
+
*/
|
|
34
|
+
export declare function createMockStorage(): {
|
|
35
|
+
save: jest.Mock<any, any, any>;
|
|
36
|
+
load: jest.Mock<any, any, any>;
|
|
37
|
+
delete: jest.Mock<any, any, any>;
|
|
38
|
+
clear: jest.Mock<any, any, any>;
|
|
39
|
+
_storage: Map<string, any>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Custom Jest matchers for feature testing
|
|
43
|
+
*/
|
|
44
|
+
export declare const featureMatchers: {
|
|
45
|
+
toBeActivated(received: Feature): {
|
|
46
|
+
pass: boolean;
|
|
47
|
+
message: () => "Expected feature not to be activated" | "Expected feature to be activated";
|
|
48
|
+
};
|
|
49
|
+
toBeDeactivated(received: Feature): {
|
|
50
|
+
pass: boolean;
|
|
51
|
+
message: () => "Expected feature not to be deactivated" | "Expected feature to be deactivated";
|
|
52
|
+
};
|
|
53
|
+
toHaveBeenCalledBefore(received: jest.Mock, other: jest.Mock): {
|
|
54
|
+
pass: boolean;
|
|
55
|
+
message: () => string;
|
|
56
|
+
};
|
|
57
|
+
toHaveBeenCalledAfter(received: jest.Mock, other: jest.Mock): {
|
|
58
|
+
pass: boolean;
|
|
59
|
+
message: () => string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Test data fixtures
|
|
64
|
+
*/
|
|
65
|
+
export declare const fixtures: {
|
|
66
|
+
features: {
|
|
67
|
+
basic: Feature;
|
|
68
|
+
withDependencies: Feature;
|
|
69
|
+
withConfiguration: Feature;
|
|
70
|
+
withHooks: Feature;
|
|
71
|
+
};
|
|
72
|
+
configs: {
|
|
73
|
+
basic: FeatureConfig;
|
|
74
|
+
withApiKey: FeatureConfig;
|
|
75
|
+
disabled: FeatureConfig;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Performance measurement utilities
|
|
80
|
+
*/
|
|
81
|
+
export declare class PerformanceMeasurer {
|
|
82
|
+
private marks;
|
|
83
|
+
mark(name: string): void;
|
|
84
|
+
measure(name: string, startMark: string, endMark?: string): number;
|
|
85
|
+
clear(): void;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Memory usage tracker for tests
|
|
89
|
+
*/
|
|
90
|
+
export declare class MemoryTracker {
|
|
91
|
+
private snapshots;
|
|
92
|
+
snapshot(): NodeJS.MemoryUsage;
|
|
93
|
+
getGrowth(): number;
|
|
94
|
+
clear(): void;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=test-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/features/utils/test-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,wBAAgB,iBAAiB,C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