claude-flow-novice 2.15.7 → 2.15.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/.claude/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +1 -1
  2. package/.claude/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +13 -11
  3. package/.claude/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +103 -0
  4. package/.claude/skills/cfn-loop-orchestration/src/helpers/iteration-manager.ts +45 -0
  5. package/.claude/skills/cfn-loop-orchestration/src/helpers/timeout-calculator.ts +41 -0
  6. package/.claude/skills/cfn-loop-orchestration/tests/consensus.test.ts +1 -1
  7. package/.claude/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +1 -3
  8. package/.claude/skills/cfn-loop-orchestration/tests/iteration-manager.test.ts +1 -1
  9. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +1 -1
  10. package/claude-assets/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +13 -11
  11. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/consensus.ts +87 -0
  12. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +103 -0
  13. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/iteration-manager.ts +45 -0
  14. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/timeout-calculator.ts +41 -0
  15. package/claude-assets/skills/cfn-loop-orchestration/tests/consensus.test.ts +1 -1
  16. package/claude-assets/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +1 -3
  17. package/claude-assets/skills/cfn-loop-orchestration/tests/iteration-manager.test.ts +1 -1
  18. package/dist/cli/config-manager.js +109 -91
  19. package/dist/cli/config-manager.js.map +1 -1
  20. package/package.json +1 -1
@@ -100,7 +100,7 @@ npx claude-flow-novice cfn-spawn cfn-v3-coordinator \
100
100
 
101
101
  **Agent Communication Pattern:**
102
102
  - Coordinator receives broadcast messages via coordination layer
103
- - Agents signal completion via `report-completion.sh`
103
+ - Agents signal completion via Redis coordination (CLI mode only)
104
104
  - Validators wait for gate pass signal before starting
105
105
  - Product Owner receives summary and makes decision
106
106
 
@@ -318,12 +318,15 @@ automation_001 (depends on all above)
318
318
  # 3. Signal completion
319
319
  coordination-signal "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
320
320
 
321
- # 4. Report results
322
- ./.claude/skills/cfn-coordination/report-completion.sh \
323
- --task-id "$TASK_ID" \
324
- --agent-id "$AGENT_ID" \
325
- --confidence 0.95 \
326
- --result '{"deliverables": ["sheet_created"], "tests_passed": 5, "tests_total": 5}'
321
+ # 4. Report results (CLI Mode - uses Redis coordination)
322
+ # Task Mode: Simply return structured JSON output instead
323
+ if [[ -n "${TASK_ID:-}" && -n "${AGENT_ID:-}" ]]; then
324
+ redis-cli HSET "swarm:${TASK_ID}:${AGENT_ID}:result" \
325
+ confidence 0.95 \
326
+ deliverables '["sheet_created"]' \
327
+ tests_passed 5 \
328
+ tests_total 5
329
+ fi
327
330
  ```
328
331
 
329
332
  ### Loop 2 Validation
@@ -336,11 +339,10 @@ coordination-wait "swarm:${TASK_ID}:gate-passed"
336
339
  --sprint-id "$SPRINT_ID" \
337
340
  --validation-type comprehensive
338
341
 
339
- # 3. Report confidence score
340
- ./.claude/skills/cfn-coordination/report-completion.sh \
341
- --task-id "$TASK_ID" \
342
- --agent-id "$AGENT_ID" \
343
- --confidence 0.92
342
+ # 3. Report confidence score (CLI Mode)
343
+ if [[ -n "${TASK_ID:-}" && -n "${AGENT_ID:-}" ]]; then
344
+ redis-cli HSET "swarm:${TASK_ID}:${AGENT_ID}:result" confidence 0.92
345
+ fi
344
346
  ```
345
347
 
346
348
  ## API Quota Management
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Deliverable Verifier
3
+ * Verifies expected deliverables exist (prevents "consensus on vapor")
4
+ */
5
+
6
+ import * as fs from 'fs';
7
+ import * as path from 'path';
8
+ import { execSync } from 'child_process';
9
+
10
+ export interface VerificationResult {
11
+ verified: boolean;
12
+ files: string[];
13
+ missing: string[];
14
+ found: string[];
15
+ typeErrors?: string[];
16
+ gitChanges?: number;
17
+ requiresChanges?: boolean;
18
+ reason?: string;
19
+ }
20
+
21
+ const IMPLEMENTATION_KEYWORDS = [
22
+ 'create', 'build', 'implement', 'add', 'generate'
23
+ ];
24
+
25
+ /**
26
+ * Verifies expected deliverables exist
27
+ * @param params Verification parameters
28
+ * @returns VerificationResult with detailed verification status
29
+ */
30
+ export function verifyDeliverables(params: {
31
+ files: string[];
32
+ expectedTypes?: string[];
33
+ requireGitChanges?: boolean;
34
+ taskType?: string;
35
+ }): VerificationResult {
36
+ const found: string[] = [];
37
+ const missing: string[] = [];
38
+ const typeErrors: string[] = [];
39
+
40
+ // Check each file
41
+ for (const file of params.files) {
42
+ if (fs.existsSync(file)) {
43
+ found.push(file);
44
+
45
+ // Type validation if expected types specified
46
+ if (params.expectedTypes && params.expectedTypes.length > 0) {
47
+ const ext = path.extname(file);
48
+ if (!params.expectedTypes.includes(ext)) {
49
+ typeErrors.push(file);
50
+ }
51
+ }
52
+ } else {
53
+ missing.push(file);
54
+ }
55
+ }
56
+
57
+ // Git change detection
58
+ let gitChanges = 0;
59
+ if (params.requireGitChanges !== undefined) {
60
+ try {
61
+ const gitStatus = execSync('git status --short', { encoding: 'utf-8' });
62
+ gitChanges = gitStatus.trim().split('\n').filter(line => line.length > 0).length;
63
+ } catch (error) {
64
+ // Git not available or not a git repo
65
+ gitChanges = -1;
66
+ }
67
+ }
68
+
69
+ // Detect if task requires changes (implementation keywords)
70
+ const requiresChanges = params.taskType
71
+ ? IMPLEMENTATION_KEYWORDS.some(keyword =>
72
+ params.taskType!.toLowerCase().includes(keyword)
73
+ )
74
+ : false;
75
+
76
+ // Check for "consensus on vapor"
77
+ let verified = missing.length === 0 && typeErrors.length === 0;
78
+ let reason: string | undefined;
79
+
80
+ if (requiresChanges && params.requireGitChanges && gitChanges === 0 && params.files.length === 0) {
81
+ verified = false;
82
+ reason = 'Implementation task detected but no deliverables created (consensus on vapor)';
83
+ }
84
+
85
+ const result: VerificationResult = {
86
+ verified,
87
+ files: params.files,
88
+ missing,
89
+ found,
90
+ gitChanges,
91
+ requiresChanges
92
+ };
93
+
94
+ // Add optional properties only if they have values
95
+ if (typeErrors.length > 0) {
96
+ result.typeErrors = typeErrors;
97
+ }
98
+ if (reason !== undefined) {
99
+ result.reason = reason;
100
+ }
101
+
102
+ return result;
103
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Iteration Manager
3
+ * Manages CFN Loop iteration transitions and agent wake operations
4
+ */
5
+
6
+ export interface IterationPreparation {
7
+ nextIteration: number;
8
+ feedback: any;
9
+ timestamp: string;
10
+ }
11
+
12
+ export interface WakeResult {
13
+ signals: string[];
14
+ }
15
+
16
+ /**
17
+ * Prepares next iteration with feedback
18
+ * @param params Current iteration and feedback data
19
+ * @returns IterationPreparation for next iteration
20
+ */
21
+ export function prepareIteration(params: {
22
+ currentIteration: number;
23
+ feedback: any;
24
+ }): IterationPreparation {
25
+ return {
26
+ nextIteration: params.currentIteration + 1,
27
+ feedback: params.feedback,
28
+ timestamp: new Date().toISOString()
29
+ };
30
+ }
31
+
32
+ /**
33
+ * Prepares wake signals for agents
34
+ * @param agentIds Array of agent IDs to wake
35
+ * @returns WakeResult with signal identifiers
36
+ */
37
+ export function wakeAgents(agentIds: string[]): WakeResult {
38
+ const signals = agentIds.map(agentId => {
39
+ return `wake:${agentId}:${Date.now()}`;
40
+ });
41
+
42
+ return {
43
+ signals
44
+ };
45
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Timeout Calculator
3
+ * Calculates mode and phase-specific timeouts for agent execution
4
+ */
5
+
6
+ export type Mode = 'mvp' | 'standard' | 'enterprise';
7
+
8
+ const BASE_TIMEOUTS: Record<Mode, number> = {
9
+ mvp: 1800, // 30 minutes
10
+ standard: 3600, // 60 minutes
11
+ enterprise: 7200 // 120 minutes
12
+ };
13
+
14
+ const PHASE_MULTIPLIERS: Record<string, number> = {
15
+ 'phase-1': 1.0, // Backend work
16
+ 'phase-2': 1.5, // React components
17
+ 'phase-3': 2.0, // Advanced components
18
+ 'phase-4': 1.0 // Testing/integration
19
+ };
20
+
21
+ /**
22
+ * Calculates timeout based on mode and optional phase
23
+ * @param params Mode and optional phase identifier
24
+ * @returns Timeout in seconds
25
+ */
26
+ export function calculateTimeout(params: {
27
+ mode: Mode;
28
+ phase?: string;
29
+ }): number {
30
+ const baseTimeout = BASE_TIMEOUTS[params.mode] || BASE_TIMEOUTS.standard;
31
+
32
+ if (!params.phase) {
33
+ return baseTimeout;
34
+ }
35
+
36
+ // Normalize phase to lowercase for case-insensitive matching
37
+ const normalizedPhase = params.phase.toLowerCase();
38
+ const multiplier = PHASE_MULTIPLIERS[normalizedPhase] || 1.0;
39
+
40
+ return Math.floor(baseTimeout * multiplier);
41
+ }
@@ -3,7 +3,7 @@
3
3
  * Tests for collecting Loop 2 validator scores and checking thresholds
4
4
  */
5
5
 
6
- import { collectConsensus, validateConsensus, ConsensusResult, ConsensusValidation } from '../src/helpers/consensus';
6
+ import { collectConsensus, validateConsensus } from '../src/helpers/consensus';
7
7
 
8
8
  describe('consensus', () => {
9
9
  describe('collectConsensus', () => {
@@ -3,9 +3,7 @@
3
3
  * Tests for verifying expected deliverables exist (prevents "consensus on vapor")
4
4
  */
5
5
 
6
- import { verifyDeliverables, VerificationResult } from '../src/helpers/deliverable-verifier';
7
- import * as fs from 'fs';
8
- import * as path from 'path';
6
+ import { verifyDeliverables } from '../src/helpers/deliverable-verifier';
9
7
 
10
8
  describe('deliverable-verifier', () => {
11
9
  describe('file existence verification', () => {
@@ -3,7 +3,7 @@
3
3
  * Tests for managing CFN Loop iteration transitions and feedback
4
4
  */
5
5
 
6
- import { prepareIteration, wakeAgents, IterationPreparation } from '../src/helpers/iteration-manager';
6
+ import { prepareIteration, wakeAgents } from '../src/helpers/iteration-manager';
7
7
 
8
8
  describe('iteration-manager', () => {
9
9
  describe('prepareIteration', () => {
@@ -100,7 +100,7 @@ npx claude-flow-novice cfn-spawn cfn-v3-coordinator \
100
100
 
101
101
  **Agent Communication Pattern:**
102
102
  - Coordinator receives broadcast messages via coordination layer
103
- - Agents signal completion via `report-completion.sh`
103
+ - Agents signal completion via Redis coordination (CLI mode only)
104
104
  - Validators wait for gate pass signal before starting
105
105
  - Product Owner receives summary and makes decision
106
106
 
@@ -318,12 +318,15 @@ automation_001 (depends on all above)
318
318
  # 3. Signal completion
319
319
  coordination-signal "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
320
320
 
321
- # 4. Report results
322
- ./.claude/skills/cfn-coordination/report-completion.sh \
323
- --task-id "$TASK_ID" \
324
- --agent-id "$AGENT_ID" \
325
- --confidence 0.95 \
326
- --result '{"deliverables": ["sheet_created"], "tests_passed": 5, "tests_total": 5}'
321
+ # 4. Report results (CLI Mode - uses Redis coordination)
322
+ # Task Mode: Simply return structured JSON output instead
323
+ if [[ -n "${TASK_ID:-}" && -n "${AGENT_ID:-}" ]]; then
324
+ redis-cli HSET "swarm:${TASK_ID}:${AGENT_ID}:result" \
325
+ confidence 0.95 \
326
+ deliverables '["sheet_created"]' \
327
+ tests_passed 5 \
328
+ tests_total 5
329
+ fi
327
330
  ```
328
331
 
329
332
  ### Loop 2 Validation
@@ -336,11 +339,10 @@ coordination-wait "swarm:${TASK_ID}:gate-passed"
336
339
  --sprint-id "$SPRINT_ID" \
337
340
  --validation-type comprehensive
338
341
 
339
- # 3. Report confidence score
340
- ./.claude/skills/cfn-coordination/report-completion.sh \
341
- --task-id "$TASK_ID" \
342
- --agent-id "$AGENT_ID" \
343
- --confidence 0.92
342
+ # 3. Report confidence score (CLI Mode)
343
+ if [[ -n "${TASK_ID:-}" && -n "${AGENT_ID:-}" ]]; then
344
+ redis-cli HSET "swarm:${TASK_ID}:${AGENT_ID}:result" confidence 0.92
345
+ fi
344
346
  ```
345
347
 
346
348
  ## API Quota Management
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Consensus Collection and Validation
3
+ * Collects Loop 2 validator scores and validates against thresholds
4
+ */
5
+
6
+ export interface ConsensusResult {
7
+ scores: number[];
8
+ average: number;
9
+ count: number;
10
+ min: number;
11
+ max: number;
12
+ }
13
+
14
+ export interface ConsensusValidation {
15
+ passed: boolean;
16
+ average: number;
17
+ threshold: number;
18
+ mode: string;
19
+ gap: number;
20
+ }
21
+
22
+ export type Mode = 'mvp' | 'standard' | 'enterprise';
23
+
24
+ const MODE_THRESHOLDS: Record<Mode, number> = {
25
+ mvp: 0.80,
26
+ standard: 0.90,
27
+ enterprise: 0.95
28
+ };
29
+
30
+ /**
31
+ * Collects consensus scores from multiple validators
32
+ * @param scores Array of validator confidence scores (0.0-1.0)
33
+ * @returns ConsensusResult with statistics
34
+ */
35
+ export function collectConsensus(scores: number[]): ConsensusResult {
36
+ if (!scores || scores.length === 0) {
37
+ throw new Error('No consensus scores provided');
38
+ }
39
+
40
+ // Validate all scores are in valid range
41
+ for (const score of scores) {
42
+ if (score < 0 || score > 1.0) {
43
+ throw new Error(`Invalid consensus score: ${score} (must be 0.0-1.0)`);
44
+ }
45
+ }
46
+
47
+ // Calculate statistics
48
+ const sum = scores.reduce((acc, score) => acc + score, 0);
49
+ const average = sum / scores.length;
50
+ const min = Math.min(...scores);
51
+ const max = Math.max(...scores);
52
+
53
+ return {
54
+ scores,
55
+ average,
56
+ count: scores.length,
57
+ min,
58
+ max
59
+ };
60
+ }
61
+
62
+ /**
63
+ * Validates consensus against mode-specific threshold
64
+ * @param params Validation parameters
65
+ * @returns ConsensusValidation result
66
+ */
67
+ export function validateConsensus(params: {
68
+ average: number;
69
+ threshold?: number;
70
+ mode: Mode | string;
71
+ }): ConsensusValidation {
72
+ // Use explicit threshold if provided, otherwise use mode default
73
+ const threshold = params.threshold !== undefined
74
+ ? params.threshold
75
+ : MODE_THRESHOLDS[params.mode as Mode] || 0.90;
76
+
77
+ const passed = params.average >= threshold;
78
+ const gap = params.average - threshold;
79
+
80
+ return {
81
+ passed,
82
+ average: params.average,
83
+ threshold,
84
+ mode: params.mode,
85
+ gap
86
+ };
87
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Deliverable Verifier
3
+ * Verifies expected deliverables exist (prevents "consensus on vapor")
4
+ */
5
+
6
+ import * as fs from 'fs';
7
+ import * as path from 'path';
8
+ import { execSync } from 'child_process';
9
+
10
+ export interface VerificationResult {
11
+ verified: boolean;
12
+ files: string[];
13
+ missing: string[];
14
+ found: string[];
15
+ typeErrors?: string[];
16
+ gitChanges?: number;
17
+ requiresChanges?: boolean;
18
+ reason?: string;
19
+ }
20
+
21
+ const IMPLEMENTATION_KEYWORDS = [
22
+ 'create', 'build', 'implement', 'add', 'generate'
23
+ ];
24
+
25
+ /**
26
+ * Verifies expected deliverables exist
27
+ * @param params Verification parameters
28
+ * @returns VerificationResult with detailed verification status
29
+ */
30
+ export function verifyDeliverables(params: {
31
+ files: string[];
32
+ expectedTypes?: string[];
33
+ requireGitChanges?: boolean;
34
+ taskType?: string;
35
+ }): VerificationResult {
36
+ const found: string[] = [];
37
+ const missing: string[] = [];
38
+ const typeErrors: string[] = [];
39
+
40
+ // Check each file
41
+ for (const file of params.files) {
42
+ if (fs.existsSync(file)) {
43
+ found.push(file);
44
+
45
+ // Type validation if expected types specified
46
+ if (params.expectedTypes && params.expectedTypes.length > 0) {
47
+ const ext = path.extname(file);
48
+ if (!params.expectedTypes.includes(ext)) {
49
+ typeErrors.push(file);
50
+ }
51
+ }
52
+ } else {
53
+ missing.push(file);
54
+ }
55
+ }
56
+
57
+ // Git change detection
58
+ let gitChanges = 0;
59
+ if (params.requireGitChanges !== undefined) {
60
+ try {
61
+ const gitStatus = execSync('git status --short', { encoding: 'utf-8' });
62
+ gitChanges = gitStatus.trim().split('\n').filter(line => line.length > 0).length;
63
+ } catch (error) {
64
+ // Git not available or not a git repo
65
+ gitChanges = -1;
66
+ }
67
+ }
68
+
69
+ // Detect if task requires changes (implementation keywords)
70
+ const requiresChanges = params.taskType
71
+ ? IMPLEMENTATION_KEYWORDS.some(keyword =>
72
+ params.taskType!.toLowerCase().includes(keyword)
73
+ )
74
+ : false;
75
+
76
+ // Check for "consensus on vapor"
77
+ let verified = missing.length === 0 && typeErrors.length === 0;
78
+ let reason: string | undefined;
79
+
80
+ if (requiresChanges && params.requireGitChanges && gitChanges === 0 && params.files.length === 0) {
81
+ verified = false;
82
+ reason = 'Implementation task detected but no deliverables created (consensus on vapor)';
83
+ }
84
+
85
+ const result: VerificationResult = {
86
+ verified,
87
+ files: params.files,
88
+ missing,
89
+ found,
90
+ gitChanges,
91
+ requiresChanges
92
+ };
93
+
94
+ // Add optional properties only if they have values
95
+ if (typeErrors.length > 0) {
96
+ result.typeErrors = typeErrors;
97
+ }
98
+ if (reason !== undefined) {
99
+ result.reason = reason;
100
+ }
101
+
102
+ return result;
103
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Iteration Manager
3
+ * Manages CFN Loop iteration transitions and agent wake operations
4
+ */
5
+
6
+ export interface IterationPreparation {
7
+ nextIteration: number;
8
+ feedback: any;
9
+ timestamp: string;
10
+ }
11
+
12
+ export interface WakeResult {
13
+ signals: string[];
14
+ }
15
+
16
+ /**
17
+ * Prepares next iteration with feedback
18
+ * @param params Current iteration and feedback data
19
+ * @returns IterationPreparation for next iteration
20
+ */
21
+ export function prepareIteration(params: {
22
+ currentIteration: number;
23
+ feedback: any;
24
+ }): IterationPreparation {
25
+ return {
26
+ nextIteration: params.currentIteration + 1,
27
+ feedback: params.feedback,
28
+ timestamp: new Date().toISOString()
29
+ };
30
+ }
31
+
32
+ /**
33
+ * Prepares wake signals for agents
34
+ * @param agentIds Array of agent IDs to wake
35
+ * @returns WakeResult with signal identifiers
36
+ */
37
+ export function wakeAgents(agentIds: string[]): WakeResult {
38
+ const signals = agentIds.map(agentId => {
39
+ return `wake:${agentId}:${Date.now()}`;
40
+ });
41
+
42
+ return {
43
+ signals
44
+ };
45
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Timeout Calculator
3
+ * Calculates mode and phase-specific timeouts for agent execution
4
+ */
5
+
6
+ export type Mode = 'mvp' | 'standard' | 'enterprise';
7
+
8
+ const BASE_TIMEOUTS: Record<Mode, number> = {
9
+ mvp: 1800, // 30 minutes
10
+ standard: 3600, // 60 minutes
11
+ enterprise: 7200 // 120 minutes
12
+ };
13
+
14
+ const PHASE_MULTIPLIERS: Record<string, number> = {
15
+ 'phase-1': 1.0, // Backend work
16
+ 'phase-2': 1.5, // React components
17
+ 'phase-3': 2.0, // Advanced components
18
+ 'phase-4': 1.0 // Testing/integration
19
+ };
20
+
21
+ /**
22
+ * Calculates timeout based on mode and optional phase
23
+ * @param params Mode and optional phase identifier
24
+ * @returns Timeout in seconds
25
+ */
26
+ export function calculateTimeout(params: {
27
+ mode: Mode;
28
+ phase?: string;
29
+ }): number {
30
+ const baseTimeout = BASE_TIMEOUTS[params.mode] || BASE_TIMEOUTS.standard;
31
+
32
+ if (!params.phase) {
33
+ return baseTimeout;
34
+ }
35
+
36
+ // Normalize phase to lowercase for case-insensitive matching
37
+ const normalizedPhase = params.phase.toLowerCase();
38
+ const multiplier = PHASE_MULTIPLIERS[normalizedPhase] || 1.0;
39
+
40
+ return Math.floor(baseTimeout * multiplier);
41
+ }
@@ -3,7 +3,7 @@
3
3
  * Tests for collecting Loop 2 validator scores and checking thresholds
4
4
  */
5
5
 
6
- import { collectConsensus, validateConsensus, ConsensusResult, ConsensusValidation } from '../src/helpers/consensus';
6
+ import { collectConsensus, validateConsensus } from '../src/helpers/consensus';
7
7
 
8
8
  describe('consensus', () => {
9
9
  describe('collectConsensus', () => {
@@ -3,9 +3,7 @@
3
3
  * Tests for verifying expected deliverables exist (prevents "consensus on vapor")
4
4
  */
5
5
 
6
- import { verifyDeliverables, VerificationResult } from '../src/helpers/deliverable-verifier';
7
- import * as fs from 'fs';
8
- import * as path from 'path';
6
+ import { verifyDeliverables } from '../src/helpers/deliverable-verifier';
9
7
 
10
8
  describe('deliverable-verifier', () => {
11
9
  describe('file existence verification', () => {
@@ -3,7 +3,7 @@
3
3
  * Tests for managing CFN Loop iteration transitions and feedback
4
4
  */
5
5
 
6
- import { prepareIteration, wakeAgents, IterationPreparation } from '../src/helpers/iteration-manager';
6
+ import { prepareIteration, wakeAgents } from '../src/helpers/iteration-manager';
7
7
 
8
8
  describe('iteration-manager', () => {
9
9
  describe('prepareIteration', () => {
@@ -1,100 +1,118 @@
1
- import * as fs from "fs/promises";
2
- import * as path from "path";
3
- import Ajv from "ajv";
4
- import * as lodash from "lodash";
5
- let ConfigManager = class ConfigManager {
6
- static _instance = null;
7
- configPath;
8
- schemaPath;
9
- ajv;
10
- constructor(){
11
- this.configPath = path.join(process.env.HOME || "", ".claude-flow-config.json");
12
- this.schemaPath = path.join(__dirname, "../../.claude/skills/config-management/config.json");
13
- this.ajv = new Ajv();
14
- }
15
- static getInstance() {
16
- if (!ConfigManager._instance) {
17
- ConfigManager._instance = new ConfigManager();
18
- }
19
- return ConfigManager._instance;
20
- }
21
- async readConfig() {
22
- try {
23
- const configContent = await fs.readFile(this.configPath, "utf-8");
24
- return JSON.parse(configContent);
25
- } catch (error) {
26
- // If config doesn't exist, create from schema
27
- return this.resetToDefaults();
28
- }
29
- }
30
- async writeConfig(config) {
31
- const schemaContent = await fs.readFile(this.schemaPath, "utf-8");
32
- const schema = JSON.parse(schemaContent);
33
- const validate = this.ajv.compile(schema);
34
- if (!validate(config)) {
35
- throw new Error("Invalid configuration: " + this.ajv.errorsText(validate.errors));
36
- }
37
- await fs.writeFile(this.configPath, JSON.stringify(config, null, 2), "utf-8");
1
+ "use strict";
2
+ var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
3
+ function adopt(value) {
4
+ return value instanceof P ? value : new P(function(resolve) {
5
+ resolve(value);
6
+ });
38
7
  }
39
- async getValue(keyPath) {
40
- const config = await this.readConfig();
41
- const value = lodash.get(config, keyPath);
42
- if (value === undefined) {
43
- // Check if it's a custom key path not in the schema
44
- const customConfig = await this.readCustomConfig();
45
- return lodash.get(customConfig, keyPath);
8
+ return new (P || (P = Promise))(function(resolve, reject) {
9
+ function fulfilled(value) {
10
+ try {
11
+ step(generator.next(value));
12
+ } catch (e) {
13
+ reject(e);
14
+ }
46
15
  }
47
- return value;
48
- }
49
- async readCustomConfig() {
50
- try {
51
- const customConfigPath = path.join(process.env.HOME || "", ".claude-flow-custom-config.json");
52
- const customConfigContent = await fs.readFile(customConfigPath, "utf-8");
53
- return JSON.parse(customConfigContent);
54
- } catch (error) {
55
- // If custom config doesn't exist or can't be read, return empty object
56
- return {};
16
+ function rejected(value) {
17
+ try {
18
+ step(generator["throw"](value));
19
+ } catch (e) {
20
+ reject(e);
21
+ }
57
22
  }
58
- }
59
- async set(key, value) {
60
- const config = await this.readConfig();
61
- // Type assertion to handle full object
62
- if (typeof value === "object" && value !== null) {
63
- config[key] = value;
64
- } else {
65
- throw new Error("Invalid configuration value");
23
+ function step(result) {
24
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
66
25
  }
67
- await this.writeConfig(config);
68
- }
69
- async getAll() {
70
- return this.readConfig();
71
- }
72
- async resetToDefaults() {
73
- const schemaContent = await fs.readFile(this.schemaPath, "utf-8");
74
- const schema = JSON.parse(schemaContent);
75
- // Extract default values from the schema
76
- const defaultConfig = {
77
- redis: {
78
- host: schema.properties.redis.properties.host.default,
79
- port: schema.properties.redis.properties.port.default
80
- },
81
- agent: {
82
- default_strategy: schema.properties.agent.properties.default_strategy.default,
83
- max_concurrent_agents: schema.properties.agent.properties.max_concurrent_agents.default,
84
- log_level: schema.properties.agent.properties.log_level.default
85
- },
86
- security: {
87
- enabled: schema.properties.security.properties.enabled.default,
88
- max_retry_attempts: schema.properties.security.properties.max_retry_attempts.default
89
- }
26
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
27
+ });
28
+ };
29
+ var __generator = this && this.__generator || function(thisArg, body) {
30
+ var _ = {
31
+ label: 0,
32
+ sent: function() {
33
+ if (t[0] & 1) throw t[1];
34
+ return t[1];
35
+ },
36
+ trys: [],
37
+ ops: []
38
+ }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
39
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
40
+ return this;
41
+ }), g;
42
+ function verb(n) {
43
+ return function(v) {
44
+ return step([
45
+ n,
46
+ v
47
+ ]);
90
48
  };
91
- await this.writeConfig(defaultConfig);
92
- return defaultConfig;
93
49
  }
94
- };
95
- export default ConfigManager;
96
-
97
- //# sourceMappingURL=config-manager.js.mapop[1] : void 0,
50
+ function step(op) {
51
+ if (f) throw new TypeError("Generator is already executing.");
52
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
53
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
54
+ if (y = 0, t) op = [
55
+ op[0] & 2,
56
+ t.value
57
+ ];
58
+ switch(op[0]){
59
+ case 0:
60
+ case 1:
61
+ t = op;
62
+ break;
63
+ case 4:
64
+ _.label++;
65
+ return {
66
+ value: op[1],
67
+ done: false
68
+ };
69
+ case 5:
70
+ _.label++;
71
+ y = op[1];
72
+ op = [
73
+ 0
74
+ ];
75
+ continue;
76
+ case 7:
77
+ op = _.ops.pop();
78
+ _.trys.pop();
79
+ continue;
80
+ default:
81
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
82
+ _ = 0;
83
+ continue;
84
+ }
85
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
86
+ _.label = op[1];
87
+ break;
88
+ }
89
+ if (op[0] === 6 && _.label < t[1]) {
90
+ _.label = t[1];
91
+ t = op;
92
+ break;
93
+ }
94
+ if (t && _.label < t[2]) {
95
+ _.label = t[2];
96
+ _.ops.push(op);
97
+ break;
98
+ }
99
+ if (t[2]) _.ops.pop();
100
+ _.trys.pop();
101
+ continue;
102
+ }
103
+ op = body.call(thisArg, _);
104
+ } catch (e) {
105
+ op = [
106
+ 6,
107
+ e
108
+ ];
109
+ y = 0;
110
+ } finally{
111
+ f = t = 0;
112
+ }
113
+ if (op[0] & 5) throw op[1];
114
+ return {
115
+ value: op[0] ? op[1] : void 0,
98
116
  done: true
99
117
  };
100
118
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/config-manager.ts"],"sourcesContent":["import * as fs from \"fs/promises\";\nimport * as path from \"path\";\nimport Ajv from \"ajv\";\nimport * as lodash from \"lodash\";\n\ninterface ConfigSchema {\n redis: {\n host: string;\n port: number;\n password?: string;\n };\n agent: {\n default_strategy: string;\n max_concurrent_agents: number;\n log_level: \"debug\" | \"info\" | \"warn\" | \"error\";\n };\n security: {\n enabled: boolean;\n max_retry_attempts: number;\n };\n}\n\nclass ConfigManager {\n private static _instance: ConfigManager | null = null;\n private configPath: string;\n private schemaPath: string;\n private ajv: Ajv;\n\n private constructor() {\n this.configPath = path.join(\n process.env.HOME || \"\",\n \".claude-flow-config.json\",\n );\n this.schemaPath = path.join(\n __dirname,\n \"../../.claude/skills/config-management/config.json\",\n );\n this.ajv = new Ajv();\n }\n\n public static getInstance(): ConfigManager {\n if (!ConfigManager._instance) {\n ConfigManager._instance = new ConfigManager();\n }\n return ConfigManager._instance;\n }\n\n private async readConfig(): Promise<ConfigSchema> {\n try {\n const configContent = await fs.readFile(this.configPath, \"utf-8\");\n return JSON.parse(configContent) as ConfigSchema;\n } catch (error) {\n // If config doesn't exist, create from schema\n return this.resetToDefaults();\n }\n }\n\n private async writeConfig(config: ConfigSchema): Promise<void> {\n const schemaContent = await fs.readFile(this.schemaPath, \"utf-8\");\n const schema = JSON.parse(schemaContent);\n\n const validate = this.ajv.compile(schema);\n if (!validate(config)) {\n throw new Error(\n \"Invalid configuration: \" + this.ajv.errorsText(validate.errors),\n );\n }\n\n await fs.writeFile(\n this.configPath,\n JSON.stringify(config, null, 2),\n \"utf-8\",\n );\n }\n\n public async getValue(keyPath: string): Promise<any> {\n const config = await this.readConfig();\n const value = lodash.get(config, keyPath);\n\n if (value === undefined) {\n // Check if it's a custom key path not in the schema\n const customConfig = await this.readCustomConfig();\n return lodash.get(customConfig, keyPath);\n }\n\n return value;\n }\n\n private async readCustomConfig(): Promise<Record<string, any>> {\n try {\n const customConfigPath = path.join(\n process.env.HOME || \"\",\n \".claude-flow-custom-config.json\",\n );\n const customConfigContent = await fs.readFile(customConfigPath, \"utf-8\");\n return JSON.parse(customConfigContent);\n } catch (error) {\n // If custom config doesn't exist or can't be read, return empty object\n return {};\n }\n }\n\n public async set(key: keyof ConfigSchema, value: ConfigSchema[keyof ConfigSchema]): Promise<void> {\n const config = await this.readConfig();\n\n // Type assertion to handle full object\n if (typeof value === \"object\" && value !== null) {\n config[key] = value;\n } else {\n throw new Error(\"Invalid configuration value\");\n }\n\n await this.writeConfig(config);\n }\n\n public async getAll(): Promise<ConfigSchema> {\n return this.readConfig();\n }\n\n public async resetToDefaults(): Promise<ConfigSchema> {\n const schemaContent = await fs.readFile(this.schemaPath, \"utf-8\");\n const schema = JSON.parse(schemaContent);\n\n // Extract default values from the schema\n const defaultConfig: ConfigSchema = {\n redis: {\n host: schema.properties.redis.properties.host.default,\n port: schema.properties.redis.properties.port.default,\n },\n agent: {\n default_strategy:\n schema.properties.agent.properties.default_strategy.default,\n max_concurrent_agents:\n schema.properties.agent.properties.max_concurrent_agents.default,\n log_level: schema.properties.agent.properties.log_level.default,\n },\n security: {\n enabled: schema.properties.security.properties.enabled.default,\n max_retry_attempts:\n schema.properties.security.properties.max_retry_attempts.default,\n },\n };\n\n await this.writeConfig(defaultConfig);\n return defaultConfig;\n }\n}\n\nexport default ConfigManager;"],"names":["fs","path","Ajv","lodash","ConfigManager","_instance","configPath","schemaPath","ajv","join","process","env","HOME","__dirname","getInstance","readConfig","configContent","readFile","JSON","parse","error","resetToDefaults","writeConfig","config","schemaContent","schema","validate","compile","Error","errorsText","errors","writeFile","stringify","getValue","keyPath","value","get","undefined","customConfig","readCustomConfig","customConfigPath","customConfigContent","set","key","getAll","defaultConfig","redis","host","properties","default","port","agent","default_strategy","max_concurrent_agents","log_level","security","enabled","max_retry_attempts"],"mappings":"AAAA,YAAYA,QAAQ,cAAc;AAClC,YAAYC,UAAU,OAAO;AAC7B,OAAOC,SAAS,MAAM;AACtB,YAAYC,YAAY,SAAS;AAmBjC,IAAA,AAAMC,gBAAN,MAAMA;IACJ,OAAeC,YAAkC,KAAK;IAC9CC,WAAmB;IACnBC,WAAmB;IACnBC,IAAS;IAEjB,aAAsB;QACpB,IAAI,CAACF,UAAU,GAAGL,KAAKQ,IAAI,CACzBC,QAAQC,GAAG,CAACC,IAAI,IAAI,IACpB;QAEF,IAAI,CAACL,UAAU,GAAGN,KAAKQ,IAAI,CACzBI,WACA;QAEF,IAAI,CAACL,GAAG,GAAG,IAAIN;IACjB;IAEA,OAAcY,cAA6B;QACzC,IAAI,CAACV,cAAcC,SAAS,EAAE;YAC5BD,cAAcC,SAAS,GAAG,IAAID;QAChC;QACA,OAAOA,cAAcC,SAAS;IAChC;IAEA,MAAcU,aAAoC;QAChD,IAAI;YACF,MAAMC,gBAAgB,MAAMhB,GAAGiB,QAAQ,CAAC,IAAI,CAACX,UAAU,EAAE;YACzD,OAAOY,KAAKC,KAAK,CAACH;QACpB,EAAE,OAAOI,OAAO;YACd,8CAA8C;YAC9C,OAAO,IAAI,CAACC,eAAe;QAC7B;IACF;IAEA,MAAcC,YAAYC,MAAoB,EAAiB;QAC7D,MAAMC,gBAAgB,MAAMxB,GAAGiB,QAAQ,CAAC,IAAI,CAACV,UAAU,EAAE;QACzD,MAAMkB,SAASP,KAAKC,KAAK,CAACK;QAE1B,MAAME,WAAW,IAAI,CAAClB,GAAG,CAACmB,OAAO,CAACF;QAClC,IAAI,CAACC,SAASH,SAAS;YACrB,MAAM,IAAIK,MACR,4BAA4B,IAAI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B;YAClCC,OAAO;gBACLC,MAAMtB,OAAOuB,UAAU,CAACF,KAAK,CAACE,UAAU,CAACD,IAAI,CAACE,OAAO;gBACrDC,MAAMzB,OAAOuB,UAAU,CAACF,KAAK,CAACE,UAAU,CAACE,IAAI,CAACD,OAAO;YACvD;YACAE,OAAO;gBACLC,kBACE3B,OAAOuB,UAAU,CAACG,KAAK,CAACH,UAAU,CAACI,gBAAgB,CAACH,OAAO;gBAC7DI,uBACE5B,OAAOuB,UAAU,CAACG,KAAK,CAACH,UAAU,CAACK,qBAAqB,CAACJ,OAAO;gBAClEK,WAAW7B,OAAOuB,UAAU,CAACG,KAAK,CAACH,UAAU,CAACM,SAAS,CAACL,OAAO;YACjE;YACAM,UAAU;gBACRC,SAAS/B,OAAOuB,UAAU,CAACO,QAAQ,CAACP,UAAU,CAACQ,OAAO,CAACP,OAAO;gBAC9DQ,oBACEhC,OAAOuB,UAAU,CAACO,QAAQ,CAACP,UAAU,CAACS,kBAAkB,CAACR,OAAO;YACpE;QACF;QAEA,MAAM,IAAI,CAAC3B,WAAW,CAACuB;QACvB,OAAOA;IACT;AACF;AAEA,eAAezC,cAAc"} config = _a.sent();\n // Type assertion to handle both full object and nested key\n if (typeof value === \"object\" && value !== null) {\n config[key] = value;\n }\n else {\n throw new Error(\"Invalid configuration value\");\n }\n return [4 /*yield*/, this.writeConfig(config)];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.getAll = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.readConfig()];\n });\n });\n };\n ConfigManager.prototype.resetToDefaults = function () {\n return __awaiter(this, void 0, void 0, function () {\n var schemaContent, schema, defaultConfig;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fs.readFile(this.schemaPath, \"utf-8\")];\n case 1:\n schemaContent = _a.sent();\n schema = JSON.parse(schemaContent);\n defaultConfig = {\n redis: {\n host: schema.properties.redis.properties.host.default,\n port: schema.properties.redis.properties.port.default,\n },\n agent: {\n default_strategy: schema.properties.agent.properties.default_strategy.default,\n max_concurrent_agents: schema.properties.agent.properties.max_concurrent_agents.default,\n log_level: schema.properties.agent.properties.log_level.default,\n },\n security: {\n enabled: schema.properties.security.properties.enabled.default,\n max_retry_attempts: schema.properties.security.properties.max_retry_attempts.default,\n },\n };\n return [4 /*yield*/, this.writeConfig(defaultConfig)];\n case 2:\n _a.sent();\n return [2 /*return*/, defaultConfig];\n }\n });\n });\n };\n return ConfigManager;\n}());\nexports.default = ConfigManager;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","Object","create","Iterator","prototype","verb","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","defineProperty","exports","fs","require","path","ajv_1","get_1","ConfigManager","configPath","join","process","env","HOME","schemaPath","__dirname","ajv","default","getInstance","instance","readConfig","configContent","error_1","_a","readFile","JSON","parse","resetToDefaults","writeConfig","config","schemaContent","schema","validate","compile","Error","errorsText","errors","writeFile","stringify","getValue","keyPath","customConfig","undefined","readCustomConfig","customConfigPath","customConfigContent","error_2","set","key","getAll","defaultConfig","redis","host","properties","port","agent","default_strategy","max_concurrent_agents","log_level","security","enabled","max_retry_attempts"],"mappings":"AAAA;AACA,IAAIA,YAAY,AAAC,IAAI,IAAI,IAAI,CAACA,SAAS,IAAK,SAAUC,OAAO,EAAEC,UAAU,EAAEC,CAAC,EAAEC,SAAS;IACnF,SAASC,MAAMC,KAAK;QAAI,OAAOA,iBAAiBH,IAAIG,QAAQ,IAAIH,EAAE,SAAUI,OAAO;YAAIA,QAAQD;QAAQ;IAAI;IAC3G,OAAO,IAAKH,CAAAA,KAAMA,CAAAA,IAAIK,OAAM,CAAC,EAAG,SAAUD,OAAO,EAAEE,MAAM;QACrD,SAASC,UAAUJ,KAAK;YAAI,IAAI;gBAAEK,KAAKP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AI,CAACrC,OAAO;4BACzD;4BACAsC,OAAO;gCACHC,kBAAkBzB,OAAOsB,UAAU,CAACE,KAAK,CAACF,UAAU,CAACG,gBAAgB,CAACvC,OAAO;gCAC7EwC,uBAAuB1B,OAAOsB,UAAU,CAACE,KAAK,CAACF,UAAU,CAACI,qBAAqB,CAACxC,OAAO;gCACvFyC,WAAW3B,OAAOsB,UAAU,CAACE,KAAK,CAACF,UAAU,CAACK,SAAS,CAACzC,OAAO;4BACnE;4BACA0C,UAAU;gCACNC,SAAS7B,OAAOsB,UAAU,CAACM,QAAQ,CAACN,UAAU,CAACO,OAAO,CAAC3C,OAAO;gCAC9D4C,oBAAoB9B,OAAOsB,UAAU,CAACM,QAAQ,CAACN,UAAU,CAACQ,kBAAkB,CAAC5C,OAAO;4BACxF;wBACJ;wBACA,OAAO;4BAAC,EAAE,OAAO;4BAAI,IAAI,CAACW,WAAW,CAACsB;yBAAe;oBACzD,KAAK;wBACD3B,GAAG5C,IAAI;wBACP,OAAO;4BAAC,EAAE,QAAQ;4BAAIuE;yBAAc;gBAC5C;YACJ;QACJ;IACJ;IACA,OAAO1C;AACX;AACAN,QAAQe,OAAO,GAAGT"}
1
+ {"version":3,"sources":["../../src/cli/config-manager.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fs = require(\"fs/promises\");\nvar path = require(\"path\");\nvar ajv_1 = require(\"ajv\");\nvar get_1 = require(\"lodash/get\");\nvar ConfigManager = /** @class */ (function () {\n function ConfigManager() {\n this.configPath = path.join(process.env.HOME || \"\", \".claude-flow-config.json\");\n this.schemaPath = path.join(__dirname, \"../../.claude/skills/config-management/config.json\");\n this.ajv = new ajv_1.default();\n }\n ConfigManager.getInstance = function () {\n if (!ConfigManager.instance) {\n ConfigManager.instance = new ConfigManager();\n }\n return ConfigManager.instance;\n };\n ConfigManager.prototype.readConfig = function () {\n return __awaiter(this, void 0, void 0, function () {\n var configContent, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, fs.readFile(this.configPath, \"utf-8\")];\n case 1:\n configContent = _a.sent();\n return [2 /*return*/, JSON.parse(configContent)];\n case 2:\n error_1 = _a.sent();\n // If config doesn't exist, create from schema\n return [2 /*return*/, this.resetToDefaults()];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.writeConfig = function (config) {\n return __awaiter(this, void 0, void 0, function () {\n var schemaContent, schema, validate;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fs.readFile(this.schemaPath, \"utf-8\")];\n case 1:\n schemaContent = _a.sent();\n schema = JSON.parse(schemaContent);\n validate = this.ajv.compile(schema);\n if (!validate(config)) {\n throw new Error(\"Invalid configuration: \" + this.ajv.errorsText(validate.errors));\n }\n return [4 /*yield*/, fs.writeFile(this.configPath, JSON.stringify(config, null, 2), \"utf-8\")];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.getValue = function (keyPath) {\n return __awaiter(this, void 0, void 0, function () {\n var config, value, customConfig;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.readConfig()];\n case 1:\n config = _a.sent();\n value = (0, get_1.default)(config, keyPath);\n if (!(value === undefined)) return [3 /*break*/, 3];\n return [4 /*yield*/, this.readCustomConfig()];\n case 2:\n customConfig = _a.sent();\n return [2 /*return*/, (0, get_1.default)(customConfig, keyPath)];\n case 3: return [2 /*return*/, value];\n }\n });\n });\n };\n ConfigManager.prototype.readCustomConfig = function () {\n return __awaiter(this, void 0, void 0, function () {\n var customConfigPath, customConfigContent, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n customConfigPath = path.join(process.env.HOME || \"\", \".claude-flow-custom-config.json\");\n return [4 /*yield*/, fs.readFile(customConfigPath, \"utf-8\")];\n case 1:\n customConfigContent = _a.sent();\n return [2 /*return*/, JSON.parse(customConfigContent)];\n case 2:\n error_2 = _a.sent();\n // If custom config doesn't exist or can't be read, return empty object\n return [2 /*return*/, {}];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.set = function (key, value) {\n return __awaiter(this, void 0, void 0, function () {\n var config;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.readConfig()];\n case 1:\n config = _a.sent();\n // Type assertion to handle both full object and nested key\n if (typeof value === \"object\" && value !== null) {\n config[key] = value;\n }\n else {\n throw new Error(\"Invalid configuration value\");\n }\n return [4 /*yield*/, this.writeConfig(config)];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.getAll = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.readConfig()];\n });\n });\n };\n ConfigManager.prototype.resetToDefaults = function () {\n return __awaiter(this, void 0, void 0, function () {\n var schemaContent, schema, defaultConfig;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fs.readFile(this.schemaPath, \"utf-8\")];\n case 1:\n schemaContent = _a.sent();\n schema = JSON.parse(schemaContent);\n defaultConfig = {\n redis: {\n host: schema.properties.redis.properties.host.default,\n port: schema.properties.redis.properties.port.default,\n },\n agent: {\n default_strategy: schema.properties.agent.properties.default_strategy.default,\n max_concurrent_agents: schema.properties.agent.properties.max_concurrent_agents.default,\n log_level: schema.properties.agent.properties.log_level.default,\n },\n security: {\n enabled: schema.properties.security.properties.enabled.default,\n max_retry_attempts: schema.properties.security.properties.max_retry_attempts.default,\n },\n };\n return [4 /*yield*/, this.writeConfig(defaultConfig)];\n case 2:\n _a.sent();\n return [2 /*return*/, defaultConfig];\n }\n });\n });\n };\n return ConfigManager;\n}());\nexports.default = ConfigManager;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","Object","create","Iterator","prototype","verb","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","defineProperty","exports","fs","require","path","ajv_1","get_1","ConfigManager","configPath","join","process","env","HOME","schemaPath","__dirname","ajv","default","getInstance","instance","readConfig","configContent","error_1","_a","readFile","JSON","parse","resetToDefaults","writeConfig","config","schemaContent","schema","validate","compile","Error","errorsText","errors","writeFile","stringify","getValue","keyPath","customConfig","undefined","readCustomConfig","customConfigPath","customConfigContent","error_2","set","key","getAll","defaultConfig","redis","host","properties","port","agent","default_strategy","max_concurrent_agents","log_level","security","enabled","max_retry_attempts"],"mappings":"AAAA;AACA,IAAIA,YAAY,AAAC,IAAI,IAAI,IAAI,CAACA,SAAS,IAAK,SAAUC,OAAO,EAAEC,UAAU,EAAEC,CAAC,EAAEC,SAAS;IACnF,SAASC,MAAMC,KAAK;QAAI,OAAOA,iBAAiBH,IAAIG,QAAQ,IAAIH,EAAE,SAAUI,OAAO;YAAIA,QAAQD;QAAQ;IAAI;IAC3G,OAAO,IAAKH,CAAAA,KAAMA,CAAAA,IAAIK,OAAM,CAAC,EAAG,SAAUD,OAAO,EAAEE,MAAM;QACrD,SAASC,UAAUJ,KAAK;YAAI,IAAI;gBAAEK,KAAKP,UAAUQ,IAAI,CAACN;YAAS,EAAE,OAAOO,GAAG;gBAAEJ,OAAOI;YAAI;QAAE;QAC1F,SAASC,SAASR,KAAK;YAAI,IAAI;gBAAEK,KAAKP,SAAS,CAAC,QAAQ,CAACE;YAAS,EAAE,OAAOO,GAAG;gBAAEJ,OAAOI;YAAI;QAAE;QAC7F,SAASF,KAAKI,MAAM;YAAIA,OAAOC,IAAI,GAAGT,QAAQQ,OAAOT,KAAK,IAAID,MAAMU,OAAOT,KAAK,EAAEW,IAAI,CAACP,WAAWI;QAAW;QAC7GH,KAA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,CAACN,UAAU,CAACO,OAAO,CAAC3C,OAAO;gCAC9D4C,oBAAoB9B,OAAOsB,UAAU,CAACM,QAAQ,CAACN,UAAU,CAACQ,kBAAkB,CAAC5C,OAAO;4BACxF;wBACJ;wBACA,OAAO;4BAAC,EAAE,OAAO;4BAAI,IAAI,CAACW,WAAW,CAACsB;yBAAe;oBACzD,KAAK;wBACD3B,GAAG5C,IAAI;wBACP,OAAO;4BAAC,EAAE,QAAQ;4BAAIuE;yBAAc;gBAC5C;YACJ;QACJ;IACJ;IACA,OAAO1C;AACX;AACAN,QAAQe,OAAO,GAAGT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow-novice",
3
- "version": "2.15.7",
3
+ "version": "2.15.8",
4
4
  "description": "AI agent orchestration framework with namespace-isolated skills, agents, and CFN Loop validation. Safe installation with ~0.01% collision risk.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",