@tienne/gestalt 0.84.2 → 0.85.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/CLAUDE.md +4 -4
- package/README.ko.md +72 -22
- package/README.md +73 -23
- package/dist/benchmarks/runners/passthrough-benchmark-runner.d.ts.map +1 -1
- package/dist/benchmarks/runners/passthrough-benchmark-runner.js +8 -7
- package/dist/benchmarks/runners/passthrough-benchmark-runner.js.map +1 -1
- package/dist/bin/gestalt.js +2 -2
- package/dist/package.json +1 -1
- package/dist/plugin/skills/dispatch/SKILL.md +14 -2
- package/dist/plugin/skills/execute/SKILL.md +219 -52
- package/dist/plugin/skills/interview/SKILL.md +15 -2
- package/dist/plugin/skills/solve/SKILL.md +20 -5
- package/dist/plugin/skills/spec/SKILL.md +2 -0
- package/dist/src/cli/commands/interview.d.ts.map +1 -1
- package/dist/src/cli/commands/interview.js +16 -4
- package/dist/src/cli/commands/interview.js.map +1 -1
- package/dist/src/cli/commands/memory-merge.d.ts +2 -0
- package/dist/src/cli/commands/memory-merge.d.ts.map +1 -0
- package/dist/src/cli/commands/memory-merge.js +13 -0
- package/dist/src/cli/commands/memory-merge.js.map +1 -0
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +7 -0
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/core/constants.d.ts +4 -0
- package/dist/src/core/constants.d.ts.map +1 -1
- package/dist/src/core/constants.js +8 -0
- package/dist/src/core/constants.js.map +1 -1
- package/dist/src/core/errors.d.ts +3 -0
- package/dist/src/core/errors.d.ts.map +1 -1
- package/dist/src/core/errors.js +7 -0
- package/dist/src/core/errors.js.map +1 -1
- package/dist/src/core/file-lock.d.ts +37 -0
- package/dist/src/core/file-lock.d.ts.map +1 -0
- package/dist/src/core/file-lock.js +143 -0
- package/dist/src/core/file-lock.js.map +1 -0
- package/dist/src/core/json-file.d.ts +40 -0
- package/dist/src/core/json-file.d.ts.map +1 -0
- package/dist/src/core/json-file.js +82 -0
- package/dist/src/core/json-file.js.map +1 -0
- package/dist/src/core/types.d.ts +86 -9
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/events/store.d.ts +6 -0
- package/dist/src/events/store.d.ts.map +1 -1
- package/dist/src/events/store.js +12 -0
- package/dist/src/events/store.js.map +1 -1
- package/dist/src/events/types.d.ts +7 -0
- package/dist/src/events/types.d.ts.map +1 -1
- package/dist/src/events/types.js +7 -0
- package/dist/src/events/types.js.map +1 -1
- package/dist/src/execute/artifact-verifier.d.ts +12 -0
- package/dist/src/execute/artifact-verifier.d.ts.map +1 -0
- package/dist/src/execute/artifact-verifier.js +211 -0
- package/dist/src/execute/artifact-verifier.js.map +1 -0
- package/dist/src/execute/drift-detector.d.ts +2 -0
- package/dist/src/execute/drift-detector.d.ts.map +1 -1
- package/dist/src/execute/drift-detector.js +9 -13
- package/dist/src/execute/drift-detector.js.map +1 -1
- package/dist/src/execute/orchestrators/evaluation.d.ts +5 -1
- package/dist/src/execute/orchestrators/evaluation.d.ts.map +1 -1
- package/dist/src/execute/orchestrators/evaluation.js +48 -41
- package/dist/src/execute/orchestrators/evaluation.js.map +1 -1
- package/dist/src/execute/orchestrators/evolution.d.ts +17 -3
- package/dist/src/execute/orchestrators/evolution.d.ts.map +1 -1
- package/dist/src/execute/orchestrators/evolution.js +102 -53
- package/dist/src/execute/orchestrators/evolution.js.map +1 -1
- package/dist/src/execute/orchestrators/execution.d.ts +17 -2
- package/dist/src/execute/orchestrators/execution.d.ts.map +1 -1
- package/dist/src/execute/orchestrators/execution.js +99 -3
- package/dist/src/execute/orchestrators/execution.js.map +1 -1
- package/dist/src/execute/orchestrators/planning.d.ts +18 -4
- package/dist/src/execute/orchestrators/planning.d.ts.map +1 -1
- package/dist/src/execute/orchestrators/planning.js +62 -21
- package/dist/src/execute/orchestrators/planning.js.map +1 -1
- package/dist/src/execute/orchestrators/types.d.ts +12 -1
- package/dist/src/execute/orchestrators/types.d.ts.map +1 -1
- package/dist/src/execute/passthrough-engine.d.ts +12 -5
- package/dist/src/execute/passthrough-engine.d.ts.map +1 -1
- package/dist/src/execute/passthrough-engine.js +10 -4
- package/dist/src/execute/passthrough-engine.js.map +1 -1
- package/dist/src/execute/repository.d.ts +11 -1
- package/dist/src/execute/repository.d.ts.map +1 -1
- package/dist/src/execute/repository.js +138 -19
- package/dist/src/execute/repository.js.map +1 -1
- package/dist/src/execute/session.d.ts +26 -4
- package/dist/src/execute/session.d.ts.map +1 -1
- package/dist/src/execute/session.js +165 -48
- package/dist/src/execute/session.js.map +1 -1
- package/dist/src/execute/structural-commands.d.ts +23 -0
- package/dist/src/execute/structural-commands.d.ts.map +1 -0
- package/dist/src/execute/structural-commands.js +139 -0
- package/dist/src/execute/structural-commands.js.map +1 -0
- package/dist/src/interview/engine.d.ts +1 -1
- package/dist/src/interview/engine.d.ts.map +1 -1
- package/dist/src/interview/engine.js +3 -3
- package/dist/src/interview/engine.js.map +1 -1
- package/dist/src/interview/passthrough-engine.d.ts +1 -1
- package/dist/src/interview/passthrough-engine.d.ts.map +1 -1
- package/dist/src/interview/passthrough-engine.js +20 -3
- package/dist/src/interview/passthrough-engine.js.map +1 -1
- package/dist/src/interview/repository.d.ts +8 -0
- package/dist/src/interview/repository.d.ts.map +1 -1
- package/dist/src/interview/repository.js +16 -1
- package/dist/src/interview/repository.js.map +1 -1
- package/dist/src/interview/session.d.ts +15 -2
- package/dist/src/interview/session.d.ts.map +1 -1
- package/dist/src/interview/session.js +67 -23
- package/dist/src/interview/session.js.map +1 -1
- package/dist/src/knowledge-base/embedding.d.ts +6 -1
- package/dist/src/knowledge-base/embedding.d.ts.map +1 -1
- package/dist/src/knowledge-base/embedding.js +19 -6
- package/dist/src/knowledge-base/embedding.js.map +1 -1
- package/dist/src/local-pr/registry.d.ts +1 -21
- package/dist/src/local-pr/registry.d.ts.map +1 -1
- package/dist/src/local-pr/registry.js +7 -113
- package/dist/src/local-pr/registry.js.map +1 -1
- package/dist/src/mcp/input-guard.d.ts +17 -0
- package/dist/src/mcp/input-guard.d.ts.map +1 -1
- package/dist/src/mcp/input-guard.js +1 -1
- package/dist/src/mcp/input-guard.js.map +1 -1
- package/dist/src/mcp/schemas.d.ts +62 -7
- package/dist/src/mcp/schemas.d.ts.map +1 -1
- package/dist/src/mcp/schemas.js +28 -1
- package/dist/src/mcp/schemas.js.map +1 -1
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +26 -40
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools/execute/evaluate.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute/evaluate.js +15 -9
- package/dist/src/mcp/tools/execute/evaluate.js.map +1 -1
- package/dist/src/mcp/tools/execute/evolve.d.ts +1 -0
- package/dist/src/mcp/tools/execute/evolve.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute/evolve.js +102 -37
- package/dist/src/mcp/tools/execute/evolve.js.map +1 -1
- package/dist/src/mcp/tools/execute/execution.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute/execution.js +66 -7
- package/dist/src/mcp/tools/execute/execution.js.map +1 -1
- package/dist/src/mcp/tools/execute/planning.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute/planning.js +34 -2
- package/dist/src/mcp/tools/execute/planning.js.map +1 -1
- package/dist/src/mcp/tools/execute/roles.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute/roles.js +13 -5
- package/dist/src/mcp/tools/execute/roles.js.map +1 -1
- package/dist/src/mcp/tools/execute/utility.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute/utility.js +26 -0
- package/dist/src/mcp/tools/execute/utility.js.map +1 -1
- package/dist/src/mcp/tools/execute/utils.d.ts +1 -0
- package/dist/src/mcp/tools/execute/utils.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute/utils.js +15 -0
- package/dist/src/mcp/tools/execute/utils.js.map +1 -1
- package/dist/src/mcp/tools/execute-passthrough.d.ts.map +1 -1
- package/dist/src/mcp/tools/execute-passthrough.js +21 -1
- package/dist/src/mcp/tools/execute-passthrough.js.map +1 -1
- package/dist/src/mcp/tools/interview-passthrough.d.ts +2 -1
- package/dist/src/mcp/tools/interview-passthrough.d.ts.map +1 -1
- package/dist/src/mcp/tools/interview-passthrough.js +4 -3
- package/dist/src/mcp/tools/interview-passthrough.js.map +1 -1
- package/dist/src/mcp/tools/interview.d.ts.map +1 -1
- package/dist/src/mcp/tools/interview.js +2 -1
- package/dist/src/mcp/tools/interview.js.map +1 -1
- package/dist/src/mcp/tools/review-passthrough.js +15 -19
- package/dist/src/mcp/tools/review-passthrough.js.map +1 -1
- package/dist/src/mcp/tools/spec-passthrough.d.ts.map +1 -1
- package/dist/src/mcp/tools/spec-passthrough.js +16 -8
- package/dist/src/mcp/tools/spec-passthrough.js.map +1 -1
- package/dist/src/mcp/tools/status.d.ts.map +1 -1
- package/dist/src/mcp/tools/status.js +4 -0
- package/dist/src/mcp/tools/status.js.map +1 -1
- package/dist/src/memory/memory-context-injector.d.ts +22 -8
- package/dist/src/memory/memory-context-injector.d.ts.map +1 -1
- package/dist/src/memory/memory-context-injector.js +85 -13
- package/dist/src/memory/memory-context-injector.js.map +1 -1
- package/dist/src/memory/memory-merge.d.ts +19 -0
- package/dist/src/memory/memory-merge.d.ts.map +1 -0
- package/dist/src/memory/memory-merge.js +120 -0
- package/dist/src/memory/memory-merge.js.map +1 -0
- package/dist/src/memory/project-memory-store.d.ts +15 -11
- package/dist/src/memory/project-memory-store.d.ts.map +1 -1
- package/dist/src/memory/project-memory-store.js +97 -120
- package/dist/src/memory/project-memory-store.js.map +1 -1
- package/dist/src/memory/semantic-search.d.ts +4 -1
- package/dist/src/memory/semantic-search.d.ts.map +1 -1
- package/dist/src/memory/semantic-search.js +66 -19
- package/dist/src/memory/semantic-search.js.map +1 -1
- package/dist/src/resilience/lateral.d.ts +8 -1
- package/dist/src/resilience/lateral.d.ts.map +1 -1
- package/dist/src/resilience/lateral.js +52 -4
- package/dist/src/resilience/lateral.js.map +1 -1
- package/package.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
- package/plugin/mcp.json +1 -1
- package/plugin/skills/dispatch/SKILL.md +14 -2
- package/plugin/skills/execute/SKILL.md +219 -52
- package/plugin/skills/interview/SKILL.md +15 -2
- package/plugin/skills/solve/SKILL.md +20 -5
- package/plugin/skills/spec/SKILL.md +2 -0
- package/dist/src/interview/mini-interview-engine.d.ts +0 -33
- package/dist/src/interview/mini-interview-engine.d.ts.map +0 -1
- package/dist/src/interview/mini-interview-engine.js +0 -102
- package/dist/src/interview/mini-interview-engine.js.map +0 -1
- package/dist/src/memory/user-profile-store.d.ts +0 -13
- package/dist/src/memory/user-profile-store.d.ts.map +0 -1
- package/dist/src/memory/user-profile-store.js +0 -85
- package/dist/src/memory/user-profile-store.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mini-interview-engine.d.ts","sourceRoot":"","sources":["../../../src/interview/mini-interview-engine.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAsFD,qBAAa,mBAAmB;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO;IAK5D,yBAAyB,CACvB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,wBAAwB,GAC9B,oBAAoB;IAgBvB,qBAAqB,CACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,GACnD,MAAM;CAGV"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { RESOLUTION_THRESHOLD } from '../core/constants.js';
|
|
2
|
-
import { INTERVIEW_SYSTEM_PROMPT } from '../llm/prompts.js';
|
|
3
|
-
// ─── Helpers ────────────────────────────────────────────────────
|
|
4
|
-
function getDimensionsNeedingClarification(score) {
|
|
5
|
-
const clarityFloor = 1 - RESOLUTION_THRESHOLD;
|
|
6
|
-
const dims = [];
|
|
7
|
-
if (score.goalClarity < clarityFloor)
|
|
8
|
-
dims.push('goalClarity');
|
|
9
|
-
if (score.constraintClarity < clarityFloor)
|
|
10
|
-
dims.push('constraintClarity');
|
|
11
|
-
if (score.successCriteria < clarityFloor)
|
|
12
|
-
dims.push('successCriteria');
|
|
13
|
-
if (score.priorityClarity < clarityFloor)
|
|
14
|
-
dims.push('priorityClarity');
|
|
15
|
-
if (score.contextClarity !== undefined && score.contextClarity < clarityFloor) {
|
|
16
|
-
dims.push('contextClarity');
|
|
17
|
-
}
|
|
18
|
-
return dims;
|
|
19
|
-
}
|
|
20
|
-
function dimensionToLabel(dim) {
|
|
21
|
-
const labels = {
|
|
22
|
-
goalClarity: 'Project goal and objectives',
|
|
23
|
-
constraintClarity: 'Technical or business constraints',
|
|
24
|
-
successCriteria: 'Measurable success criteria',
|
|
25
|
-
priorityClarity: 'Feature prioritization and MVP scope',
|
|
26
|
-
contextClarity: 'Existing system or project context',
|
|
27
|
-
};
|
|
28
|
-
return labels[dim] ?? dim;
|
|
29
|
-
}
|
|
30
|
-
function buildMiniQuestionPrompt(topic, ambiguousText, dimensions) {
|
|
31
|
-
const dimLabels = dimensions.map((d) => `- ${dimensionToLabel(d)}`).join('\n');
|
|
32
|
-
return `Given this text description:
|
|
33
|
-
---
|
|
34
|
-
${ambiguousText}
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
Topic: "${topic}"
|
|
38
|
-
|
|
39
|
-
The following dimensions still need clarification:
|
|
40
|
-
${dimLabels}
|
|
41
|
-
|
|
42
|
-
Generate ONE targeted question per dimension to resolve the remaining ambiguity.
|
|
43
|
-
Respond with ONLY a JSON array:
|
|
44
|
-
[
|
|
45
|
-
{
|
|
46
|
-
"dimension": "goalClarity|constraintClarity|successCriteria|priorityClarity|contextClarity",
|
|
47
|
-
"prompt": "Your clarifying question here",
|
|
48
|
-
"rationale": "Why this question resolves the ambiguity"
|
|
49
|
-
}
|
|
50
|
-
]`;
|
|
51
|
-
}
|
|
52
|
-
function buildMiniScoringPrompt(topic, originalText, answers) {
|
|
53
|
-
const qa = answers.map((a, i) => `Q${i + 1}: ${a.question}\nA${i + 1}: ${a.answer}`).join('\n\n');
|
|
54
|
-
return `Re-score the ambiguity of this project description after the follow-up Q&A.
|
|
55
|
-
|
|
56
|
-
Original description: "${originalText}"
|
|
57
|
-
Topic: "${topic}"
|
|
58
|
-
|
|
59
|
-
Follow-up Q&A:
|
|
60
|
-
${qa}
|
|
61
|
-
|
|
62
|
-
Score each dimension from 0.0 (completely ambiguous) to 1.0 (crystal clear).
|
|
63
|
-
|
|
64
|
-
Respond with ONLY a JSON object:
|
|
65
|
-
{
|
|
66
|
-
"goalClarity": 0.0-1.0,
|
|
67
|
-
"constraintClarity": 0.0-1.0,
|
|
68
|
-
"successCriteria": 0.0-1.0,
|
|
69
|
-
"priorityClarity": 0.0-1.0,
|
|
70
|
-
"contradictions": [],
|
|
71
|
-
"reasoning": "Brief analysis"
|
|
72
|
-
}`;
|
|
73
|
-
}
|
|
74
|
-
// ─── Engine ─────────────────────────────────────────────────────
|
|
75
|
-
export class MiniInterviewEngine {
|
|
76
|
-
/**
|
|
77
|
-
* Given an initial ambiguity score from text-based spec generation,
|
|
78
|
-
* determine if a mini-interview is needed and build the clarification context.
|
|
79
|
-
*/
|
|
80
|
-
needsMiniInterview(score) {
|
|
81
|
-
const dims = getDimensionsNeedingClarification(score);
|
|
82
|
-
return dims.length > 0;
|
|
83
|
-
}
|
|
84
|
-
buildClarificationContext(topic, text, score) {
|
|
85
|
-
const dims = getDimensionsNeedingClarification(score);
|
|
86
|
-
return {
|
|
87
|
-
systemPrompt: INTERVIEW_SYSTEM_PROMPT,
|
|
88
|
-
questions: dims.map((d) => ({
|
|
89
|
-
dimension: d,
|
|
90
|
-
prompt: '', // Caller LLM fills this in using the clarification prompt
|
|
91
|
-
rationale: '',
|
|
92
|
-
})),
|
|
93
|
-
scoringPrompt: buildMiniQuestionPrompt(topic, text, dims),
|
|
94
|
-
sourceTopic: topic,
|
|
95
|
-
message: `${dims.length} dimension(s) need clarification: ${dims.map(dimensionToLabel).join(', ')}. Use the scoringPrompt to generate clarifying questions.`,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
buildReScoringContext(topic, text, answers) {
|
|
99
|
-
return buildMiniScoringPrompt(topic, text, answers);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=mini-interview-engine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mini-interview-engine.js","sourceRoot":"","sources":["../../../src/interview/mini-interview-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AA2B5D,mEAAmE;AAEnE,SAAS,iCAAiC,CAAC,KAA+B;IACxE,MAAM,YAAY,GAAG,CAAC,GAAG,oBAAoB,CAAC;IAC9C,MAAM,IAAI,GAA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 -1,13 +0,0 @@
|
|
|
1
|
-
import type { UserProfile } from '../core/types.js';
|
|
2
|
-
export declare class UserProfileStore {
|
|
3
|
-
private profilePath;
|
|
4
|
-
constructor(profilePath?: string);
|
|
5
|
-
read(): UserProfile;
|
|
6
|
-
private write;
|
|
7
|
-
setPreference(key: string, value: unknown): UserProfile;
|
|
8
|
-
addCrossRepoPattern(pattern: string): UserProfile;
|
|
9
|
-
setPreferredModel(model: string): UserProfile;
|
|
10
|
-
setUserId(userId: string): UserProfile;
|
|
11
|
-
merge(partial: Partial<UserProfile>): UserProfile;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=user-profile-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-profile-store.d.ts","sourceRoot":"","sources":["../../../src/memory/user-profile-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAkBpD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,WAAW,CAAS;gBAEhB,WAAW,CAAC,EAAE,MAAM;IAIhC,IAAI,IAAI,WAAW;IAYnB,OAAO,CAAC,KAAK;IASb,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW;IAOvD,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IASjD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAO7C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAOtC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW;CAgBlD"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname } from 'node:path';
|
|
3
|
-
import { gestaltPath } from '../core/home.js';
|
|
4
|
-
const PROFILE_FILENAME = 'profile.json';
|
|
5
|
-
function getProfilePath() {
|
|
6
|
-
return gestaltPath(PROFILE_FILENAME);
|
|
7
|
-
}
|
|
8
|
-
function createEmptyProfile() {
|
|
9
|
-
const now = new Date().toISOString();
|
|
10
|
-
return {
|
|
11
|
-
crossRepoPatterns: [],
|
|
12
|
-
personalPreferences: {},
|
|
13
|
-
createdAt: now,
|
|
14
|
-
updatedAt: now,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export class UserProfileStore {
|
|
18
|
-
profilePath;
|
|
19
|
-
constructor(profilePath) {
|
|
20
|
-
this.profilePath = profilePath ?? getProfilePath();
|
|
21
|
-
}
|
|
22
|
-
read() {
|
|
23
|
-
if (!existsSync(this.profilePath)) {
|
|
24
|
-
return createEmptyProfile();
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
const raw = readFileSync(this.profilePath, 'utf-8');
|
|
28
|
-
return JSON.parse(raw);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return createEmptyProfile();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
write(profile) {
|
|
35
|
-
const dir = dirname(this.profilePath);
|
|
36
|
-
if (!existsSync(dir)) {
|
|
37
|
-
mkdirSync(dir, { recursive: true });
|
|
38
|
-
}
|
|
39
|
-
profile.updatedAt = new Date().toISOString();
|
|
40
|
-
writeFileSync(this.profilePath, JSON.stringify(profile, null, 2), 'utf-8');
|
|
41
|
-
}
|
|
42
|
-
setPreference(key, value) {
|
|
43
|
-
const profile = this.read();
|
|
44
|
-
profile.personalPreferences[key] = value;
|
|
45
|
-
this.write(profile);
|
|
46
|
-
return profile;
|
|
47
|
-
}
|
|
48
|
-
addCrossRepoPattern(pattern) {
|
|
49
|
-
const profile = this.read();
|
|
50
|
-
if (!profile.crossRepoPatterns.includes(pattern)) {
|
|
51
|
-
profile.crossRepoPatterns.push(pattern);
|
|
52
|
-
}
|
|
53
|
-
this.write(profile);
|
|
54
|
-
return profile;
|
|
55
|
-
}
|
|
56
|
-
setPreferredModel(model) {
|
|
57
|
-
const profile = this.read();
|
|
58
|
-
profile.preferredModel = model;
|
|
59
|
-
this.write(profile);
|
|
60
|
-
return profile;
|
|
61
|
-
}
|
|
62
|
-
setUserId(userId) {
|
|
63
|
-
const profile = this.read();
|
|
64
|
-
profile.userId = userId;
|
|
65
|
-
this.write(profile);
|
|
66
|
-
return profile;
|
|
67
|
-
}
|
|
68
|
-
merge(partial) {
|
|
69
|
-
const profile = this.read();
|
|
70
|
-
const merged = {
|
|
71
|
-
...profile,
|
|
72
|
-
...partial,
|
|
73
|
-
crossRepoPatterns: [
|
|
74
|
-
...new Set([...profile.crossRepoPatterns, ...(partial.crossRepoPatterns ?? [])]),
|
|
75
|
-
],
|
|
76
|
-
personalPreferences: {
|
|
77
|
-
...profile.personalPreferences,
|
|
78
|
-
...(partial.personalPreferences ?? {}),
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
this.write(merged);
|
|
82
|
-
return merged;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=user-profile-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-profile-store.js","sourceRoot":"","sources":["../../../src/memory/user-profile-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC,SAAS,cAAc;IACrB,OAAO,WAAW,CAAC,gBAAgB,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO;QACL,iBAAiB,EAAE,EAAE;QACrB,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,GAAG;QAC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