maskweaver 0.9.3 → 0.9.5
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/README.ko.md +279 -325
- package/README.md +109 -113
- package/assets/commands/meta/commands.json +34 -34
- package/assets/commands/weave-agents.md +12 -52
- package/assets/commands/weave-approve.md +12 -51
- package/assets/commands/weave-archive.md +21 -0
- package/assets/commands/weave-build.md +20 -89
- package/assets/commands/weave-craft.md +22 -43
- package/assets/commands/weave-help.md +37 -106
- package/assets/commands/weave-init.md +26 -108
- package/assets/commands/weave-interview.md +13 -111
- package/assets/commands/weave-map.md +13 -99
- package/assets/commands/weave-prepare.md +23 -69
- package/assets/commands/weave-refine-plan.md +26 -59
- package/assets/commands/weave-repair.md +22 -70
- package/assets/commands/weave-status.md +22 -155
- package/assets/commands/weave-troubleshoot.md +11 -47
- package/assets/commands/weave-verify.md +23 -44
- package/assets/commands/weave-worktree.md +27 -69
- package/dist/cli/doctor.js +5 -21
- package/dist/cli/install.d.ts +0 -8
- package/dist/cli/install.js +0 -39
- package/dist/context/config.d.ts +0 -22
- package/dist/context/config.js +0 -28
- package/dist/context/feature.d.ts +0 -39
- package/dist/context/feature.js +0 -77
- package/dist/context/files.d.ts +0 -13
- package/dist/context/files.js +1 -24
- package/dist/context/index.d.ts +0 -7
- package/dist/context/index.js +0 -12
- package/dist/context/project.d.ts +0 -21
- package/dist/context/project.js +0 -30
- package/dist/context/types.d.ts +0 -48
- package/dist/context/types.js +0 -12
- package/dist/context/utils.d.ts +0 -18
- package/dist/context/utils.js +0 -27
- package/dist/core/engine/promptBuilder.d.ts +0 -17
- package/dist/core/engine/promptBuilder.js +0 -28
- package/dist/core/index.d.ts +0 -6
- package/dist/core/index.js +0 -9
- package/dist/core/loader/MaskLoader.d.ts +0 -23
- package/dist/core/loader/MaskLoader.js +0 -29
- package/dist/core/schema/types.d.ts +0 -47
- package/dist/core/schema/types.js +0 -6
- package/dist/core/schema/validator.d.ts +0 -14
- package/dist/core/schema/validator.js +0 -18
- package/dist/i18n/index.d.ts +0 -18
- package/dist/i18n/index.js +4 -23
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -8
- package/dist/lib.d.ts +0 -5
- package/dist/lib.js +0 -12
- package/dist/memory/chunking.d.ts +0 -22
- package/dist/memory/chunking.js +2 -37
- package/dist/memory/core.d.ts +0 -29
- package/dist/memory/core.js +1 -52
- package/dist/memory/index.d.ts +0 -5
- package/dist/memory/index.js +0 -10
- package/dist/memory/indexer.d.ts +0 -21
- package/dist/memory/indexer.js +0 -44
- package/dist/memory/providers/examples.d.ts +0 -5
- package/dist/memory/providers/examples.js +4 -64
- package/dist/memory/providers/factory.d.ts +0 -44
- package/dist/memory/providers/factory.js +0 -46
- package/dist/memory/providers/index.d.ts +0 -26
- package/dist/memory/providers/index.js +0 -28
- package/dist/memory/providers/ollama.d.ts +0 -6
- package/dist/memory/providers/ollama.js +1 -8
- package/dist/memory/providers/openai.d.ts +0 -6
- package/dist/memory/providers/openai.js +1 -8
- package/dist/memory/providers/openrouter.d.ts +0 -6
- package/dist/memory/providers/openrouter.js +0 -8
- package/dist/memory/providers/text-only.d.ts +0 -13
- package/dist/memory/providers/text-only.js +0 -17
- package/dist/memory/providers/types.d.ts +0 -39
- package/dist/memory/providers/types.js +0 -7
- package/dist/memory/providers/voyage.d.ts +0 -22
- package/dist/memory/providers/voyage.js +1 -24
- package/dist/memory/search/hybrid.d.ts +0 -12
- package/dist/memory/search/hybrid.js +1 -22
- package/dist/memory/store/sqlite.d.ts +0 -72
- package/dist/memory/store/sqlite.js +4 -127
- package/dist/plugin/config/index.d.ts +0 -112
- package/dist/plugin/config/index.js +0 -115
- package/dist/plugin/index.d.ts +0 -13
- package/dist/plugin/index.js +1 -124
- package/dist/plugin/tools/command-registry.d.ts +0 -6
- package/dist/plugin/tools/command-registry.js +0 -14
- package/dist/plugin/tools/context.d.ts +0 -12
- package/dist/plugin/tools/context.js +0 -58
- package/dist/plugin/tools/maskSave.d.ts +0 -3
- package/dist/plugin/tools/maskSave.js +0 -3
- package/dist/plugin/tools/memoryGet.d.ts +0 -3
- package/dist/plugin/tools/memoryGet.js +0 -3
- package/dist/plugin/tools/memoryIndexer.d.ts +0 -3
- package/dist/plugin/tools/memoryIndexer.js +0 -10
- package/dist/plugin/tools/memorySearch.d.ts +0 -31
- package/dist/plugin/tools/memorySearch.js +0 -79
- package/dist/plugin/tools/memoryWrite.d.ts +0 -8
- package/dist/plugin/tools/memoryWrite.js +0 -32
- package/dist/plugin/tools/retrospect.d.ts +0 -3
- package/dist/plugin/tools/retrospect.js +0 -3
- package/dist/plugin/tools/slashcommand.d.ts +0 -11
- package/dist/plugin/tools/slashcommand.js +0 -38
- package/dist/plugin/tools/squad.d.ts +0 -12
- package/dist/plugin/tools/squad.js +11 -83
- package/dist/plugin/tools/weave.d.ts +0 -6
- package/dist/plugin/tools/weave.js +0 -78
- package/dist/plugin/types.d.ts +0 -20
- package/dist/plugin/types.js +0 -7
- package/dist/retrospect/index.d.ts +0 -7
- package/dist/retrospect/index.js +0 -9
- package/dist/retrospect/mask-save.d.ts +0 -12
- package/dist/retrospect/mask-save.js +1 -80
- package/dist/retrospect/retrospect.d.ts +0 -18
- package/dist/retrospect/retrospect.js +0 -63
- package/dist/retrospect/strategies/base.d.ts +0 -15
- package/dist/retrospect/strategies/base.js +0 -7
- package/dist/retrospect/strategies/deep.d.ts +0 -12
- package/dist/retrospect/strategies/deep.js +0 -24
- package/dist/retrospect/strategies/index.d.ts +0 -12
- package/dist/retrospect/strategies/index.js +0 -12
- package/dist/retrospect/strategies/quick.d.ts +0 -12
- package/dist/retrospect/strategies/quick.js +0 -19
- package/dist/retrospect/strategies/standard.d.ts +0 -12
- package/dist/retrospect/strategies/standard.js +0 -15
- package/dist/retrospect/types.d.ts +0 -7
- package/dist/retrospect/types.js +0 -7
- package/dist/shared/config.d.ts +0 -105
- package/dist/shared/config.js +0 -33
- package/dist/shared/errors.d.ts +0 -18
- package/dist/shared/errors.js +0 -19
- package/dist/shared/generate-agents.d.ts +0 -69
- package/dist/shared/generate-agents.js +2 -86
- package/dist/shared/image.d.ts +0 -67
- package/dist/shared/image.js +6 -104
- package/dist/shared/index.d.ts +0 -5
- package/dist/shared/index.js +0 -7
- package/dist/shared/model-registry.d.ts +0 -72
- package/dist/shared/model-registry.js +5 -95
- package/dist/shared/types.d.ts +0 -15
- package/dist/shared/types.js +0 -3
- package/dist/shared-context/dag.d.ts +0 -105
- package/dist/shared-context/dag.js +3 -114
- package/dist/shared-context/index.d.ts +0 -5
- package/dist/shared-context/index.js +0 -15
- package/dist/shared-context/logger.d.ts +0 -37
- package/dist/shared-context/logger.js +0 -41
- package/dist/shared-context/parallel-executor.d.ts +0 -54
- package/dist/shared-context/parallel-executor.js +4 -56
- package/dist/shared-context/session.d.ts +0 -56
- package/dist/shared-context/session.js +0 -47
- package/dist/shared-context/squad.d.ts +0 -68
- package/dist/shared-context/squad.js +0 -63
- package/dist/shared-context/storage.d.ts +0 -132
- package/dist/shared-context/storage.js +0 -116
- package/dist/shared-context/task.d.ts +0 -120
- package/dist/shared-context/task.js +0 -152
- package/dist/shared-context/test/dag.test.js +9 -14
- package/dist/shared-context/test/logger.test.d.ts +0 -8
- package/dist/shared-context/test/logger.test.js +0 -52
- package/dist/shared-context/test/session.test.d.ts +0 -7
- package/dist/shared-context/test/session.test.js +0 -63
- package/dist/shared-context/test/squad.test.d.ts +0 -10
- package/dist/shared-context/test/squad.test.js +2 -68
- package/dist/shared-context/test/storage.test.d.ts +0 -8
- package/dist/shared-context/test/storage.test.js +0 -68
- package/dist/shared-context/test/task.test.d.ts +0 -7
- package/dist/shared-context/test/task.test.js +0 -54
- package/dist/shared-context/test/watchdog.test.d.ts +0 -7
- package/dist/shared-context/test/watchdog.test.js +3 -58
- package/dist/shared-context/types.d.ts +0 -215
- package/dist/shared-context/types.js +0 -125
- package/dist/shared-context/watchdog.d.ts +0 -127
- package/dist/shared-context/watchdog.js +0 -148
- package/dist/shared-context/worktree.d.ts +0 -68
- package/dist/shared-context/worktree.js +2 -34
- package/dist/verify/budget.d.ts +0 -29
- package/dist/verify/budget.js +0 -34
- package/dist/verify/critical-files.d.ts +0 -17
- package/dist/verify/critical-files.js +0 -37
- package/dist/verify/escalation.d.ts +0 -20
- package/dist/verify/escalation.js +0 -22
- package/dist/verify/index.d.ts +0 -5
- package/dist/verify/index.js +0 -11
- package/dist/verify/prompts.d.ts +0 -20
- package/dist/verify/prompts.js +0 -20
- package/dist/verify/types.d.ts +0 -26
- package/dist/verify/types.js +1 -12
- package/dist/verify/verifier.d.ts +0 -29
- package/dist/verify/verifier.js +0 -54
- package/dist/version.d.ts +1 -16
- package/dist/version.js +1 -16
- package/dist/weave/bridge.d.ts +0 -35
- package/dist/weave/bridge.js +0 -51
- package/dist/weave/environment/detector.d.ts +0 -6
- package/dist/weave/environment/detector.js +4 -45
- package/dist/weave/environment/index.d.ts +0 -19
- package/dist/weave/environment/index.js +1 -39
- package/dist/weave/environment/issues.d.ts +0 -35
- package/dist/weave/environment/issues.js +0 -59
- package/dist/weave/git.d.ts +0 -8
- package/dist/weave/git.js +0 -8
- package/dist/weave/index.d.ts +0 -13
- package/dist/weave/index.js +2 -28
- package/dist/weave/knowledge/global.d.ts +0 -39
- package/dist/weave/knowledge/global.js +2 -78
- package/dist/weave/loop.js +0 -3
- package/dist/weave/orchestrator.d.ts +0 -69
- package/dist/weave/orchestrator.js +1 -101
- package/dist/weave/phase-manager.d.ts +0 -64
- package/dist/weave/phase-manager.js +0 -89
- package/dist/weave/security/secret-scan.d.ts +0 -14
- package/dist/weave/security/secret-scan.js +0 -19
- package/dist/weave/stages/build.js +0 -15
- package/dist/weave/stages/execute.d.ts +0 -42
- package/dist/weave/stages/execute.js +4 -86
- package/dist/weave/stages/handoff.d.ts +0 -7
- package/dist/weave/stages/handoff.js +0 -43
- package/dist/weave/stages/index.d.ts +0 -3
- package/dist/weave/stages/index.js +0 -3
- package/dist/weave/stages/intake.d.ts +0 -8
- package/dist/weave/stages/intake.js +5 -65
- package/dist/weave/stages/map.d.ts +0 -1
- package/dist/weave/stages/openspec.d.ts +0 -1
- package/dist/weave/stages/plan.d.ts +0 -11
- package/dist/weave/stages/plan.js +1 -53
- package/dist/weave/stages/refine.d.ts +0 -7
- package/dist/weave/stages/refine.js +0 -7
- package/dist/weave/stages/research.d.ts +0 -6
- package/dist/weave/stages/research.js +0 -6
- package/dist/weave/stages/spec.d.ts +0 -12
- package/dist/weave/stages/spec.js +0 -17
- package/dist/weave/types.d.ts +0 -20
- package/dist/weave/types.js +0 -5
- package/dist/weave/verification/commands.d.ts +0 -12
- package/dist/weave/verification/commands.js +0 -19
- package/dist/weave/verification/index.d.ts +0 -6
- package/dist/weave/verification/index.js +1 -19
- package/dist/weave/verification/playwright.d.ts +0 -47
- package/dist/weave/verification/playwright.js +1 -90
- package/dist/weave/worktree.d.ts +0 -16
- package/dist/weave/worktree.js +0 -23
- package/dist/weave/yaml-repair.d.ts +0 -39
- package/dist/weave/yaml-repair.js +13 -116
- package/package.json +1 -1
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prompt Builder
|
|
3
|
-
*
|
|
4
|
-
* Builds system prompts from mask definitions.
|
|
5
|
-
*/
|
|
6
1
|
const DEFAULT_OPTIONS = {
|
|
7
2
|
includeMetadata: false,
|
|
8
3
|
includeExamples: false,
|
|
9
4
|
};
|
|
10
|
-
/**
|
|
11
|
-
* Build a system prompt from a mask
|
|
12
|
-
*/
|
|
13
5
|
export function buildPrompt(mask, options = {}) {
|
|
14
6
|
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
15
7
|
const parts = [];
|
|
16
|
-
// Header (optional)
|
|
17
8
|
if (opts.includeMetadata) {
|
|
18
9
|
parts.push(`# ${mask.profile.name}`);
|
|
19
10
|
parts.push(`> ${mask.profile.tagline}`);
|
|
20
11
|
parts.push('');
|
|
21
12
|
}
|
|
22
|
-
// Main system prompt (always included)
|
|
23
13
|
parts.push(mask.behavior.systemPrompt.trim());
|
|
24
|
-
// Signature phrases (if available)
|
|
25
14
|
if (mask.behavior.signaturePhrases && mask.behavior.signaturePhrases.length > 0) {
|
|
26
15
|
parts.push('');
|
|
27
16
|
parts.push('SIGNATURE PHRASES YOU MAY USE:');
|
|
@@ -29,7 +18,6 @@ export function buildPrompt(mask, options = {}) {
|
|
|
29
18
|
parts.push(`- "${phrase}"`);
|
|
30
19
|
}
|
|
31
20
|
}
|
|
32
|
-
// Usage examples (optional)
|
|
33
21
|
if (opts.includeExamples && mask.usage.examples.length > 0) {
|
|
34
22
|
parts.push('');
|
|
35
23
|
parts.push('EXAMPLE SCENARIOS:');
|
|
@@ -38,7 +26,6 @@ export function buildPrompt(mask, options = {}) {
|
|
|
38
26
|
parts.push(` → ${example.expectedOutcome}`);
|
|
39
27
|
}
|
|
40
28
|
}
|
|
41
|
-
// Additional context (optional)
|
|
42
29
|
if (opts.additionalContext) {
|
|
43
30
|
parts.push('');
|
|
44
31
|
parts.push('ADDITIONAL CONTEXT:');
|
|
@@ -46,52 +33,38 @@ export function buildPrompt(mask, options = {}) {
|
|
|
46
33
|
}
|
|
47
34
|
return parts.join('\n');
|
|
48
35
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Build a minimal prompt (just the core system prompt)
|
|
51
|
-
*/
|
|
52
36
|
export function buildMinimalPrompt(mask) {
|
|
53
37
|
return mask.behavior.systemPrompt.trim();
|
|
54
38
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Build a rich prompt with all available information
|
|
57
|
-
*/
|
|
58
39
|
export function buildRichPrompt(mask) {
|
|
59
40
|
const parts = [];
|
|
60
|
-
// Identity header
|
|
61
41
|
parts.push(`You are ${mask.profile.name}.`);
|
|
62
42
|
parts.push(`${mask.profile.tagline}`);
|
|
63
43
|
parts.push('');
|
|
64
|
-
// Background
|
|
65
44
|
parts.push('BACKGROUND:');
|
|
66
45
|
parts.push(mask.profile.background.trim());
|
|
67
46
|
parts.push('');
|
|
68
|
-
// Expertise
|
|
69
47
|
parts.push('YOUR EXPERTISE:');
|
|
70
48
|
for (const exp of mask.profile.expertise) {
|
|
71
49
|
parts.push(`- ${exp}`);
|
|
72
50
|
}
|
|
73
51
|
parts.push('');
|
|
74
|
-
// Thinking style
|
|
75
52
|
parts.push('YOUR THINKING STYLE:');
|
|
76
53
|
parts.push(mask.profile.thinkingStyle.trim());
|
|
77
54
|
parts.push('');
|
|
78
|
-
// Main behavior instructions
|
|
79
55
|
parts.push('INSTRUCTIONS:');
|
|
80
56
|
parts.push(mask.behavior.systemPrompt.trim());
|
|
81
57
|
parts.push('');
|
|
82
|
-
// Communication style
|
|
83
58
|
const style = mask.behavior.communicationStyle;
|
|
84
59
|
parts.push('COMMUNICATION STYLE:');
|
|
85
60
|
parts.push(`- Tone: ${style.tone}`);
|
|
86
61
|
parts.push(`- Verbosity: ${style.verbosity}`);
|
|
87
62
|
parts.push(`- Technical depth: ${style.technicalDepth}`);
|
|
88
63
|
parts.push('');
|
|
89
|
-
// Strengths
|
|
90
64
|
parts.push('YOUR STRENGTHS:');
|
|
91
65
|
for (const strength of mask.profile.strengths) {
|
|
92
66
|
parts.push(`- ${strength}`);
|
|
93
67
|
}
|
|
94
|
-
// Limitations (if any)
|
|
95
68
|
if (mask.profile.limitations && mask.profile.limitations.length > 0) {
|
|
96
69
|
parts.push('');
|
|
97
70
|
parts.push('ACKNOWLEDGE YOUR LIMITATIONS:');
|
|
@@ -99,7 +72,6 @@ export function buildRichPrompt(mask) {
|
|
|
99
72
|
parts.push(`- ${limitation}`);
|
|
100
73
|
}
|
|
101
74
|
}
|
|
102
|
-
// Signature phrases
|
|
103
75
|
if (mask.behavior.signaturePhrases && mask.behavior.signaturePhrases.length > 0) {
|
|
104
76
|
parts.push('');
|
|
105
77
|
parts.push('PHRASES YOU MIGHT USE:');
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @maskweaver/core
|
|
3
|
-
*
|
|
4
|
-
* Core library for Maskweaver - AI expert persona system.
|
|
5
|
-
* 가면술사 핵심 라이브러리
|
|
6
|
-
*/
|
|
7
1
|
export type { Result } from '../shared/types.js';
|
|
8
2
|
export type { MaskSchema, MaskMetadata, MaskProfile, MaskBehavior, MaskUsage, MaskUsageExample, MaskConfig, MaskCatalog, MaskCatalogEntry, MaskCategory, LoadedMask, CommunicationTone, Verbosity, TechnicalDepth, } from './schema/types';
|
|
9
3
|
export { validateMask, validateMaskOrThrow, MaskSchemaValidator, type ValidationResult, } from './schema/validator';
|
package/dist/core/index.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @maskweaver/core
|
|
3
|
-
*
|
|
4
|
-
* Core library for Maskweaver - AI expert persona system.
|
|
5
|
-
* 가면술사 핵심 라이브러리
|
|
6
|
-
*/
|
|
7
|
-
// Validator
|
|
8
1
|
export { validateMask, validateMaskOrThrow, MaskSchemaValidator, } from './schema/validator';
|
|
9
|
-
// Loader
|
|
10
2
|
export { MaskLoader, } from './loader/MaskLoader';
|
|
11
|
-
// Prompt builder
|
|
12
3
|
export { promptBuilder, buildPrompt, buildMinimalPrompt, buildRichPrompt, } from './engine/promptBuilder';
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mask Loader
|
|
3
|
-
*
|
|
4
|
-
* Loads mask definitions from the file system.
|
|
5
|
-
*/
|
|
6
1
|
import type { MaskCatalog, LoadedMask, MaskCatalogEntry } from '../schema/types';
|
|
7
2
|
export interface MaskLoaderOptions {
|
|
8
3
|
masksDir: string;
|
|
@@ -12,35 +7,17 @@ export declare class MaskLoader {
|
|
|
12
7
|
private catalog;
|
|
13
8
|
private cache;
|
|
14
9
|
constructor(options: MaskLoaderOptions);
|
|
15
|
-
/**
|
|
16
|
-
* Load the mask catalog (index.json)
|
|
17
|
-
*/
|
|
18
10
|
loadCatalog(): Promise<MaskCatalog>;
|
|
19
|
-
/**
|
|
20
|
-
* Load all masks from the catalog
|
|
21
|
-
*/
|
|
22
11
|
loadAll(): Promise<LoadedMask[]>;
|
|
23
|
-
/**
|
|
24
|
-
* Load a single mask by ID
|
|
25
|
-
*/
|
|
26
12
|
load(maskId: string): Promise<LoadedMask | null>;
|
|
27
|
-
/**
|
|
28
|
-
* List all masks (metadata only)
|
|
29
|
-
*/
|
|
30
13
|
listAll(): Promise<Array<MaskCatalogEntry & {
|
|
31
14
|
category: string;
|
|
32
15
|
}>>;
|
|
33
|
-
/**
|
|
34
|
-
* List categories
|
|
35
|
-
*/
|
|
36
16
|
listCategories(): Promise<Array<{
|
|
37
17
|
id: string;
|
|
38
18
|
name: string;
|
|
39
19
|
description: string;
|
|
40
20
|
count: number;
|
|
41
21
|
}>>;
|
|
42
|
-
/**
|
|
43
|
-
* Clear the cache
|
|
44
|
-
*/
|
|
45
22
|
clearCache(): void;
|
|
46
23
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mask Loader
|
|
3
|
-
*
|
|
4
|
-
* Loads mask definitions from the file system.
|
|
5
|
-
*/
|
|
6
1
|
import { readFile } from 'fs/promises';
|
|
7
2
|
import { existsSync } from 'fs';
|
|
8
3
|
import { parse as parseYaml } from 'yaml';
|
|
@@ -14,9 +9,6 @@ export class MaskLoader {
|
|
|
14
9
|
constructor(options) {
|
|
15
10
|
this.masksDir = options.masksDir;
|
|
16
11
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Load the mask catalog (index.json)
|
|
19
|
-
*/
|
|
20
12
|
async loadCatalog() {
|
|
21
13
|
if (this.catalog) {
|
|
22
14
|
return this.catalog;
|
|
@@ -29,9 +21,6 @@ export class MaskLoader {
|
|
|
29
21
|
this.catalog = JSON.parse(content);
|
|
30
22
|
return this.catalog;
|
|
31
23
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Load all masks from the catalog
|
|
34
|
-
*/
|
|
35
24
|
async loadAll() {
|
|
36
25
|
const catalog = await this.loadCatalog();
|
|
37
26
|
const masks = [];
|
|
@@ -50,16 +39,11 @@ export class MaskLoader {
|
|
|
50
39
|
}
|
|
51
40
|
return masks;
|
|
52
41
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Load a single mask by ID
|
|
55
|
-
*/
|
|
56
42
|
async load(maskId) {
|
|
57
|
-
// Check cache
|
|
58
43
|
if (this.cache.has(maskId)) {
|
|
59
44
|
return this.cache.get(maskId);
|
|
60
45
|
}
|
|
61
46
|
const catalog = await this.loadCatalog();
|
|
62
|
-
// Find mask in catalog
|
|
63
47
|
let entry = null;
|
|
64
48
|
let categoryId = null;
|
|
65
49
|
for (const [catId, category] of Object.entries(catalog.categories)) {
|
|
@@ -73,7 +57,6 @@ export class MaskLoader {
|
|
|
73
57
|
if (!entry || !categoryId) {
|
|
74
58
|
return null;
|
|
75
59
|
}
|
|
76
|
-
// Load mask file
|
|
77
60
|
const filePath = `${this.masksDir}/${entry.file}`;
|
|
78
61
|
if (!existsSync(filePath)) {
|
|
79
62
|
throw new Error(`Mask file not found: ${filePath}`);
|
|
@@ -82,21 +65,15 @@ export class MaskLoader {
|
|
|
82
65
|
const parsed = filePath.endsWith('.yaml') || filePath.endsWith('.yml')
|
|
83
66
|
? parseYaml(content)
|
|
84
67
|
: JSON.parse(content);
|
|
85
|
-
// Validate
|
|
86
68
|
const validated = validateMaskOrThrow(parsed);
|
|
87
|
-
// Create loaded mask
|
|
88
69
|
const loadedMask = {
|
|
89
70
|
...validated,
|
|
90
71
|
category: categoryId,
|
|
91
72
|
filePath,
|
|
92
73
|
};
|
|
93
|
-
// Cache it
|
|
94
74
|
this.cache.set(maskId, loadedMask);
|
|
95
75
|
return loadedMask;
|
|
96
76
|
}
|
|
97
|
-
/**
|
|
98
|
-
* List all masks (metadata only)
|
|
99
|
-
*/
|
|
100
77
|
async listAll() {
|
|
101
78
|
const catalog = await this.loadCatalog();
|
|
102
79
|
const result = [];
|
|
@@ -110,9 +87,6 @@ export class MaskLoader {
|
|
|
110
87
|
}
|
|
111
88
|
return result;
|
|
112
89
|
}
|
|
113
|
-
/**
|
|
114
|
-
* List categories
|
|
115
|
-
*/
|
|
116
90
|
async listCategories() {
|
|
117
91
|
const catalog = await this.loadCatalog();
|
|
118
92
|
return Object.entries(catalog.categories).map(([id, cat]) => ({
|
|
@@ -122,9 +96,6 @@ export class MaskLoader {
|
|
|
122
96
|
count: cat.masks.length,
|
|
123
97
|
}));
|
|
124
98
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Clear the cache
|
|
127
|
-
*/
|
|
128
99
|
clearCache() {
|
|
129
100
|
this.cache.clear();
|
|
130
101
|
this.catalog = null;
|
|
@@ -1,62 +1,38 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mask Schema v1.0
|
|
3
|
-
*
|
|
4
|
-
* Defines the structure for AI expert personas.
|
|
5
|
-
* 가면술사 (Maskweaver) - Core Type Definitions
|
|
6
|
-
*/
|
|
7
1
|
export interface MaskMetadata {
|
|
8
|
-
/** Unique identifier (kebab-case) */
|
|
9
2
|
id: string;
|
|
10
|
-
/** Schema version for future compatibility */
|
|
11
3
|
version: '1.0';
|
|
12
|
-
/** Primary language of this mask definition */
|
|
13
4
|
language: 'en' | 'ko' | 'zh' | 'ja';
|
|
14
|
-
/** Creation/update timestamps (ISO 8601) */
|
|
15
5
|
created: string;
|
|
16
6
|
updated: string;
|
|
17
|
-
/** Contributors/authors */
|
|
18
7
|
authors?: string[];
|
|
19
|
-
/** Related mask IDs for cross-referencing */
|
|
20
8
|
relatedMasks?: string[];
|
|
21
|
-
/** Tags for categorization and search */
|
|
22
9
|
tags?: string[];
|
|
23
10
|
}
|
|
24
11
|
export interface MaskProfile {
|
|
25
|
-
/** Display name of the persona */
|
|
26
12
|
name: string;
|
|
27
|
-
/** One-line tagline */
|
|
28
13
|
tagline: string;
|
|
29
|
-
/** Detailed background (2-3 paragraphs) */
|
|
30
14
|
background: string;
|
|
31
|
-
/** Core expertise areas (3-5 items) */
|
|
32
15
|
expertise: string[];
|
|
33
|
-
/** Thinking style description */
|
|
34
16
|
thinkingStyle: string;
|
|
35
|
-
/** Key strengths (3-5 bullet points) */
|
|
36
17
|
strengths: string[];
|
|
37
|
-
/** Limitations/weaknesses (honesty is key) */
|
|
38
18
|
limitations?: string[];
|
|
39
19
|
}
|
|
40
20
|
export type CommunicationTone = 'direct' | 'friendly' | 'formal' | 'socratic' | 'enthusiastic';
|
|
41
21
|
export type Verbosity = 'concise' | 'moderate' | 'detailed';
|
|
42
22
|
export type TechnicalDepth = 'beginner' | 'intermediate' | 'expert';
|
|
43
23
|
export interface MaskBehavior {
|
|
44
|
-
/** System prompt injected when mask is applied */
|
|
45
24
|
systemPrompt: string;
|
|
46
|
-
/** Communication style guidelines */
|
|
47
25
|
communicationStyle: {
|
|
48
26
|
tone: CommunicationTone;
|
|
49
27
|
verbosity: Verbosity;
|
|
50
28
|
technicalDepth: TechnicalDepth;
|
|
51
29
|
};
|
|
52
|
-
/** Task approach patterns */
|
|
53
30
|
approachPatterns: {
|
|
54
31
|
problemSolving: string;
|
|
55
32
|
codeReview: string;
|
|
56
33
|
architecture?: string;
|
|
57
34
|
debugging?: string;
|
|
58
35
|
};
|
|
59
|
-
/** Example phrases this persona might use */
|
|
60
36
|
signaturePhrases?: string[];
|
|
61
37
|
}
|
|
62
38
|
export interface MaskUsageExample {
|
|
@@ -64,28 +40,17 @@ export interface MaskUsageExample {
|
|
|
64
40
|
expectedOutcome: string;
|
|
65
41
|
}
|
|
66
42
|
export interface MaskUsage {
|
|
67
|
-
/** When to use this mask */
|
|
68
43
|
suitableFor: string[];
|
|
69
|
-
/** When NOT to use this mask */
|
|
70
44
|
notSuitableFor?: string[];
|
|
71
|
-
/** Example use cases */
|
|
72
45
|
examples: MaskUsageExample[];
|
|
73
46
|
}
|
|
74
47
|
export interface MaskConfig {
|
|
75
|
-
/** Runtime configuration */
|
|
76
48
|
priority?: number;
|
|
77
|
-
/** Tool restrictions */
|
|
78
49
|
allowedTools?: string[];
|
|
79
50
|
disallowedTools?: string[];
|
|
80
|
-
/** Session settings */
|
|
81
51
|
maxTokens?: number;
|
|
82
52
|
temperature?: number;
|
|
83
53
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Complete Mask Definition
|
|
86
|
-
*
|
|
87
|
-
* This is the main schema for defining expert personas (masks).
|
|
88
|
-
*/
|
|
89
54
|
export interface MaskSchema {
|
|
90
55
|
metadata: MaskMetadata;
|
|
91
56
|
profile: MaskProfile;
|
|
@@ -93,9 +58,6 @@ export interface MaskSchema {
|
|
|
93
58
|
usage: MaskUsage;
|
|
94
59
|
config?: MaskConfig;
|
|
95
60
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Mask Catalog Entry (for index.json)
|
|
98
|
-
*/
|
|
99
61
|
export interface MaskCatalogEntry {
|
|
100
62
|
id: string;
|
|
101
63
|
name: string;
|
|
@@ -103,24 +65,15 @@ export interface MaskCatalogEntry {
|
|
|
103
65
|
tags: string[];
|
|
104
66
|
category?: string;
|
|
105
67
|
}
|
|
106
|
-
/**
|
|
107
|
-
* Mask Category (for index.json)
|
|
108
|
-
*/
|
|
109
68
|
export interface MaskCategory {
|
|
110
69
|
name: string;
|
|
111
70
|
description: string;
|
|
112
71
|
masks: MaskCatalogEntry[];
|
|
113
72
|
}
|
|
114
|
-
/**
|
|
115
|
-
* Mask Catalog (masks/index.json)
|
|
116
|
-
*/
|
|
117
73
|
export interface MaskCatalog {
|
|
118
74
|
version: string;
|
|
119
75
|
categories: Record<string, MaskCategory>;
|
|
120
76
|
}
|
|
121
|
-
/**
|
|
122
|
-
* Loaded Mask (with resolved category info)
|
|
123
|
-
*/
|
|
124
77
|
export interface LoadedMask extends MaskSchema {
|
|
125
78
|
category: string;
|
|
126
79
|
filePath: string;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mask Schema Validator
|
|
3
|
-
*
|
|
4
|
-
* Validates mask YAML/JSON against the schema using Zod.
|
|
5
|
-
*/
|
|
6
1
|
import { z } from 'zod';
|
|
7
2
|
import type { MaskSchema } from './types';
|
|
8
3
|
export declare const MaskSchemaValidator: z.ZodObject<{
|
|
@@ -75,9 +70,6 @@ export declare const MaskSchemaValidator: z.ZodObject<{
|
|
|
75
70
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
76
71
|
}, z.core.$strip>>;
|
|
77
72
|
}, z.core.$strip>;
|
|
78
|
-
/**
|
|
79
|
-
* Validation result
|
|
80
|
-
*/
|
|
81
73
|
export interface ValidationResult {
|
|
82
74
|
success: boolean;
|
|
83
75
|
data?: MaskSchema;
|
|
@@ -86,11 +78,5 @@ export interface ValidationResult {
|
|
|
86
78
|
message: string;
|
|
87
79
|
}>;
|
|
88
80
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Validate a mask object against the schema
|
|
91
|
-
*/
|
|
92
81
|
export declare function validateMask(mask: unknown): ValidationResult;
|
|
93
|
-
/**
|
|
94
|
-
* Validate and throw on error
|
|
95
|
-
*/
|
|
96
82
|
export declare function validateMaskOrThrow(mask: unknown): MaskSchema;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mask Schema Validator
|
|
3
|
-
*
|
|
4
|
-
* Validates mask YAML/JSON against the schema using Zod.
|
|
5
|
-
*/
|
|
6
1
|
import { z } from 'zod';
|
|
7
|
-
// Communication style enums
|
|
8
2
|
const CommunicationToneSchema = z.enum(['direct', 'friendly', 'formal', 'socratic', 'enthusiastic']);
|
|
9
3
|
const VerbositySchema = z.enum(['concise', 'moderate', 'detailed']);
|
|
10
4
|
const TechnicalDepthSchema = z.enum(['beginner', 'intermediate', 'expert']);
|
|
11
5
|
const LanguageSchema = z.enum(['en', 'ko', 'zh', 'ja']);
|
|
12
|
-
// Metadata schema
|
|
13
6
|
const MaskMetadataSchema = z.object({
|
|
14
7
|
id: z.string().regex(/^[a-z0-9-]+$/, 'ID must be kebab-case'),
|
|
15
8
|
version: z.literal('1.0'),
|
|
@@ -20,7 +13,6 @@ const MaskMetadataSchema = z.object({
|
|
|
20
13
|
relatedMasks: z.array(z.string()).optional(),
|
|
21
14
|
tags: z.array(z.string()).optional(),
|
|
22
15
|
});
|
|
23
|
-
// Profile schema
|
|
24
16
|
const MaskProfileSchema = z.object({
|
|
25
17
|
name: z.string().min(1, 'Name is required'),
|
|
26
18
|
tagline: z.string().min(1, 'Tagline is required'),
|
|
@@ -30,7 +22,6 @@ const MaskProfileSchema = z.object({
|
|
|
30
22
|
strengths: z.array(z.string()).min(1).max(10),
|
|
31
23
|
limitations: z.array(z.string()).optional(),
|
|
32
24
|
});
|
|
33
|
-
// Behavior schema
|
|
34
25
|
const MaskBehaviorSchema = z.object({
|
|
35
26
|
systemPrompt: z.string().min(100, 'System prompt should be detailed'),
|
|
36
27
|
communicationStyle: z.object({
|
|
@@ -46,7 +37,6 @@ const MaskBehaviorSchema = z.object({
|
|
|
46
37
|
}),
|
|
47
38
|
signaturePhrases: z.array(z.string()).optional(),
|
|
48
39
|
});
|
|
49
|
-
// Usage schema
|
|
50
40
|
const MaskUsageExampleSchema = z.object({
|
|
51
41
|
scenario: z.string(),
|
|
52
42
|
expectedOutcome: z.string(),
|
|
@@ -56,7 +46,6 @@ const MaskUsageSchema = z.object({
|
|
|
56
46
|
notSuitableFor: z.array(z.string()).optional(),
|
|
57
47
|
examples: z.array(MaskUsageExampleSchema).min(1),
|
|
58
48
|
});
|
|
59
|
-
// Config schema
|
|
60
49
|
const MaskConfigSchema = z.object({
|
|
61
50
|
priority: z.number().min(0).max(100).optional(),
|
|
62
51
|
allowedTools: z.array(z.string()).optional(),
|
|
@@ -64,7 +53,6 @@ const MaskConfigSchema = z.object({
|
|
|
64
53
|
maxTokens: z.number().positive().optional(),
|
|
65
54
|
temperature: z.number().min(0).max(2).optional(),
|
|
66
55
|
}).optional();
|
|
67
|
-
// Complete mask schema
|
|
68
56
|
export const MaskSchemaValidator = z.object({
|
|
69
57
|
metadata: MaskMetadataSchema,
|
|
70
58
|
profile: MaskProfileSchema,
|
|
@@ -72,9 +60,6 @@ export const MaskSchemaValidator = z.object({
|
|
|
72
60
|
usage: MaskUsageSchema,
|
|
73
61
|
config: MaskConfigSchema,
|
|
74
62
|
});
|
|
75
|
-
/**
|
|
76
|
-
* Validate a mask object against the schema
|
|
77
|
-
*/
|
|
78
63
|
export function validateMask(mask) {
|
|
79
64
|
const result = MaskSchemaValidator.safeParse(mask);
|
|
80
65
|
if (result.success) {
|
|
@@ -91,9 +76,6 @@ export function validateMask(mask) {
|
|
|
91
76
|
})),
|
|
92
77
|
};
|
|
93
78
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Validate and throw on error
|
|
96
|
-
*/
|
|
97
79
|
export function validateMaskOrThrow(mask) {
|
|
98
80
|
const result = validateMask(mask);
|
|
99
81
|
if (!result.success) {
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @maskweaver/i18n
|
|
3
|
-
*
|
|
4
|
-
* Internationalization infrastructure for Maskweaver.
|
|
5
|
-
* Phase 1: English only, but structure ready for expansion.
|
|
6
|
-
*/
|
|
7
1
|
import en from './locales/en.json';
|
|
8
2
|
export type Locale = 'en' | 'ko' | 'zh' | 'ja';
|
|
9
3
|
export type TranslationKey = keyof typeof en;
|
|
10
|
-
/**
|
|
11
|
-
* Set the current locale
|
|
12
|
-
*/
|
|
13
4
|
export declare function setLocale(locale: Locale): void;
|
|
14
|
-
/**
|
|
15
|
-
* Get the current locale
|
|
16
|
-
*/
|
|
17
5
|
export declare function getLocale(): Locale;
|
|
18
|
-
/**
|
|
19
|
-
* Translate a key
|
|
20
|
-
*/
|
|
21
6
|
export declare function t(key: string, params?: Record<string, string>): string;
|
|
22
|
-
/**
|
|
23
|
-
* Load translations for a locale
|
|
24
|
-
*/
|
|
25
7
|
export declare function loadLocale(locale: Locale): Promise<void>;
|
|
26
8
|
declare const _default: {
|
|
27
9
|
t: typeof t;
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,48 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @maskweaver/i18n
|
|
3
|
-
*
|
|
4
|
-
* Internationalization infrastructure for Maskweaver.
|
|
5
|
-
* Phase 1: English only, but structure ready for expansion.
|
|
6
|
-
*/
|
|
7
1
|
import en from './locales/en.json';
|
|
8
2
|
const translations = {
|
|
9
3
|
en,
|
|
10
|
-
ko: en,
|
|
11
|
-
zh: en,
|
|
12
|
-
ja: en,
|
|
4
|
+
ko: en,
|
|
5
|
+
zh: en,
|
|
6
|
+
ja: en,
|
|
13
7
|
};
|
|
14
8
|
let currentLocale = 'en';
|
|
15
|
-
/**
|
|
16
|
-
* Set the current locale
|
|
17
|
-
*/
|
|
18
9
|
export function setLocale(locale) {
|
|
19
10
|
currentLocale = locale;
|
|
20
11
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Get the current locale
|
|
23
|
-
*/
|
|
24
12
|
export function getLocale() {
|
|
25
13
|
return currentLocale;
|
|
26
14
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Translate a key
|
|
29
|
-
*/
|
|
30
15
|
export function t(key, params) {
|
|
31
16
|
const translation = translations[currentLocale][key] || translations.en[key] || key;
|
|
32
17
|
if (!params) {
|
|
33
18
|
return translation;
|
|
34
19
|
}
|
|
35
|
-
// Replace {{param}} placeholders
|
|
36
20
|
return translation.replace(/\{\{(\w+)\}\}/g, (_, paramKey) => {
|
|
37
21
|
return params[paramKey] || `{{${paramKey}}}`;
|
|
38
22
|
});
|
|
39
23
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Load translations for a locale
|
|
42
|
-
*/
|
|
43
24
|
export async function loadLocale(locale) {
|
|
44
25
|
if (translations[locale] && translations[locale] !== translations.en) {
|
|
45
|
-
return;
|
|
26
|
+
return;
|
|
46
27
|
}
|
|
47
28
|
try {
|
|
48
29
|
const module = await import(`./locales/${locale}.json`);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maskweaver - AI Expert Persona System
|
|
3
|
-
*
|
|
4
|
-
* 가면술사: AI 코딩 어시스턴트에게 전문가 인격을 부여하는 시스템
|
|
5
|
-
*
|
|
6
|
-
* @author ULJI SOFT <ulgerang@gmail.com>
|
|
7
|
-
* @license MIT
|
|
8
|
-
*/
|
|
9
1
|
import { MaskweaverPlugin } from "./plugin/index.js";
|
|
10
2
|
export { MaskweaverPlugin };
|
|
11
3
|
declare const _default: {
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maskweaver - AI Expert Persona System
|
|
3
|
-
*
|
|
4
|
-
* 가면술사: AI 코딩 어시스턴트에게 전문가 인격을 부여하는 시스템
|
|
5
|
-
*
|
|
6
|
-
* @author ULJI SOFT <ulgerang@gmail.com>
|
|
7
|
-
* @license MIT
|
|
8
|
-
*/
|
|
9
1
|
import { MaskweaverPlugin } from "./plugin/index.js";
|
|
10
2
|
export { MaskweaverPlugin };
|
|
11
3
|
export default {
|
package/dist/lib.d.ts
CHANGED
package/dist/lib.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maskweaver - AI Expert Persona System
|
|
3
|
-
*
|
|
4
|
-
* Library exports for programmatic usage.
|
|
5
|
-
*/
|
|
6
|
-
// Version
|
|
7
1
|
export { VERSION, getVersionString } from "./version.js";
|
|
8
|
-
// Core: Schema, validation, prompt builder
|
|
9
2
|
export * as core from "./core/index.js";
|
|
10
|
-
// Shared: Errors, types, config
|
|
11
3
|
export * as shared from "./shared/index.js";
|
|
12
|
-
// Memory: Embedding, vector search
|
|
13
4
|
export * as memory from "./memory/index.js";
|
|
14
|
-
// Context: Feature context management
|
|
15
5
|
export * as context from "./context/index.js";
|
|
16
|
-
// Retrospect: Session retrospective
|
|
17
6
|
export * as retrospect from "./retrospect/index.js";
|
|
18
|
-
// Verify: Code verification
|
|
19
7
|
export * as verify from "./verify/index.js";
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text Chunking - Break text into manageable pieces
|
|
3
|
-
*
|
|
4
|
-
* Simple line-based chunking with overlap.
|
|
5
|
-
* Preserves context at chunk boundaries.
|
|
6
|
-
*/
|
|
7
1
|
import { type Chunk } from './core.js';
|
|
8
|
-
/**
|
|
9
|
-
* Chunk text into overlapping segments.
|
|
10
|
-
*/
|
|
11
2
|
export declare function chunkText(text: string, filePath: string): Chunk[];
|
|
12
|
-
/**
|
|
13
|
-
* Estimate tokens in text.
|
|
14
|
-
*/
|
|
15
3
|
export declare function estimateTokens(text: string): number;
|
|
16
|
-
/**
|
|
17
|
-
* Split text into sentences.
|
|
18
|
-
* Handles both English and Korean.
|
|
19
|
-
*/
|
|
20
4
|
export declare function splitIntoSentences(text: string): string[];
|
|
21
|
-
/**
|
|
22
|
-
* Markdown section parsing.
|
|
23
|
-
*/
|
|
24
5
|
export interface MarkdownSection {
|
|
25
6
|
header: string;
|
|
26
7
|
content: string;
|
|
@@ -28,7 +9,4 @@ export interface MarkdownSection {
|
|
|
28
9
|
startLine: number;
|
|
29
10
|
endLine: number;
|
|
30
11
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Parse markdown into sections.
|
|
33
|
-
*/
|
|
34
12
|
export declare function parseMarkdownSections(content: string): MarkdownSection[];
|