@houtini/lm 1.0.13 → 2.0.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/dist/index.d.ts +5 -3
- package/dist/index.js +142 -213
- package/dist/index.js.map +1 -1
- package/package.json +10 -33
- package/CHANGELOG.md +0 -282
- package/dist/cache/analysis-cache.d.ts +0 -33
- package/dist/cache/analysis-cache.d.ts.map +0 -1
- package/dist/cache/analysis-cache.js +0 -56
- package/dist/cache/analysis-cache.js.map +0 -1
- package/dist/cache/cache-manager.d.ts +0 -29
- package/dist/cache/cache-manager.d.ts.map +0 -1
- package/dist/cache/cache-manager.js +0 -85
- package/dist/cache/cache-manager.js.map +0 -1
- package/dist/cache/index.d.ts +0 -16
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/index.js +0 -17
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/prompt-cache.d.ts +0 -33
- package/dist/cache/prompt-cache.d.ts.map +0 -1
- package/dist/cache/prompt-cache.js +0 -61
- package/dist/cache/prompt-cache.js.map +0 -1
- package/dist/config.d.ts +0 -41
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -71
- package/dist/config.js.map +0 -1
- package/dist/core/ThreeStagePromptManager.d.ts +0 -23
- package/dist/core/ThreeStagePromptManager.d.ts.map +0 -1
- package/dist/core/ThreeStagePromptManager.js +0 -118
- package/dist/core/ThreeStagePromptManager.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugins/base-plugin.d.ts +0 -55
- package/dist/plugins/base-plugin.d.ts.map +0 -1
- package/dist/plugins/base-plugin.js +0 -120
- package/dist/plugins/base-plugin.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -58
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -162
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -5
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -5
- package/dist/plugins/types.js.map +0 -1
- package/dist/prompts/analyze/code-quality.d.ts +0 -116
- package/dist/prompts/analyze/code-quality.d.ts.map +0 -1
- package/dist/prompts/analyze/code-quality.js +0 -437
- package/dist/prompts/analyze/code-quality.js.map +0 -1
- package/dist/prompts/analyze/compare-integration.d.ts +0 -130
- package/dist/prompts/analyze/compare-integration.d.ts.map +0 -1
- package/dist/prompts/analyze/compare-integration.js +0 -547
- package/dist/prompts/analyze/compare-integration.js.map +0 -1
- package/dist/prompts/analyze/count-files.d.ts +0 -109
- package/dist/prompts/analyze/count-files.d.ts.map +0 -1
- package/dist/prompts/analyze/count-files.js +0 -403
- package/dist/prompts/analyze/count-files.js.map +0 -1
- package/dist/prompts/analyze/database-queries.d.ts +0 -156
- package/dist/prompts/analyze/database-queries.d.ts.map +0 -1
- package/dist/prompts/analyze/database-queries.js +0 -763
- package/dist/prompts/analyze/database-queries.js.map +0 -1
- package/dist/prompts/analyze/dependencies.d.ts +0 -97
- package/dist/prompts/analyze/dependencies.d.ts.map +0 -1
- package/dist/prompts/analyze/dependencies.js +0 -337
- package/dist/prompts/analyze/dependencies.js.map +0 -1
- package/dist/prompts/analyze/diff-signatures.d.ts +0 -139
- package/dist/prompts/analyze/diff-signatures.d.ts.map +0 -1
- package/dist/prompts/analyze/diff-signatures.js +0 -708
- package/dist/prompts/analyze/diff-signatures.js.map +0 -1
- package/dist/prompts/analyze/find-patterns.d.ts +0 -128
- package/dist/prompts/analyze/find-patterns.d.ts.map +0 -1
- package/dist/prompts/analyze/find-patterns.js +0 -524
- package/dist/prompts/analyze/find-patterns.js.map +0 -1
- package/dist/prompts/analyze/find-unused-css.d.ts +0 -151
- package/dist/prompts/analyze/find-unused-css.d.ts.map +0 -1
- package/dist/prompts/analyze/find-unused-css.js +0 -760
- package/dist/prompts/analyze/find-unused-css.js.map +0 -1
- package/dist/prompts/analyze/n8n-workflow.d.ts +0 -137
- package/dist/prompts/analyze/n8n-workflow.d.ts.map +0 -1
- package/dist/prompts/analyze/n8n-workflow.js +0 -533
- package/dist/prompts/analyze/n8n-workflow.js.map +0 -1
- package/dist/prompts/analyze/project-structure.d.ts +0 -126
- package/dist/prompts/analyze/project-structure.d.ts.map +0 -1
- package/dist/prompts/analyze/project-structure.js +0 -573
- package/dist/prompts/analyze/project-structure.js.map +0 -1
- package/dist/prompts/analyze/security-audit.d.ts +0 -142
- package/dist/prompts/analyze/security-audit.d.ts.map +0 -1
- package/dist/prompts/analyze/security-audit.js +0 -641
- package/dist/prompts/analyze/security-audit.js.map +0 -1
- package/dist/prompts/analyze/single-file.d.ts +0 -162
- package/dist/prompts/analyze/single-file.d.ts.map +0 -1
- package/dist/prompts/analyze/single-file.js +0 -669
- package/dist/prompts/analyze/single-file.js.map +0 -1
- package/dist/prompts/analyze/trace-execution.d.ts +0 -126
- package/dist/prompts/analyze/trace-execution.d.ts.map +0 -1
- package/dist/prompts/analyze/trace-execution.js +0 -613
- package/dist/prompts/analyze/trace-execution.js.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts +0 -116
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-audit.js +0 -456
- package/dist/prompts/analyze/wordpress-plugin-audit.js.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts +0 -103
- package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-readiness.js +0 -506
- package/dist/prompts/analyze/wordpress-plugin-readiness.js.map +0 -1
- package/dist/prompts/analyze/wordpress-security.d.ts +0 -146
- package/dist/prompts/analyze/wordpress-security.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-security.js +0 -702
- package/dist/prompts/analyze/wordpress-security.js.map +0 -1
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts +0 -114
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-theme-audit.js +0 -540
- package/dist/prompts/analyze/wordpress-theme-audit.js.map +0 -1
- package/dist/prompts/custom/custom-prompt.d.ts +0 -135
- package/dist/prompts/custom/custom-prompt.d.ts.map +0 -1
- package/dist/prompts/custom/custom-prompt.js +0 -421
- package/dist/prompts/custom/custom-prompt.js.map +0 -1
- package/dist/prompts/fun/arcade-game.d.ts +0 -152
- package/dist/prompts/fun/arcade-game.d.ts.map +0 -1
- package/dist/prompts/fun/arcade-game.js +0 -657
- package/dist/prompts/fun/arcade-game.js.map +0 -1
- package/dist/prompts/fun/create_text_adventure.d.ts +0 -100
- package/dist/prompts/fun/create_text_adventure.d.ts.map +0 -1
- package/dist/prompts/fun/create_text_adventure.js +0 -401
- package/dist/prompts/fun/create_text_adventure.js.map +0 -1
- package/dist/prompts/fun/css-art-generator.d.ts +0 -168
- package/dist/prompts/fun/css-art-generator.d.ts.map +0 -1
- package/dist/prompts/fun/css-art-generator.js +0 -831
- package/dist/prompts/fun/css-art-generator.js.map +0 -1
- package/dist/prompts/generate/project-documentation.d.ts +0 -137
- package/dist/prompts/generate/project-documentation.d.ts.map +0 -1
- package/dist/prompts/generate/project-documentation.js +0 -670
- package/dist/prompts/generate/project-documentation.js.map +0 -1
- package/dist/prompts/generate/refactoring.d.ts +0 -164
- package/dist/prompts/generate/refactoring.d.ts.map +0 -1
- package/dist/prompts/generate/refactoring.js +0 -625
- package/dist/prompts/generate/refactoring.js.map +0 -1
- package/dist/prompts/generate/responsive-component.d.ts +0 -147
- package/dist/prompts/generate/responsive-component.d.ts.map +0 -1
- package/dist/prompts/generate/responsive-component.js +0 -957
- package/dist/prompts/generate/responsive-component.js.map +0 -1
- package/dist/prompts/generate/typescript-conversion.d.ts +0 -144
- package/dist/prompts/generate/typescript-conversion.d.ts.map +0 -1
- package/dist/prompts/generate/typescript-conversion.js +0 -531
- package/dist/prompts/generate/typescript-conversion.js.map +0 -1
- package/dist/prompts/generate/unit-tests.d.ts +0 -139
- package/dist/prompts/generate/unit-tests.d.ts.map +0 -1
- package/dist/prompts/generate/unit-tests.js +0 -582
- package/dist/prompts/generate/unit-tests.js.map +0 -1
- package/dist/prompts/generate/wordpress-plugin.d.ts +0 -179
- package/dist/prompts/generate/wordpress-plugin.d.ts.map +0 -1
- package/dist/prompts/generate/wordpress-plugin.js +0 -767
- package/dist/prompts/generate/wordpress-plugin.js.map +0 -1
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts +0 -177
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts.map +0 -1
- package/dist/prompts/generate/wordpress-theme-from-static.js +0 -699
- package/dist/prompts/generate/wordpress-theme-from-static.js.map +0 -1
- package/dist/prompts/shared/cache-manager.d.ts +0 -45
- package/dist/prompts/shared/cache-manager.d.ts.map +0 -1
- package/dist/prompts/shared/cache-manager.js +0 -129
- package/dist/prompts/shared/cache-manager.js.map +0 -1
- package/dist/prompts/shared/helpers.d.ts +0 -39
- package/dist/prompts/shared/helpers.d.ts.map +0 -1
- package/dist/prompts/shared/helpers.js +0 -151
- package/dist/prompts/shared/helpers.js.map +0 -1
- package/dist/prompts/shared/templates.d.ts +0 -35
- package/dist/prompts/shared/templates.d.ts.map +0 -1
- package/dist/prompts/shared/templates.js +0 -77
- package/dist/prompts/shared/templates.js.map +0 -1
- package/dist/prompts/shared/types.d.ts +0 -112
- package/dist/prompts/shared/types.d.ts.map +0 -1
- package/dist/prompts/shared/types.js +0 -5
- package/dist/prompts/shared/types.js.map +0 -1
- package/dist/prompts/system/find-unused-files.d.ts +0 -106
- package/dist/prompts/system/find-unused-files.d.ts.map +0 -1
- package/dist/prompts/system/find-unused-files.js +0 -357
- package/dist/prompts/system/find-unused-files.js.map +0 -1
- package/dist/security/index.d.ts +0 -39
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js +0 -46
- package/dist/security/index.js.map +0 -1
- package/dist/security/integration-helpers.d.ts +0 -121
- package/dist/security/integration-helpers.d.ts.map +0 -1
- package/dist/security/integration-helpers.js +0 -190
- package/dist/security/integration-helpers.js.map +0 -1
- package/dist/security/output-encoder.d.ts +0 -94
- package/dist/security/output-encoder.d.ts.map +0 -1
- package/dist/security/output-encoder.js +0 -295
- package/dist/security/output-encoder.js.map +0 -1
- package/dist/security/prompt-injection-guard.d.ts +0 -59
- package/dist/security/prompt-injection-guard.d.ts.map +0 -1
- package/dist/security/prompt-injection-guard.js +0 -249
- package/dist/security/prompt-injection-guard.js.map +0 -1
- package/dist/security/sanitisation.d.ts +0 -67
- package/dist/security/sanitisation.d.ts.map +0 -1
- package/dist/security/sanitisation.js +0 -398
- package/dist/security/sanitisation.js.map +0 -1
- package/dist/security/security-service.d.ts +0 -103
- package/dist/security/security-service.d.ts.map +0 -1
- package/dist/security/security-service.js +0 -303
- package/dist/security/security-service.js.map +0 -1
- package/dist/security-config.d.ts +0 -45
- package/dist/security-config.d.ts.map +0 -1
- package/dist/security-config.js +0 -63
- package/dist/security-config.js.map +0 -1
- package/dist/system/function-list.d.ts +0 -61
- package/dist/system/function-list.d.ts.map +0 -1
- package/dist/system/function-list.js +0 -111
- package/dist/system/function-list.js.map +0 -1
- package/dist/system/function-registry.d.ts +0 -23
- package/dist/system/function-registry.d.ts.map +0 -1
- package/dist/system/function-registry.js +0 -136
- package/dist/system/function-registry.js.map +0 -1
- package/dist/system/health-check.d.ts +0 -33
- package/dist/system/health-check.d.ts.map +0 -1
- package/dist/system/health-check.js +0 -98
- package/dist/system/health-check.js.map +0 -1
- package/dist/system/path-resolver.d.ts +0 -55
- package/dist/system/path-resolver.d.ts.map +0 -1
- package/dist/system/path-resolver.js +0 -90
- package/dist/system/path-resolver.js.map +0 -1
- package/dist/templates/plugin-template.d.ts +0 -121
- package/dist/templates/plugin-template.d.ts.map +0 -1
- package/dist/templates/plugin-template.js +0 -454
- package/dist/templates/plugin-template.js.map +0 -1
- package/dist/types/chunking-types.d.ts +0 -88
- package/dist/types/chunking-types.d.ts.map +0 -1
- package/dist/types/chunking-types.js +0 -18
- package/dist/types/chunking-types.js.map +0 -1
- package/dist/types/prompt-stages.d.ts +0 -30
- package/dist/types/prompt-stages.d.ts.map +0 -1
- package/dist/types/prompt-stages.js +0 -6
- package/dist/types/prompt-stages.js.map +0 -1
- package/dist/types.d.ts +0 -45
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -6
- package/dist/types.js.map +0 -1
- package/dist/utils/css-parser.d.ts +0 -26
- package/dist/utils/css-parser.d.ts.map +0 -1
- package/dist/utils/css-parser.js +0 -117
- package/dist/utils/css-parser.js.map +0 -1
- package/dist/utils/path-resolver.d.ts +0 -13
- package/dist/utils/path-resolver.d.ts.map +0 -1
- package/dist/utils/path-resolver.js +0 -78
- package/dist/utils/path-resolver.js.map +0 -1
- package/dist/utils/plugin-utilities.d.ts +0 -176
- package/dist/utils/plugin-utilities.d.ts.map +0 -1
- package/dist/utils/plugin-utilities.js +0 -269
- package/dist/utils/plugin-utilities.js.map +0 -1
- package/dist/utils/streamHandler.d.ts +0 -3
- package/dist/utils/streamHandler.d.ts.map +0 -1
- package/dist/utils/streamHandler.js +0 -137
- package/dist/utils/streamHandler.js.map +0 -1
- package/dist/validation/output-validator.d.ts +0 -136
- package/dist/validation/output-validator.d.ts.map +0 -1
- package/dist/validation/output-validator.js +0 -262
- package/dist/validation/output-validator.js.map +0 -1
- package/dist/validation/response-factory.d.ts +0 -44
- package/dist/validation/response-factory.d.ts.map +0 -1
- package/dist/validation/response-factory.js +0 -202
- package/dist/validation/response-factory.js.map +0 -1
- package/dist/validation/schemas.d.ts +0 -519
- package/dist/validation/schemas.d.ts.map +0 -1
- package/dist/validation/schemas.js +0 -6
- package/dist/validation/schemas.js.map +0 -1
package/dist/config.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration for Houtini LM MCP Server v1.0
|
|
3
|
-
* Modern plugin architecture - prompts are handled by individual plugins
|
|
4
|
-
*/
|
|
5
|
-
import { Config } from './types.js';
|
|
6
|
-
export declare const config: Config;
|
|
7
|
-
/**
|
|
8
|
-
* Default LM Studio configuration
|
|
9
|
-
*/
|
|
10
|
-
export declare const lmStudioConfig: {
|
|
11
|
-
baseUrl: string;
|
|
12
|
-
timeout: number;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* File processing limits
|
|
16
|
-
*/
|
|
17
|
-
export declare const fileProcessingLimits: {
|
|
18
|
-
maxFileSize: number;
|
|
19
|
-
supportedTypes: string[];
|
|
20
|
-
chunkSize: number;
|
|
21
|
-
parallelProcessingThreshold: number;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Model parameters for different operation types
|
|
25
|
-
* maxTokens now calculated dynamically by TokenCalculator based on context window
|
|
26
|
-
*/
|
|
27
|
-
export declare const modelParameters: {
|
|
28
|
-
analysis: {
|
|
29
|
-
temperature: number;
|
|
30
|
-
topP: number;
|
|
31
|
-
};
|
|
32
|
-
generation: {
|
|
33
|
-
temperature: number;
|
|
34
|
-
topP: number;
|
|
35
|
-
};
|
|
36
|
-
creative: {
|
|
37
|
-
temperature: number;
|
|
38
|
-
topP: number;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,eAAO,MAAM,MAAM,EAAE,MA6BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAgB3B,CAAC"}
|
package/dist/config.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration for Houtini LM MCP Server v1.0
|
|
3
|
-
* Modern plugin architecture - prompts are handled by individual plugins
|
|
4
|
-
*/
|
|
5
|
-
export const config = {
|
|
6
|
-
lmStudioUrl: process.env.LM_STUDIO_URL || 'ws://localhost:1234',
|
|
7
|
-
modelName: process.env.LM_STUDIO_MODEL || 'auto',
|
|
8
|
-
temperature: 0.1,
|
|
9
|
-
// maxTokens removed - now calculated dynamically by TokenCalculator
|
|
10
|
-
topP: 0.95,
|
|
11
|
-
timeout: 300000, // Increased to 5 minutes for complex analysis and large projects
|
|
12
|
-
maxFileSize: 200 * 1024 * 1024, // 200MB limit
|
|
13
|
-
supportedFileTypes: [
|
|
14
|
-
'.csv', '.json', '.txt', '.js', '.ts', '.py', '.md', '.log',
|
|
15
|
-
'.jsx', '.tsx', '.java', '.c', '.cpp', '.rs', '.go', '.php',
|
|
16
|
-
'.rb', '.swift', '.html', '.css', '.scss', '.less', '.xml',
|
|
17
|
-
'.yml', '.yaml', '.toml', '.ini', '.conf', '.sh', '.bat'
|
|
18
|
-
],
|
|
19
|
-
// Security configuration
|
|
20
|
-
security: {
|
|
21
|
-
enableSanitisation: true,
|
|
22
|
-
enableInjectionDetection: true,
|
|
23
|
-
enableOutputEncoding: false, // FIXED: Prevents double JSON escaping
|
|
24
|
-
injectionThreshold: 0.5, // 0-1 scale for detection sensitivity
|
|
25
|
-
allowedDirectories: process.env.LLM_MCP_ALLOWED_DIRS?.split(',') || ['C:\\MCP', 'C:\\DEV'],
|
|
26
|
-
maxInputSize: {
|
|
27
|
-
'file-path': 1000,
|
|
28
|
-
'code': 100000,
|
|
29
|
-
'general': 50000,
|
|
30
|
-
'prompt': 20000
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Default LM Studio configuration
|
|
36
|
-
*/
|
|
37
|
-
export const lmStudioConfig = {
|
|
38
|
-
baseUrl: config.lmStudioUrl,
|
|
39
|
-
timeout: config.timeout
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* File processing limits
|
|
43
|
-
*/
|
|
44
|
-
export const fileProcessingLimits = {
|
|
45
|
-
maxFileSize: config.maxFileSize,
|
|
46
|
-
supportedTypes: config.supportedFileTypes,
|
|
47
|
-
chunkSize: 50 * 1024 * 1024, // 50MB chunks for large files
|
|
48
|
-
parallelProcessingThreshold: 10 * 1024 * 1024 // 10MB threshold for parallel processing
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Model parameters for different operation types
|
|
52
|
-
* maxTokens now calculated dynamically by TokenCalculator based on context window
|
|
53
|
-
*/
|
|
54
|
-
export const modelParameters = {
|
|
55
|
-
analysis: {
|
|
56
|
-
temperature: 0.1,
|
|
57
|
-
topP: 0.95
|
|
58
|
-
// maxTokens removed - calculated dynamically
|
|
59
|
-
},
|
|
60
|
-
generation: {
|
|
61
|
-
temperature: 0.3,
|
|
62
|
-
topP: 0.9
|
|
63
|
-
// maxTokens removed - calculated dynamically
|
|
64
|
-
},
|
|
65
|
-
creative: {
|
|
66
|
-
temperature: 0.7,
|
|
67
|
-
topP: 0.9
|
|
68
|
-
// maxTokens removed - calculated dynamically
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,MAAM,GAAW;IAC5B,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,qBAAqB;IAC/D,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,MAAM;IAChD,WAAW,EAAE,GAAG;IAChB,oEAAoE;IACpE,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,MAAM,EAAE,iEAAiE;IAClF,WAAW,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,EAAG,cAAc;IAC/C,kBAAkB,EAAE;QAClB,MAAM,EAAE,OAAO,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AAQ,EAAE;QACR,WAAW,EAAE,GAAG;QAChB,IAAI,EAAE,IAAI;QACV,6CAA6C;KAC9C;IACD,UAAU,EAAE;QACV,WAAW,EAAE,GAAG;QAChB,IAAI,EAAE,GAAG;QACT,6CAA6C;KAC9C;IACD,QAAQ,EAAE;QACR,WAAW,EAAE,GAAG;QAChB,IAAI,EAAE,GAAG;QACT,6CAA6C;KAC9C;CACF,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 3-Stage Prompt Manager
|
|
3
|
-
* Handles the breakdown of prompts into managed stages for optimal context usage
|
|
4
|
-
*/
|
|
5
|
-
import { PromptStages, ChunkedConversation } from '../types/prompt-stages.js';
|
|
6
|
-
export declare class ThreeStagePromptManager {
|
|
7
|
-
constructor();
|
|
8
|
-
/**
|
|
9
|
-
* Split data payload into chunks of specified size
|
|
10
|
-
* Now receives chunk size from TokenCalculator
|
|
11
|
-
*/
|
|
12
|
-
chunkDataPayload(dataPayload: string, maxChunkSize: number): string[];
|
|
13
|
-
/**
|
|
14
|
-
* Split a large section that doesn't fit in one chunk
|
|
15
|
-
*/
|
|
16
|
-
private splitLargeSection;
|
|
17
|
-
/**
|
|
18
|
-
* Create a chunked conversation from prompt stages
|
|
19
|
-
* Now receives pre-calculated chunks from TokenCalculator
|
|
20
|
-
*/
|
|
21
|
-
createChunkedConversation(stages: PromptStages, dataChunks: string[]): ChunkedConversation;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=ThreeStagePromptManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThreeStagePromptManager.d.ts","sourceRoot":"","sources":["../../src/core/ThreeStagePromptManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE9E,qBAAa,uBAAuB;;IAKlC;;;OAGG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE;IAmDrE;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;;OAGG;IACH,yBAAyB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,mBAAmB;CA8B3F"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 3-Stage Prompt Manager
|
|
3
|
-
* Handles the breakdown of prompts into managed stages for optimal context usage
|
|
4
|
-
*/
|
|
5
|
-
export class ThreeStagePromptManager {
|
|
6
|
-
constructor() {
|
|
7
|
-
// No context-related state needed - moved to TokenCalculator
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Split data payload into chunks of specified size
|
|
11
|
-
* Now receives chunk size from TokenCalculator
|
|
12
|
-
*/
|
|
13
|
-
chunkDataPayload(dataPayload, maxChunkSize) {
|
|
14
|
-
// Convert tokens to chars for character-based chunking
|
|
15
|
-
const maxCharsPerChunk = maxChunkSize * 4;
|
|
16
|
-
if (dataPayload.length <= maxCharsPerChunk) {
|
|
17
|
-
return [dataPayload];
|
|
18
|
-
}
|
|
19
|
-
const chunks = [];
|
|
20
|
-
// Try to break at natural boundaries (sections)
|
|
21
|
-
const sections = dataPayload.split('\n' + '='.repeat(80) + '\n');
|
|
22
|
-
if (sections.length > 1) {
|
|
23
|
-
// Break by file sections if available
|
|
24
|
-
let currentChunk = '';
|
|
25
|
-
for (const section of sections) {
|
|
26
|
-
const sectionWithSeparator = section + '\n' + '='.repeat(80) + '\n';
|
|
27
|
-
const combinedLength = currentChunk.length + sectionWithSeparator.length;
|
|
28
|
-
if (combinedLength <= maxCharsPerChunk && currentChunk.length > 0) {
|
|
29
|
-
currentChunk += sectionWithSeparator;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
if (currentChunk.length > 0) {
|
|
33
|
-
chunks.push(currentChunk.trim());
|
|
34
|
-
currentChunk = '';
|
|
35
|
-
}
|
|
36
|
-
// If single section is too large, split it
|
|
37
|
-
if (section.length > maxCharsPerChunk) {
|
|
38
|
-
const subChunks = this.splitLargeSection(section, maxCharsPerChunk);
|
|
39
|
-
chunks.push(...subChunks);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
currentChunk = sectionWithSeparator;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (currentChunk.length > 0) {
|
|
47
|
-
chunks.push(currentChunk.trim());
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
// Simple character-based splitting as fallback
|
|
52
|
-
for (let i = 0; i < dataPayload.length; i += maxCharsPerChunk) {
|
|
53
|
-
chunks.push(dataPayload.slice(i, i + maxCharsPerChunk));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return chunks.filter(chunk => chunk.trim().length > 0);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Split a large section that doesn't fit in one chunk
|
|
60
|
-
*/
|
|
61
|
-
splitLargeSection(section, maxChars) {
|
|
62
|
-
const chunks = [];
|
|
63
|
-
// Try to split by lines first
|
|
64
|
-
const lines = section.split('\n');
|
|
65
|
-
let currentChunk = '';
|
|
66
|
-
for (const line of lines) {
|
|
67
|
-
if (currentChunk.length + line.length + 1 <= maxChars) {
|
|
68
|
-
currentChunk += (currentChunk ? '\n' : '') + line;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
if (currentChunk) {
|
|
72
|
-
chunks.push(currentChunk);
|
|
73
|
-
currentChunk = line;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
// Line itself is too long, force split
|
|
77
|
-
chunks.push(line.slice(0, maxChars));
|
|
78
|
-
currentChunk = line.slice(maxChars);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (currentChunk) {
|
|
83
|
-
chunks.push(currentChunk);
|
|
84
|
-
}
|
|
85
|
-
return chunks;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Create a chunked conversation from prompt stages
|
|
89
|
-
* Now receives pre-calculated chunks from TokenCalculator
|
|
90
|
-
*/
|
|
91
|
-
createChunkedConversation(stages, dataChunks) {
|
|
92
|
-
// System message (Stage 1)
|
|
93
|
-
const systemMessage = {
|
|
94
|
-
role: 'system',
|
|
95
|
-
content: stages.systemAndContext
|
|
96
|
-
};
|
|
97
|
-
// Data messages (Stage 2 - pre-chunked)
|
|
98
|
-
const dataMessages = dataChunks.map((chunk, index) => ({
|
|
99
|
-
role: 'user',
|
|
100
|
-
content: dataChunks.length > 1
|
|
101
|
-
? `Data chunk ${index + 1}/${dataChunks.length}:\n\n${chunk}`
|
|
102
|
-
: `Data to analyze:\n\n${chunk}`
|
|
103
|
-
}));
|
|
104
|
-
// Analysis message (Stage 3)
|
|
105
|
-
const analysisMessage = {
|
|
106
|
-
role: 'user',
|
|
107
|
-
content: dataChunks.length > 1
|
|
108
|
-
? `${stages.outputInstructions}\n\nAnalyze all ${dataChunks.length} data chunks provided above.`
|
|
109
|
-
: stages.outputInstructions
|
|
110
|
-
};
|
|
111
|
-
return {
|
|
112
|
-
systemMessage,
|
|
113
|
-
dataMessages,
|
|
114
|
-
analysisMessage
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=ThreeStagePromptManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThreeStagePromptManager.js","sourceRoot":"","sources":["../../src/core/ThreeStagePromptManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,OAAO,uBAAuB;IAClC;QACE,6DAA6D;IAC/D,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,WAAmB,EAAE,YAAoB;QACxD,uDAAuD;QACvD,MAAM,gBAAgB,GAAG,YAAY,GAAG,CAAC,CAAC;QAE1C,IAAI,WAAW,CAAC,MAAM,IAAI,gBAAgB,EAAE,CAAC;YAC3C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CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,yBAAyB,CAAC,MAAoB,EAAE,UAAoB;QAClE,2BAA2B;QAC3B,MAAM,aAAa,GAAG;YACpB,IAAI,EAAE,QAAiB;YACvB,OAAO,EAAE,MAAM,CAAC,gBAAgB;SACjC,CAAC;QAEF,wCAAwC;QACxC,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACrD,IAAI,EAAE,MAAe;YACrB,OAAO,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC;gBAC5B,CAAC,CAAC,cAAc,KAAK,GAAG,CAAC,IAAI,UAAU,CAAC,MAAM,QAAQ,KAAK,EAAE;gBAC7D,CAAC,CAAC,uBAAuB,KAAK,EAAE;SACnC,CAAC,CAAC,CAAC;QAEJ,6BAA6B;QAC7B,MAAM,eAAe,GAAG;YACtB,IAAI,EAAE,MAAe;YACrB,OAAO,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC;gBAC5B,CAAC,CAAC,GAAG,MAAM,CAAC,kBAAkB,mBAAmB,UAAU,CAAC,MAAM,8BAA8B;gBAChG,CAAC,CAAC,MAAM,CAAC,kBAAkB;SAC9B,CAAC;QAEF,OAAO;YACL,aAAa;YACb,YAAY;YACZ,eAAe;SAChB,CAAC;IACJ,CAAC;CAEF"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Plugin Class - Modern v4.2 Architecture
|
|
3
|
-
* All plugins extend from this base class with modern patterns
|
|
4
|
-
*/
|
|
5
|
-
import { IPromptPlugin } from '../prompts/shared/types.js';
|
|
6
|
-
import { PromptStages } from '../types/prompt-stages.js';
|
|
7
|
-
export declare abstract class BasePlugin implements IPromptPlugin {
|
|
8
|
-
abstract name: string;
|
|
9
|
-
abstract category: 'analyze' | 'generate' | 'multifile' | 'custom' | 'system';
|
|
10
|
-
abstract description: string;
|
|
11
|
-
abstract parameters: {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Execute the plugin with given parameters
|
|
16
|
-
* MODERN v4.2: Must use withSecurity wrapper
|
|
17
|
-
*/
|
|
18
|
-
abstract execute(params: any, llmClient: any): Promise<any>;
|
|
19
|
-
/**
|
|
20
|
-
* Get the 3-stage prompt structure for context management
|
|
21
|
-
* MODERN v4.2: Required method for all plugins
|
|
22
|
-
*/
|
|
23
|
-
abstract getPromptStages(params: any): PromptStages;
|
|
24
|
-
/**
|
|
25
|
-
* Validate parameters before execution
|
|
26
|
-
* Override this method for custom validation
|
|
27
|
-
*/
|
|
28
|
-
validateParams(params: any): void;
|
|
29
|
-
/**
|
|
30
|
-
* Apply default values to parameters
|
|
31
|
-
*/
|
|
32
|
-
applyDefaults(params: any): any;
|
|
33
|
-
/**
|
|
34
|
-
* Get workflow context based on plugin category
|
|
35
|
-
*/
|
|
36
|
-
getWorkflowContext(): string;
|
|
37
|
-
/**
|
|
38
|
-
* Get usage tip based on plugin category
|
|
39
|
-
*/
|
|
40
|
-
getUsageTip(): string;
|
|
41
|
-
/**
|
|
42
|
-
* Get tool definition for MCP registration
|
|
43
|
-
*/
|
|
44
|
-
getToolDefinition(): any;
|
|
45
|
-
/**
|
|
46
|
-
* Convert parameter definitions to JSON schema
|
|
47
|
-
*/
|
|
48
|
-
private convertParametersToSchema;
|
|
49
|
-
/**
|
|
50
|
-
* Get list of required parameter names
|
|
51
|
-
*/
|
|
52
|
-
private getRequiredParameters;
|
|
53
|
-
}
|
|
54
|
-
export default BasePlugin;
|
|
55
|
-
//# sourceMappingURL=base-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/base-plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAuB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,8BAAsB,UAAW,YAAW,aAAa;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC9E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAE3D;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,YAAY;IAInD;;;OAGG;IACH,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI;IA4BjC;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG;IAY/B;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAY5B;;OAEG;IACH,WAAW,IAAI,MAAM;IAYrB;;OAEG;IACH,iBAAiB,IAAI,GAAG;IAgBxB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAqBjC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAK9B;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Plugin Class - Modern v4.2 Architecture
|
|
3
|
-
* All plugins extend from this base class with modern patterns
|
|
4
|
-
*/
|
|
5
|
-
export class BasePlugin {
|
|
6
|
-
/**
|
|
7
|
-
* Validate parameters before execution
|
|
8
|
-
* Override this method for custom validation
|
|
9
|
-
*/
|
|
10
|
-
validateParams(params) {
|
|
11
|
-
// Check required parameters
|
|
12
|
-
for (const [key, definition] of Object.entries(this.parameters)) {
|
|
13
|
-
if (definition.required && !(key in params)) {
|
|
14
|
-
throw new Error(`Missing required parameter: ${key}`);
|
|
15
|
-
}
|
|
16
|
-
// Type validation
|
|
17
|
-
if (key in params && definition.type) {
|
|
18
|
-
const actualType = typeof params[key];
|
|
19
|
-
const expectedType = definition.type;
|
|
20
|
-
if (expectedType === 'array' && !Array.isArray(params[key])) {
|
|
21
|
-
throw new Error(`Parameter ${key} must be an array`);
|
|
22
|
-
}
|
|
23
|
-
else if (expectedType !== 'array' && actualType !== expectedType) {
|
|
24
|
-
throw new Error(`Parameter ${key} must be of type ${expectedType}`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
// Enum validation
|
|
28
|
-
if (key in params && definition.enum) {
|
|
29
|
-
if (!definition.enum.includes(params[key])) {
|
|
30
|
-
throw new Error(`Parameter ${key} must be one of: ${definition.enum.join(', ')}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Apply default values to parameters
|
|
37
|
-
*/
|
|
38
|
-
applyDefaults(params) {
|
|
39
|
-
const result = { ...params };
|
|
40
|
-
for (const [key, definition] of Object.entries(this.parameters)) {
|
|
41
|
-
if (!(key in result) && 'default' in definition) {
|
|
42
|
-
result[key] = definition.default;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get workflow context based on plugin category
|
|
49
|
-
*/
|
|
50
|
-
getWorkflowContext() {
|
|
51
|
-
const contexts = {
|
|
52
|
-
'analyze': 'Perfect for understanding complex code, identifying issues, and technical debt assessment',
|
|
53
|
-
'generate': 'Ideal for creating production-ready code, tests, and documentation',
|
|
54
|
-
'fun': 'Build games, art, and interactive experiences for learning and portfolios',
|
|
55
|
-
'system': 'System diagnostics and function discovery',
|
|
56
|
-
'custom': 'Flexible analysis and generation for any development task'
|
|
57
|
-
};
|
|
58
|
-
return contexts[this.category] || 'Specialized development assistance';
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get usage tip based on plugin category
|
|
62
|
-
*/
|
|
63
|
-
getUsageTip() {
|
|
64
|
-
const tips = {
|
|
65
|
-
'analyze': 'Use Desktop Commander to read files, then pass content here for analysis',
|
|
66
|
-
'generate': 'Generate unlimited iterations locally, then review with Claude',
|
|
67
|
-
'fun': 'Perfect for learning advanced techniques through practical projects',
|
|
68
|
-
'system': 'Start with health_check, use list_functions to explore capabilities',
|
|
69
|
-
'custom': 'Provide clear instructions for any analysis or generation task'
|
|
70
|
-
};
|
|
71
|
-
return tips[this.category] || 'Combine with other Houtini LM functions for complete workflows';
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Get tool definition for MCP registration
|
|
75
|
-
*/
|
|
76
|
-
getToolDefinition() {
|
|
77
|
-
return {
|
|
78
|
-
name: this.name,
|
|
79
|
-
description: `${this.description}
|
|
80
|
-
|
|
81
|
-
WORKFLOW: ${this.getWorkflowContext()}
|
|
82
|
-
TIP: ${this.getUsageTip()}
|
|
83
|
-
SAVES: Claude context for strategic decisions`,
|
|
84
|
-
inputSchema: {
|
|
85
|
-
type: 'object',
|
|
86
|
-
properties: this.convertParametersToSchema(),
|
|
87
|
-
required: this.getRequiredParameters()
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Convert parameter definitions to JSON schema
|
|
93
|
-
*/
|
|
94
|
-
convertParametersToSchema() {
|
|
95
|
-
const schema = {};
|
|
96
|
-
for (const [key, definition] of Object.entries(this.parameters)) {
|
|
97
|
-
schema[key] = {
|
|
98
|
-
type: definition.type,
|
|
99
|
-
description: definition.description
|
|
100
|
-
};
|
|
101
|
-
if (definition.enum) {
|
|
102
|
-
schema[key].enum = definition.enum;
|
|
103
|
-
}
|
|
104
|
-
if (definition.default !== undefined) {
|
|
105
|
-
schema[key].default = definition.default;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return schema;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Get list of required parameter names
|
|
112
|
-
*/
|
|
113
|
-
getRequiredParameters() {
|
|
114
|
-
return Object.entries(this.parameters)
|
|
115
|
-
.filter(([_, def]) => def.required)
|
|
116
|
-
.map(([key, _]) => key);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
export default BasePlugin;
|
|
120
|
-
//# sourceMappingURL=base-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-plugin.js","sourceRoot":"","sources":["../../src/plugins/base-plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,OAAgB,UAAU;IAoB9B;;;OAGG;IACH,cAAc,CAAC,MAAW;QACxB,4BAA4B;QAC5B,KAAK,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAChE,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;gBAC5C,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;YACxD,CAAC;YAED,kBAAkB;YAClB,IAAI,GAAG,IAAI,MAAM,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;gBACrC,MAAM,UAAU,GAAG,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBACtC,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC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C,OAAO,KAAK,SAAS,EAAE,CAAC;gBACrC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACK,qBAAqB;QAC3B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;aACnC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;aAClC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;CACF;AAED,eAAe,UAAU,CAAC"}
|
package/dist/plugins/index.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Loader and Registry
|
|
3
|
-
* Dynamically loads and manages all prompt plugins
|
|
4
|
-
* Modern v4.2 architecture - plugins handle their own context management
|
|
5
|
-
*/
|
|
6
|
-
import { IPromptPlugin } from './types.js';
|
|
7
|
-
export declare class PluginLoader {
|
|
8
|
-
private plugins;
|
|
9
|
-
private categories;
|
|
10
|
-
constructor();
|
|
11
|
-
/**
|
|
12
|
-
* Load all plugins from the prompts directory
|
|
13
|
-
*/
|
|
14
|
-
loadPlugins(promptsDir: string): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Load a single plugin file
|
|
17
|
-
*/
|
|
18
|
-
private loadPlugin;
|
|
19
|
-
/**
|
|
20
|
-
* Load system plugins (cache management, health check)
|
|
21
|
-
*/
|
|
22
|
-
private loadSystemPlugins;
|
|
23
|
-
/**
|
|
24
|
-
* Register a plugin
|
|
25
|
-
*/
|
|
26
|
-
registerPlugin(plugin: IPromptPlugin): void;
|
|
27
|
-
/**
|
|
28
|
-
* Get a plugin by name
|
|
29
|
-
*/
|
|
30
|
-
getPlugin(name: string): IPromptPlugin | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Get all plugins
|
|
33
|
-
*/
|
|
34
|
-
getPlugins(): IPromptPlugin[];
|
|
35
|
-
/**
|
|
36
|
-
* Get plugins by category
|
|
37
|
-
*/
|
|
38
|
-
getPluginsByCategory(category: 'analyze' | 'generate' | 'system'): IPromptPlugin[];
|
|
39
|
-
/**
|
|
40
|
-
* Get plugin names
|
|
41
|
-
*/
|
|
42
|
-
getPluginNames(): string[];
|
|
43
|
-
/**
|
|
44
|
-
* Execute a plugin by name
|
|
45
|
-
* Modern v4.2: Each plugin handles its own context management with ThreeStagePromptManager
|
|
46
|
-
*/
|
|
47
|
-
executePlugin(name: string, params: any, llmClient: any): Promise<any>;
|
|
48
|
-
}
|
|
49
|
-
export declare class PluginRegistry {
|
|
50
|
-
private static instance;
|
|
51
|
-
static getInstance(): PluginLoader;
|
|
52
|
-
}
|
|
53
|
-
declare const _default: {
|
|
54
|
-
PluginLoader: typeof PluginLoader;
|
|
55
|
-
PluginRegistry: typeof PluginRegistry;
|
|
56
|
-
};
|
|
57
|
-
export default _default;
|
|
58
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAM3C,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAyC;IACxD,OAAO,CAAC,UAAU,CAA2C;;IAW7D;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBpD;;OAEG;YACW,UAAU;IA0BxB;;OAEG;YACW,iBAAiB;IAoB/B;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAe3C;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIlD;;OAEG;IACH,UAAU,IAAI,aAAa,EAAE;IAI7B;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,EAAE;IAIlF;;OAEG;IACH,cAAc,IAAI,MAAM,EAAE;IAI1B;;;OAGG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAiB7E;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IAEtC,MAAM,CAAC,WAAW,IAAI,YAAY;CAMnC;;;;;AAED,wBAGE"}
|