@codemcp/workflows 6.3.1 → 6.5.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.
- package/package.json +2 -2
- package/packages/cli/dist/{chunk-D2Q6Y3QQ.js → chunk-4AZGS2GG.js} +321 -388
- package/packages/cli/dist/{cli-QV7U6L54.js → cli-ZCCFBQTP.js} +12 -17
- package/packages/cli/dist/{dist-W7PPKVFG.js → dist-I6VSREAJ.js} +11 -5
- package/packages/cli/dist/{dist-W7VMGB3G.js → dist-MW7THWM3.js} +875 -1136
- package/packages/cli/dist/index.js +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/resources/workflows/bugfix.yaml +14 -0
- package/packages/cli/resources/workflows/epcc.yaml +12 -0
- package/packages/cli/resources/workflows/greenfield.yaml +16 -0
- package/packages/cli/resources/workflows/minor.yaml +8 -0
- package/packages/cli/resources/workflows/skilled-bugfix.yaml +6 -6
- package/packages/cli/resources/workflows/skilled-epcc.yaml +8 -8
- package/packages/cli/resources/workflows/skilled-greenfield.yaml +8 -7
- package/packages/cli/resources/workflows/tdd.yaml +10 -0
- package/packages/cli/resources/workflows/waterfall.yaml +16 -0
- package/packages/core/dist/beads-integration.d.ts +3 -5
- package/packages/core/dist/beads-integration.js +29 -35
- package/packages/core/dist/beads-integration.js.map +1 -1
- package/packages/core/dist/beads-state-manager.d.ts +3 -1
- package/packages/core/dist/beads-state-manager.js +17 -15
- package/packages/core/dist/beads-state-manager.js.map +1 -1
- package/packages/core/dist/file-detection-manager.js +15 -22
- package/packages/core/dist/file-detection-manager.js.map +1 -1
- package/packages/core/dist/index.d.ts +1 -0
- package/packages/core/dist/index.js +1 -0
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/instruction-generator.d.ts +3 -7
- package/packages/core/dist/instruction-generator.js +17 -25
- package/packages/core/dist/instruction-generator.js.map +1 -1
- package/packages/core/dist/interfaces/instruction-generator.interface.d.ts +13 -4
- package/packages/core/dist/interfaces/plan-manager.interface.d.ts +9 -0
- package/packages/core/dist/logger.d.ts +49 -20
- package/packages/core/dist/logger.js +65 -141
- package/packages/core/dist/logger.js.map +1 -1
- package/packages/core/dist/plan-manager.d.ts +6 -4
- package/packages/core/dist/plan-manager.js +19 -15
- package/packages/core/dist/plan-manager.js.map +1 -1
- package/packages/core/dist/project-docs-manager.d.ts +3 -1
- package/packages/core/dist/project-docs-manager.js +11 -9
- package/packages/core/dist/project-docs-manager.js.map +1 -1
- package/packages/core/dist/state-machine-loader.d.ts +16 -0
- package/packages/core/dist/state-machine-loader.js +29 -0
- package/packages/core/dist/state-machine-loader.js.map +1 -1
- package/packages/core/dist/state-machine-types.d.ts +8 -0
- package/packages/core/dist/string-utils.d.ts +8 -0
- package/packages/core/dist/string-utils.js +14 -0
- package/packages/core/dist/string-utils.js.map +1 -0
- package/packages/core/dist/task-backend.d.ts +6 -3
- package/packages/core/dist/task-backend.js +10 -8
- package/packages/core/dist/task-backend.js.map +1 -1
- package/packages/core/dist/transition-engine.d.ts +3 -6
- package/packages/core/dist/transition-engine.js +31 -76
- package/packages/core/dist/transition-engine.js.map +1 -1
- package/packages/core/dist/workflow-manager.d.ts +2 -0
- package/packages/core/dist/workflow-manager.js +14 -2
- package/packages/core/dist/workflow-manager.js.map +1 -1
- package/packages/core/package.json +1 -1
- package/packages/core/resources/workflows/bugfix.yaml +14 -0
- package/packages/core/resources/workflows/epcc.yaml +12 -0
- package/packages/core/resources/workflows/greenfield.yaml +16 -0
- package/packages/core/resources/workflows/minor.yaml +8 -0
- package/packages/core/resources/workflows/skilled-bugfix.yaml +6 -6
- package/packages/core/resources/workflows/skilled-epcc.yaml +8 -8
- package/packages/core/resources/workflows/skilled-greenfield.yaml +8 -7
- package/packages/core/resources/workflows/tdd.yaml +10 -0
- package/packages/core/resources/workflows/waterfall.yaml +16 -0
- package/packages/docs/.vitepress/dist/404.html +1 -1
- package/packages/docs/.vitepress/dist/assets/{user_advanced-engineering.md.MkETYNtq.js → user_advanced-engineering.md.PD-xOFno.js} +2 -2
- package/packages/docs/.vitepress/dist/assets/{user_agent-setup.md.l0oJQxTR.js → user_agent-setup.md.BhcuRdG8.js} +1 -1
- package/packages/docs/.vitepress/dist/dev/ARCHITECTURE.html +1 -1
- package/packages/docs/.vitepress/dist/dev/DEVELOPMENT.html +1 -1
- package/packages/docs/.vitepress/dist/dev/LOGGING.html +1 -1
- package/packages/docs/.vitepress/dist/dev/PUBLISHING.html +1 -1
- package/packages/docs/.vitepress/dist/hashmap.json +1 -1
- package/packages/docs/.vitepress/dist/index.html +1 -1
- package/packages/docs/.vitepress/dist/user/advanced-engineering.html +4 -4
- package/packages/docs/.vitepress/dist/user/agent-setup.html +3 -3
- package/packages/docs/.vitepress/dist/user/beads-integration.html +1 -1
- package/packages/docs/.vitepress/dist/user/crowd-mcp-integration.html +1 -1
- package/packages/docs/.vitepress/dist/user/custom-workflows.html +1 -1
- package/packages/docs/.vitepress/dist/user/git-commit-feature.html +1 -1
- package/packages/docs/.vitepress/dist/user/how-it-works.html +1 -1
- package/packages/docs/.vitepress/dist/user/long-term-memory.html +1 -1
- package/packages/docs/.vitepress/dist/user/packaged-workflows.html +1 -1
- package/packages/docs/.vitepress/dist/user/tutorial.html +1 -1
- package/packages/docs/.vitepress/dist/user/workflow-selection.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/adr.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/big-bang-conversion.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/boundary-testing.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/bugfix.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/bugfix.yaml +14 -0
- package/packages/docs/.vitepress/dist/workflows/business-analysis.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/c4-analysis.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/epcc.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/epcc.yaml +12 -0
- package/packages/docs/.vitepress/dist/workflows/game-beginner.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/greenfield.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/greenfield.yaml +16 -0
- package/packages/docs/.vitepress/dist/workflows/minor.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/minor.yaml +8 -0
- package/packages/docs/.vitepress/dist/workflows/posts.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-bugfix-crowd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-bugfix.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-feature-crowd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-feature.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-greenfield-crowd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/sdd-greenfield.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/skilled-bugfix.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/skilled-bugfix.yaml +6 -6
- package/packages/docs/.vitepress/dist/workflows/skilled-epcc.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/skilled-epcc.yaml +8 -8
- package/packages/docs/.vitepress/dist/workflows/skilled-greenfield.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/skilled-greenfield.yaml +8 -7
- package/packages/docs/.vitepress/dist/workflows/slides.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/tdd.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/tdd.yaml +10 -0
- package/packages/docs/.vitepress/dist/workflows/waterfall.html +1 -1
- package/packages/docs/.vitepress/dist/workflows/waterfall.yaml +16 -0
- package/packages/docs/.vitepress/dist/workflows.html +1 -1
- package/packages/docs/package.json +1 -1
- package/packages/mcp-server/dist/index.d.ts +1027 -0
- package/packages/mcp-server/dist/index.js +879 -1140
- package/packages/mcp-server/package.json +1 -1
- package/packages/mcp-server/resources/workflows/bugfix.yaml +14 -0
- package/packages/mcp-server/resources/workflows/epcc.yaml +12 -0
- package/packages/mcp-server/resources/workflows/greenfield.yaml +16 -0
- package/packages/mcp-server/resources/workflows/minor.yaml +8 -0
- package/packages/mcp-server/resources/workflows/skilled-bugfix.yaml +6 -6
- package/packages/mcp-server/resources/workflows/skilled-epcc.yaml +8 -8
- package/packages/mcp-server/resources/workflows/skilled-greenfield.yaml +8 -7
- package/packages/mcp-server/resources/workflows/tdd.yaml +10 -0
- package/packages/mcp-server/resources/workflows/waterfall.yaml +16 -0
- package/packages/opencode-plugin/dist/index.d.ts +9 -0
- package/packages/opencode-plugin/dist/index.js +11 -0
- package/packages/opencode-plugin/dist/index.js.map +1 -0
- package/packages/opencode-plugin/dist/opencode-logger.d.ts +21 -0
- package/packages/opencode-plugin/dist/opencode-logger.js +104 -0
- package/packages/opencode-plugin/dist/opencode-logger.js.map +1 -0
- package/packages/opencode-plugin/dist/plugin.d.ts +23 -0
- package/packages/opencode-plugin/dist/plugin.js +395 -0
- package/packages/opencode-plugin/dist/plugin.js.map +1 -0
- package/packages/opencode-plugin/dist/server-context.d.ts +40 -0
- package/packages/opencode-plugin/dist/server-context.js +96 -0
- package/packages/opencode-plugin/dist/server-context.js.map +1 -0
- package/packages/opencode-plugin/dist/tool-handlers/conduct-review.d.ts +3 -0
- package/packages/opencode-plugin/dist/tool-handlers/conduct-review.js +37 -0
- package/packages/opencode-plugin/dist/tool-handlers/conduct-review.js.map +1 -0
- package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.d.ts +3 -0
- package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.js +74 -0
- package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.js.map +1 -0
- package/packages/opencode-plugin/dist/tool-handlers/reset-development.d.ts +3 -0
- package/packages/opencode-plugin/dist/tool-handlers/reset-development.js +63 -0
- package/packages/opencode-plugin/dist/tool-handlers/reset-development.js.map +1 -0
- package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.d.ts +3 -0
- package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.js +74 -0
- package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.js.map +1 -0
- package/packages/opencode-plugin/dist/tool-handlers/start-development.d.ts +3 -0
- package/packages/opencode-plugin/dist/tool-handlers/start-development.js +69 -0
- package/packages/opencode-plugin/dist/tool-handlers/start-development.js.map +1 -0
- package/packages/opencode-plugin/dist/tool-handlers/tool-helper.d.ts +10 -0
- package/packages/opencode-plugin/dist/tool-handlers/tool-helper.js +7 -0
- package/packages/opencode-plugin/dist/tool-handlers/tool-helper.js.map +1 -0
- package/packages/opencode-plugin/dist/types.d.ts +193 -0
- package/packages/opencode-plugin/dist/types.js +8 -0
- package/packages/opencode-plugin/dist/types.js.map +1 -0
- package/packages/opencode-plugin/dist/utils.d.ts +14 -0
- package/packages/opencode-plugin/dist/utils.js +26 -0
- package/packages/opencode-plugin/dist/utils.js.map +1 -0
- package/packages/opencode-plugin/package.json +52 -0
- package/packages/opencode-tui-plugin/package.json +46 -0
- package/packages/visualizer/package.json +1 -1
- package/resources/workflows/bugfix.yaml +14 -0
- package/resources/workflows/epcc.yaml +12 -0
- package/resources/workflows/greenfield.yaml +16 -0
- package/resources/workflows/minor.yaml +8 -0
- package/resources/workflows/skilled-bugfix.yaml +6 -6
- package/resources/workflows/skilled-epcc.yaml +8 -8
- package/resources/workflows/skilled-greenfield.yaml +8 -7
- package/resources/workflows/tdd.yaml +10 -0
- package/resources/workflows/waterfall.yaml +16 -0
- /package/packages/docs/.vitepress/dist/assets/{user_advanced-engineering.md.MkETYNtq.lean.js → user_advanced-engineering.md.PD-xOFno.lean.js} +0 -0
- /package/packages/docs/.vitepress/dist/assets/{user_agent-setup.md.l0oJQxTR.lean.js → user_agent-setup.md.BhcuRdG8.lean.js} +0 -0
- /package/resources/skills/application-design/{application-design.md → SKILL.md} +0 -0
- /package/resources/skills/architecture/{SKILL.md.md → SKILL.md} +0 -0
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* Handles variable substitution for project artifact references.
|
|
8
8
|
*/
|
|
9
9
|
import { ProjectDocsManager } from './project-docs-manager.js';
|
|
10
|
+
import { createLogger } from './logger.js';
|
|
11
|
+
import { capitalizePhase } from './string-utils.js';
|
|
10
12
|
export class InstructionGenerator {
|
|
11
13
|
projectDocsManager;
|
|
12
|
-
constructor(
|
|
13
|
-
|
|
14
|
-
this.projectDocsManager = new ProjectDocsManager();
|
|
14
|
+
constructor(logger = createLogger('InstructionGenerator')) {
|
|
15
|
+
this.projectDocsManager = new ProjectDocsManager(logger);
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* No-op: all phase context is provided per-call via InstructionContext.
|
|
18
19
|
*/
|
|
19
20
|
setStateMachine(_stateMachine) {
|
|
20
|
-
// stateMachine parameter kept for API compatibility but not stored since unused
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -30,7 +30,6 @@ export class InstructionGenerator {
|
|
|
30
30
|
const enhancedInstructions = await this.enhanceInstructions(substitutedInstructions, context);
|
|
31
31
|
return {
|
|
32
32
|
instructions: enhancedInstructions,
|
|
33
|
-
planFileGuidance: 'Task management guidance is now included in main instructions',
|
|
34
33
|
metadata: {
|
|
35
34
|
phase: context.phase,
|
|
36
35
|
planFilePath: context.conversationContext.planFilePath,
|
|
@@ -62,28 +61,21 @@ export class InstructionGenerator {
|
|
|
62
61
|
* Enhance base instructions with context-specific information
|
|
63
62
|
*/
|
|
64
63
|
async enhanceInstructions(baseInstructions, context) {
|
|
65
|
-
const { phase, conversationContext,
|
|
66
|
-
const phaseName =
|
|
64
|
+
const { phase, conversationContext, allowedFilePatterns } = context;
|
|
65
|
+
const phaseName = capitalizePhase(phase);
|
|
67
66
|
let workflowSection = `---
|
|
68
|
-
**
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
**Read \`${conversationContext.planFilePath}\`** for context.
|
|
68
|
+
- Focus on "${phaseName}" tasks, log decisions in "Key Decisions"
|
|
69
|
+
- Do NOT use other task/todo tools - use only the plan file for task tracking`;
|
|
70
|
+
// Add file restriction guidance if patterns are restricted
|
|
71
|
+
if (allowedFilePatterns &&
|
|
72
|
+
allowedFilePatterns.length > 0 &&
|
|
73
|
+
!allowedFilePatterns.includes('**/*') &&
|
|
74
|
+
!allowedFilePatterns.includes('*')) {
|
|
75
|
+
workflowSection += `\n- Files allowed: \`${allowedFilePatterns.join('`, `')}\``;
|
|
75
76
|
}
|
|
76
|
-
workflowSection += '\n\nCall `whats_next()` after
|
|
77
|
+
workflowSection += '\n\nCall `whats_next()` after user messages.';
|
|
77
78
|
return `## ${phaseName} Phase\n\n${baseInstructions}\n\n${workflowSection}`;
|
|
78
79
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Capitalize phase name for display
|
|
81
|
-
*/
|
|
82
|
-
capitalizePhase(phase) {
|
|
83
|
-
return phase
|
|
84
|
-
.split('_')
|
|
85
|
-
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
86
|
-
.join(' ');
|
|
87
|
-
}
|
|
88
80
|
}
|
|
89
81
|
//# sourceMappingURL=instruction-generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruction-generator.js","sourceRoot":"","sources":["../src/instruction-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"instruction-generator.js","sourceRoot":"","sources":["../src/instruction-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,MAAM,OAAO,oBAAoB;IACvB,kBAAkB,CAAqB;IAE/C,YAAY,SAAkB,YAAY,CAAC,sBAAsB,CAAC;QAChE,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;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qB,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,mBAAmB,CAC/B,gBAAwB,EACxB,OAA2B;QAE3B,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;QAEpE,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAEzC,IAAI,eAAe,GAAG;WACf,mBAAmB,CAAC,YAAY;cAC7B,SAAS;8EACuD,CAAC;QAE3E,2DAA2D;QAC3D,IACE,mBAAmB;YACnB,mBAAmB,CAAC,MAAM,GAAG,CAAC;YAC9B,CAAC,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAClC,CAAC;YACD,eAAe,IAAI,wBAAwB,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAClF,CAAC;QAED,eAAe,IAAI,8CAA8C,CAAC;QAElE,OAAO,MAAM,SAAS,aAAa,gBAAgB,OAAO,eAAe,EAAE,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -11,13 +11,13 @@ export interface InstructionContext {
|
|
|
11
11
|
conversationContext: ConversationContext;
|
|
12
12
|
transitionReason: string;
|
|
13
13
|
isModeled: boolean;
|
|
14
|
-
planFileExists: boolean;
|
|
15
14
|
/** Source of the instruction generation request - helps generators adapt output */
|
|
16
|
-
instructionSource: 'proceed_to_phase' | 'whats_next';
|
|
15
|
+
instructionSource: 'proceed_to_phase' | 'whats_next' | 'start_development';
|
|
16
|
+
/** Glob patterns for files allowed to be edited in this phase (optional) */
|
|
17
|
+
allowedFilePatterns?: string[];
|
|
17
18
|
}
|
|
18
19
|
export interface GeneratedInstructions {
|
|
19
20
|
instructions: string;
|
|
20
|
-
planFileGuidance: string;
|
|
21
21
|
metadata: {
|
|
22
22
|
phase: string;
|
|
23
23
|
planFilePath: string;
|
|
@@ -25,13 +25,22 @@ export interface GeneratedInstructions {
|
|
|
25
25
|
isModeled: boolean;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Interface for enriching generated instructions with additional guidance.
|
|
30
|
+
* Implementations can append, prepend, or transform instruction content.
|
|
31
|
+
*/
|
|
32
|
+
export interface InstructionEnricher {
|
|
33
|
+
enrichInstructions(instructions: GeneratedInstructions, context: InstructionContext): Promise<GeneratedInstructions>;
|
|
34
|
+
}
|
|
28
35
|
/**
|
|
29
36
|
* Interface for instruction generation operations
|
|
30
37
|
* All instruction generators must implement this interface
|
|
31
38
|
*/
|
|
32
39
|
export interface IInstructionGenerator {
|
|
33
40
|
/**
|
|
34
|
-
* Set the state machine definition for dynamic instruction generation
|
|
41
|
+
* Set the state machine definition for dynamic instruction generation.
|
|
42
|
+
* Implementations that derive all phase context from InstructionContext per-call
|
|
43
|
+
* may treat this as a no-op.
|
|
35
44
|
*/
|
|
36
45
|
setStateMachine(stateMachine: YamlStateMachine): void;
|
|
37
46
|
/**
|
|
@@ -52,4 +52,13 @@ export interface IPlanManager {
|
|
|
52
52
|
* Ensure plan file is deleted (verify deletion)
|
|
53
53
|
*/
|
|
54
54
|
ensurePlanFileDeleted(planFilePath: string): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Generate base instructions for the LLM after a workflow is started.
|
|
57
|
+
* Instructs the LLM to populate the Goal section and define phase entrance
|
|
58
|
+
* criteria in the freshly created plan file.
|
|
59
|
+
*
|
|
60
|
+
* @param planFilePath - Path to the plan file
|
|
61
|
+
* @param workflowDocUrl - Optional URL for workflow documentation
|
|
62
|
+
*/
|
|
63
|
+
getInitialPlanGuidance(planFilePath: string, workflowDocUrl?: string): string;
|
|
55
64
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Logging utility for
|
|
2
|
+
* Logging utility for workflows-core
|
|
3
3
|
*
|
|
4
|
-
* Provides structured logging with
|
|
5
|
-
* - Uses stderr for all local logging
|
|
6
|
-
* - Supports
|
|
4
|
+
* Provides structured logging with pluggable sinks:
|
|
5
|
+
* - Uses stderr for all local logging by default
|
|
6
|
+
* - Supports external log sinks (e.g., MCP notifications) via LogSink interface
|
|
7
7
|
* - Provides structured logging with proper levels:
|
|
8
8
|
* - debug: Tracing and detailed execution flow
|
|
9
9
|
* - info: Success operations and important milestones
|
|
10
10
|
* - warn: Expected errors and recoverable issues
|
|
11
11
|
* - error: Caught but unexpected errors
|
|
12
12
|
*/
|
|
13
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
14
13
|
export declare enum LogLevel {
|
|
15
14
|
DEBUG = 0,
|
|
16
15
|
INFO = 1,
|
|
@@ -26,35 +25,65 @@ export interface LogContext {
|
|
|
26
25
|
[key: string]: unknown;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
|
-
*
|
|
28
|
+
* Interface for external log sinks (e.g., MCP notifications, console, file)
|
|
29
|
+
* Implementations can be registered to receive log messages
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export interface LogSink {
|
|
32
|
+
/**
|
|
33
|
+
* Called when a log message should be sent to the sink
|
|
34
|
+
* @param level - Log level (debug, info, warning, error)
|
|
35
|
+
* @param logger - Component name that generated the log
|
|
36
|
+
* @param message - Log message
|
|
37
|
+
* @param context - Optional structured context
|
|
38
|
+
*/
|
|
39
|
+
log(level: 'debug' | 'info' | 'warning' | 'error', logger: string, message: string, context?: LogContext): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Logger interface for dependency injection
|
|
43
|
+
* Allows handlers to receive a logger without importing the global createLogger
|
|
44
|
+
*/
|
|
45
|
+
export interface ILogger {
|
|
46
|
+
debug(message: string, context?: LogContext): void;
|
|
47
|
+
info(message: string, context?: LogContext): void;
|
|
48
|
+
warn(message: string, context?: LogContext): void;
|
|
49
|
+
error(message: string, error?: Error, context?: LogContext): void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Factory function type for creating loggers
|
|
53
|
+
* Can be injected to provide different logging implementations
|
|
54
|
+
*/
|
|
55
|
+
export type LoggerFactory = (component: string) => ILogger;
|
|
56
|
+
/**
|
|
57
|
+
* Register a log sink to receive log messages
|
|
58
|
+
* Used by mcp-server to register MCP notification sink
|
|
59
|
+
*/
|
|
60
|
+
export declare function registerLogSink(sink: LogSink): void;
|
|
32
61
|
/**
|
|
33
|
-
*
|
|
62
|
+
* Clear the registered log sink
|
|
34
63
|
*/
|
|
35
|
-
export declare function
|
|
64
|
+
export declare function clearLogSink(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Set the logging level programmatically
|
|
67
|
+
*/
|
|
68
|
+
export declare function setLoggingLevel(level: LogLevel): void;
|
|
69
|
+
/**
|
|
70
|
+
* Set the logging level from a string (e.g., from MCP client request)
|
|
71
|
+
*/
|
|
72
|
+
export declare function setLoggingLevelFromString(level: string): void;
|
|
36
73
|
declare class Logger {
|
|
37
74
|
private component;
|
|
38
|
-
private explicitLogLevel
|
|
75
|
+
private explicitLogLevel;
|
|
39
76
|
constructor(component: string, logLevel?: LogLevel);
|
|
40
77
|
private getCurrentLogLevel;
|
|
41
78
|
private getLogLevelFromEnv;
|
|
42
79
|
private shouldLog;
|
|
43
80
|
private formatMessage;
|
|
44
81
|
/**
|
|
45
|
-
* Send log message to
|
|
82
|
+
* Send log message to registered sink if available
|
|
46
83
|
*/
|
|
47
|
-
private
|
|
84
|
+
private sendToSink;
|
|
48
85
|
debug(message: string, context?: LogContext): void;
|
|
49
86
|
info(message: string, context?: LogContext): void;
|
|
50
|
-
/**
|
|
51
|
-
* Send enhanced MCP notifications with better formatting for important events
|
|
52
|
-
*/
|
|
53
|
-
private sendEnhancedMcpNotification;
|
|
54
|
-
/**
|
|
55
|
-
* Capitalize phase name for display
|
|
56
|
-
*/
|
|
57
|
-
private capitalizePhase;
|
|
58
87
|
warn(message: string, context?: LogContext): void;
|
|
59
88
|
error(message: string, error?: Error, context?: LogContext): void;
|
|
60
89
|
child(childComponent: string): Logger;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Logging utility for
|
|
2
|
+
* Logging utility for workflows-core
|
|
3
3
|
*
|
|
4
|
-
* Provides structured logging with
|
|
5
|
-
* - Uses stderr for all local logging
|
|
6
|
-
* - Supports
|
|
4
|
+
* Provides structured logging with pluggable sinks:
|
|
5
|
+
* - Uses stderr for all local logging by default
|
|
6
|
+
* - Supports external log sinks (e.g., MCP notifications) via LogSink interface
|
|
7
7
|
* - Provides structured logging with proper levels:
|
|
8
8
|
* - debug: Tracing and detailed execution flow
|
|
9
9
|
* - info: Success operations and important milestones
|
|
@@ -18,38 +18,46 @@ export var LogLevel;
|
|
|
18
18
|
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
19
19
|
LogLevel[LogLevel["SILENT"] = 4] = "SILENT";
|
|
20
20
|
})(LogLevel || (LogLevel = {}));
|
|
21
|
-
// Global
|
|
22
|
-
let
|
|
23
|
-
// Unified logging level - can be set
|
|
21
|
+
// Global log sink reference (e.g., MCP server, custom sink)
|
|
22
|
+
let logSinkInstance = null;
|
|
23
|
+
// Unified logging level - can be set externally or via environment
|
|
24
24
|
let currentLoggingLevel = null;
|
|
25
25
|
// Test mode detection function to check at runtime
|
|
26
26
|
function isTestMode() {
|
|
27
27
|
// Check explicit environment variables
|
|
28
|
-
if (process.env
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
// Check if running in a temporary directory (common for tests)
|
|
32
|
-
const cwd = process.cwd();
|
|
33
|
-
if (cwd.includes('/tmp/') || cwd.includes('temp') || cwd.includes('test-')) {
|
|
28
|
+
if (process.env['NODE_ENV'] === 'test' || process.env['VITEST'] === 'true') {
|
|
34
29
|
return true;
|
|
35
30
|
}
|
|
36
31
|
// Check if LOG_LEVEL is explicitly set to ERROR
|
|
37
|
-
if (process.env
|
|
32
|
+
if (process.env['LOG_LEVEL'] === 'ERROR') {
|
|
38
33
|
return true;
|
|
39
34
|
}
|
|
40
35
|
return false;
|
|
41
36
|
}
|
|
42
37
|
/**
|
|
43
|
-
*
|
|
38
|
+
* Register a log sink to receive log messages
|
|
39
|
+
* Used by mcp-server to register MCP notification sink
|
|
40
|
+
*/
|
|
41
|
+
export function registerLogSink(sink) {
|
|
42
|
+
logSinkInstance = sink;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Clear the registered log sink
|
|
46
|
+
*/
|
|
47
|
+
export function clearLogSink() {
|
|
48
|
+
logSinkInstance = null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Set the logging level programmatically
|
|
44
52
|
*/
|
|
45
|
-
export function
|
|
46
|
-
|
|
53
|
+
export function setLoggingLevel(level) {
|
|
54
|
+
currentLoggingLevel = level;
|
|
47
55
|
}
|
|
48
56
|
/**
|
|
49
|
-
* Set the logging level from MCP client request
|
|
57
|
+
* Set the logging level from a string (e.g., from MCP client request)
|
|
50
58
|
*/
|
|
51
|
-
export function
|
|
52
|
-
// Map
|
|
59
|
+
export function setLoggingLevelFromString(level) {
|
|
60
|
+
// Map string levels to our internal levels
|
|
53
61
|
const levelMap = {
|
|
54
62
|
debug: LogLevel.DEBUG,
|
|
55
63
|
info: LogLevel.INFO,
|
|
@@ -79,7 +87,7 @@ class Logger {
|
|
|
79
87
|
if (isTestMode()) {
|
|
80
88
|
return LogLevel.ERROR;
|
|
81
89
|
}
|
|
82
|
-
// Use
|
|
90
|
+
// Use externally-set level if available (takes precedence)
|
|
83
91
|
if (currentLoggingLevel !== null) {
|
|
84
92
|
return currentLoggingLevel;
|
|
85
93
|
}
|
|
@@ -95,7 +103,7 @@ class Logger {
|
|
|
95
103
|
return LogLevel.INFO;
|
|
96
104
|
}
|
|
97
105
|
getLogLevelFromEnv() {
|
|
98
|
-
const envLevel = process.env
|
|
106
|
+
const envLevel = process.env['LOG_LEVEL']?.toUpperCase();
|
|
99
107
|
switch (envLevel) {
|
|
100
108
|
case 'DEBUG':
|
|
101
109
|
return LogLevel.DEBUG;
|
|
@@ -120,139 +128,54 @@ class Logger {
|
|
|
120
128
|
return `[${timestamp}] ${level.toUpperCase()} [${this.component}] ${message}${contextStr}`;
|
|
121
129
|
}
|
|
122
130
|
/**
|
|
123
|
-
* Send log message to
|
|
131
|
+
* Send log message to registered sink if available
|
|
124
132
|
*/
|
|
125
|
-
async
|
|
126
|
-
if (
|
|
133
|
+
async sendToSink(level, message, context) {
|
|
134
|
+
if (logSinkInstance) {
|
|
127
135
|
try {
|
|
128
|
-
|
|
129
|
-
let logData = message;
|
|
130
|
-
if (context) {
|
|
131
|
-
try {
|
|
132
|
-
const contextStr = JSON.stringify(context, null, 0);
|
|
133
|
-
logData = `${message} ${contextStr}`;
|
|
134
|
-
}
|
|
135
|
-
catch (_error) {
|
|
136
|
-
// If JSON serialization fails, just use the message
|
|
137
|
-
logData = `${message} [context serialization failed]`;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
await mcpServerInstance.server.notification({
|
|
141
|
-
method: 'notifications/message',
|
|
142
|
-
params: {
|
|
143
|
-
level,
|
|
144
|
-
logger: this.component,
|
|
145
|
-
data: logData,
|
|
146
|
-
},
|
|
147
|
-
});
|
|
136
|
+
await logSinkInstance.log(level, this.component, message, context);
|
|
148
137
|
}
|
|
149
138
|
catch (error) {
|
|
150
|
-
// Fallback to stderr if
|
|
151
|
-
// Don't use this.error to avoid infinite recursion
|
|
139
|
+
// Fallback to stderr if sink fails
|
|
152
140
|
if (!isTestMode()) {
|
|
153
|
-
process.stderr.write(`[
|
|
141
|
+
process.stderr.write(`[LOG-SINK-ERROR] Failed to send log to sink: ${error}\n`);
|
|
154
142
|
}
|
|
155
143
|
}
|
|
156
144
|
}
|
|
157
145
|
}
|
|
158
146
|
debug(message, context) {
|
|
159
147
|
if (this.shouldLog(LogLevel.DEBUG)) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
148
|
+
// Avoid duplicate output when a sink is active (sink owns its own output channel)
|
|
149
|
+
if (!logSinkInstance) {
|
|
150
|
+
const formattedMessage = this.formatMessage('debug', message, context);
|
|
151
|
+
process.stderr.write(formattedMessage + '\n');
|
|
152
|
+
}
|
|
153
|
+
this.sendToSink('debug', message, context).catch(() => {
|
|
154
|
+
// Sink errors are non-fatal for debug messages
|
|
166
155
|
});
|
|
167
156
|
}
|
|
168
157
|
}
|
|
169
158
|
info(message, context) {
|
|
170
159
|
if (this.shouldLog(LogLevel.INFO)) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
this.sendEnhancedMcpNotification('info', message, context).catch(() => {
|
|
176
|
-
// Ignore MCP notification errors for info messages
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Send enhanced MCP notifications with better formatting for important events
|
|
182
|
-
*/
|
|
183
|
-
async sendEnhancedMcpNotification(level, message, context) {
|
|
184
|
-
if (mcpServerInstance) {
|
|
185
|
-
try {
|
|
186
|
-
let enhancedMessage = message;
|
|
187
|
-
let notificationLevel = level;
|
|
188
|
-
// Enhance phase transition messages
|
|
189
|
-
if (context &&
|
|
190
|
-
(context.from || context.to) &&
|
|
191
|
-
message.includes('transition')) {
|
|
192
|
-
const from = context.from
|
|
193
|
-
? this.capitalizePhase(context.from)
|
|
194
|
-
: '';
|
|
195
|
-
const to = context.to
|
|
196
|
-
? this.capitalizePhase(context.to)
|
|
197
|
-
: '';
|
|
198
|
-
if (from && to) {
|
|
199
|
-
enhancedMessage = `Phase Transition: ${from} → ${to}`;
|
|
200
|
-
notificationLevel = 'info';
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
// Enhance initialization messages
|
|
204
|
-
if (message.includes('initialized successfully')) {
|
|
205
|
-
enhancedMessage = '🚀 Vibe Feature MCP Server Ready';
|
|
206
|
-
notificationLevel = 'info';
|
|
207
|
-
}
|
|
208
|
-
// Safely serialize context to avoid JSON issues
|
|
209
|
-
let logData = enhancedMessage;
|
|
210
|
-
if (context) {
|
|
211
|
-
try {
|
|
212
|
-
const contextStr = JSON.stringify(context, null, 0);
|
|
213
|
-
logData = `${enhancedMessage} ${contextStr}`;
|
|
214
|
-
}
|
|
215
|
-
catch (_error) {
|
|
216
|
-
// If JSON serialization fails, just use the message
|
|
217
|
-
logData = `${enhancedMessage} [context serialization failed]`;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
// Use the underlying server's notification method
|
|
221
|
-
await mcpServerInstance.server.notification({
|
|
222
|
-
method: 'notifications/message',
|
|
223
|
-
params: {
|
|
224
|
-
level: notificationLevel,
|
|
225
|
-
logger: this.component,
|
|
226
|
-
data: logData,
|
|
227
|
-
},
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
catch (error) {
|
|
231
|
-
// Fallback to stderr if MCP notification fails
|
|
232
|
-
// Don't use this.error to avoid infinite recursion
|
|
233
|
-
if (!isTestMode()) {
|
|
234
|
-
process.stderr.write(`[MCP-LOG-ERROR] Failed to send log notification: ${error}\n`);
|
|
235
|
-
}
|
|
160
|
+
// Avoid duplicate output when a sink is active (sink owns its own output channel)
|
|
161
|
+
if (!logSinkInstance) {
|
|
162
|
+
const formattedMessage = this.formatMessage('info', message, context);
|
|
163
|
+
process.stderr.write(formattedMessage + '\n');
|
|
236
164
|
}
|
|
165
|
+
this.sendToSink('info', message, context).catch(() => {
|
|
166
|
+
// Sink errors are non-fatal for info messages
|
|
167
|
+
});
|
|
237
168
|
}
|
|
238
169
|
}
|
|
239
|
-
/**
|
|
240
|
-
* Capitalize phase name for display
|
|
241
|
-
*/
|
|
242
|
-
capitalizePhase(phase) {
|
|
243
|
-
return phase
|
|
244
|
-
.split('_')
|
|
245
|
-
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
246
|
-
.join(' ');
|
|
247
|
-
}
|
|
248
170
|
warn(message, context) {
|
|
249
171
|
if (this.shouldLog(LogLevel.WARN)) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
172
|
+
// Avoid duplicate output when a sink is active (sink owns its own output channel)
|
|
173
|
+
if (!logSinkInstance) {
|
|
174
|
+
const formattedMessage = this.formatMessage('warn', message, context);
|
|
175
|
+
process.stderr.write(formattedMessage + '\n');
|
|
176
|
+
}
|
|
177
|
+
this.sendToSink('warning', message, context).catch(() => {
|
|
178
|
+
// Sink errors are non-fatal for warn messages
|
|
256
179
|
});
|
|
257
180
|
}
|
|
258
181
|
}
|
|
@@ -261,12 +184,13 @@ class Logger {
|
|
|
261
184
|
const errorContext = error
|
|
262
185
|
? { ...context, error: error.message, stack: error.stack }
|
|
263
186
|
: context;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
187
|
+
// Avoid duplicate output when a sink is active (sink owns its own output channel)
|
|
188
|
+
if (!logSinkInstance) {
|
|
189
|
+
const formattedMessage = this.formatMessage('error', message, errorContext);
|
|
190
|
+
process.stderr.write(formattedMessage + '\n');
|
|
191
|
+
}
|
|
192
|
+
this.sendToSink('error', message, errorContext).catch(() => {
|
|
193
|
+
// Sink errors are non-fatal — error already written to stderr above
|
|
270
194
|
});
|
|
271
195
|
}
|
|
272
196
|
}
|
|
@@ -279,5 +203,5 @@ export function createLogger(component, logLevel) {
|
|
|
279
203
|
return new Logger(component, logLevel);
|
|
280
204
|
}
|
|
281
205
|
// Default logger for the main application
|
|
282
|
-
export const logger = createLogger('
|
|
206
|
+
export const logger = createLogger('workflows-core');
|
|
283
207
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;G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AM,MAAM,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -54,13 +54,15 @@ export declare class PlanManager implements IPlanManager {
|
|
|
54
54
|
* Ensure plan file is deleted (verify deletion)
|
|
55
55
|
*/
|
|
56
56
|
ensurePlanFileDeleted(planFilePath: string): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* Capitalize phase name for display
|
|
59
|
-
*/
|
|
60
|
-
private capitalizePhase;
|
|
61
57
|
/**
|
|
62
58
|
* Generate workflow documentation URL for predefined workflows
|
|
63
59
|
* Returns undefined for custom workflows
|
|
64
60
|
*/
|
|
65
61
|
private generateWorkflowDocumentationUrl;
|
|
62
|
+
/**
|
|
63
|
+
* Generate base instructions for the LLM after a workflow is started.
|
|
64
|
+
* Instructs the LLM to populate the Goal section and define phase entrance
|
|
65
|
+
* criteria in the freshly created plan file.
|
|
66
|
+
*/
|
|
67
|
+
getInitialPlanGuidance(planFilePath: string, workflowDocUrl?: string): string;
|
|
66
68
|
}
|