fivocell 6.3.0 → 7.1.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/README.md +194 -197
- package/dist/__tests__/cli-regression.test.js +1 -1
- package/dist/__tests__/cli-regression.test.js.map +1 -1
- package/dist/__tests__/teach-context.test.d.ts +2 -0
- package/dist/__tests__/teach-context.test.d.ts.map +1 -0
- package/dist/__tests__/teach-context.test.js +44 -0
- package/dist/__tests__/teach-context.test.js.map +1 -0
- package/dist/__tests__/teach-parser.test.d.ts +2 -0
- package/dist/__tests__/teach-parser.test.d.ts.map +1 -0
- package/dist/__tests__/teach-parser.test.js +56 -0
- package/dist/__tests__/teach-parser.test.js.map +1 -0
- package/dist/__tests__/teach-store.test.d.ts +2 -0
- package/dist/__tests__/teach-store.test.d.ts.map +1 -0
- package/dist/__tests__/teach-store.test.js +68 -0
- package/dist/__tests__/teach-store.test.js.map +1 -0
- package/dist/__tests__/vibe-engine.test.d.ts +2 -0
- package/dist/__tests__/vibe-engine.test.d.ts.map +1 -0
- package/dist/__tests__/vibe-engine.test.js +132 -0
- package/dist/__tests__/vibe-engine.test.js.map +1 -0
- package/dist/walls/01-context/context/agents-md.d.ts +1 -1
- package/dist/walls/01-context/context/agents-md.d.ts.map +1 -1
- package/dist/walls/01-context/context/agents-md.js +33 -1
- package/dist/walls/01-context/context/agents-md.js.map +1 -1
- package/dist/walls/01-context/context/context-bridge.d.ts +39 -0
- package/dist/walls/01-context/context/context-bridge.d.ts.map +1 -0
- package/dist/walls/01-context/context/context-bridge.js +224 -0
- package/dist/walls/01-context/context/context-bridge.js.map +1 -0
- package/dist/walls/01-context/context/context-continuity.d.ts +54 -0
- package/dist/walls/01-context/context/context-continuity.d.ts.map +1 -0
- package/dist/walls/01-context/context/context-continuity.js +350 -0
- package/dist/walls/01-context/context/context-continuity.js.map +1 -0
- package/dist/walls/01-context/context/context-predictor.d.ts +24 -0
- package/dist/walls/01-context/context/context-predictor.d.ts.map +1 -0
- package/dist/walls/01-context/context/context-predictor.js +322 -0
- package/dist/walls/01-context/context/context-predictor.js.map +1 -0
- package/dist/walls/01-context/context/prompt-builder.d.ts +1 -0
- package/dist/walls/01-context/context/prompt-builder.d.ts.map +1 -1
- package/dist/walls/01-context/context/prompt-builder.js +68 -1
- package/dist/walls/01-context/context/prompt-builder.js.map +1 -1
- package/dist/walls/01-context/sessions/session-memory.d.ts.map +1 -1
- package/dist/walls/01-context/sessions/session-memory.js +47 -1
- package/dist/walls/01-context/sessions/session-memory.js.map +1 -1
- package/dist/walls/04-team/collab/team-supreme.d.ts +70 -0
- package/dist/walls/04-team/collab/team-supreme.d.ts.map +1 -0
- package/dist/walls/04-team/collab/team-supreme.js +357 -0
- package/dist/walls/04-team/collab/team-supreme.js.map +1 -0
- package/dist/walls/05-community/share/cloud-connector.d.ts +83 -0
- package/dist/walls/05-community/share/cloud-connector.d.ts.map +1 -0
- package/dist/walls/05-community/share/cloud-connector.js +385 -0
- package/dist/walls/05-community/share/cloud-connector.js.map +1 -0
- package/dist/walls/05-community/stats/community-supreme.d.ts +83 -0
- package/dist/walls/05-community/stats/community-supreme.d.ts.map +1 -0
- package/dist/walls/05-community/stats/community-supreme.js +221 -0
- package/dist/walls/05-community/stats/community-supreme.js.map +1 -0
- package/dist/walls/06-memory/archive/blob-vault.d.ts.map +1 -1
- package/dist/walls/06-memory/archive/blob-vault.js +8 -9
- package/dist/walls/06-memory/archive/blob-vault.js.map +1 -1
- package/dist/walls/06-memory/archive/memory-archive.d.ts.map +1 -1
- package/dist/walls/06-memory/archive/memory-archive.js +32 -22
- package/dist/walls/06-memory/archive/memory-archive.js.map +1 -1
- package/dist/walls/06-memory/privacy/key-provider.d.ts +19 -0
- package/dist/walls/06-memory/privacy/key-provider.d.ts.map +1 -1
- package/dist/walls/06-memory/privacy/key-provider.js +52 -0
- package/dist/walls/06-memory/privacy/key-provider.js.map +1 -1
- package/dist/walls/06-memory/retrieval/context-pipeline.d.ts.map +1 -1
- package/dist/walls/06-memory/retrieval/context-pipeline.js +9 -0
- package/dist/walls/06-memory/retrieval/context-pipeline.js.map +1 -1
- package/dist/walls/06-memory/stores/sync-engine.d.ts.map +1 -1
- package/dist/walls/06-memory/stores/sync-engine.js +56 -49
- package/dist/walls/06-memory/stores/sync-engine.js.map +1 -1
- package/dist/walls/06-memory/teach/teach-context.d.ts +8 -0
- package/dist/walls/06-memory/teach/teach-context.d.ts.map +1 -0
- package/dist/walls/06-memory/teach/teach-context.js +25 -0
- package/dist/walls/06-memory/teach/teach-context.js.map +1 -0
- package/dist/walls/06-memory/teach/teach-parser.d.ts +6 -0
- package/dist/walls/06-memory/teach/teach-parser.d.ts.map +1 -0
- package/dist/walls/06-memory/teach/teach-parser.js +42 -0
- package/dist/walls/06-memory/teach/teach-parser.js.map +1 -0
- package/dist/walls/06-memory/teach/teach-sections.d.ts +10 -0
- package/dist/walls/06-memory/teach/teach-sections.d.ts.map +1 -0
- package/dist/walls/06-memory/teach/teach-sections.js +67 -0
- package/dist/walls/06-memory/teach/teach-sections.js.map +1 -0
- package/dist/walls/06-memory/teach/teach-store.d.ts +25 -0
- package/dist/walls/06-memory/teach/teach-store.d.ts.map +1 -0
- package/dist/walls/06-memory/teach/teach-store.js +95 -0
- package/dist/walls/06-memory/teach/teach-store.js.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-cli.d.ts +2 -0
- package/dist/walls/06-memory/vibe/vibe-cli.d.ts.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-cli.js +217 -0
- package/dist/walls/06-memory/vibe/vibe-cli.js.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-confidence.d.ts +24 -0
- package/dist/walls/06-memory/vibe/vibe-confidence.d.ts.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-confidence.js +91 -0
- package/dist/walls/06-memory/vibe/vibe-confidence.js.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-context.d.ts +8 -0
- package/dist/walls/06-memory/vibe/vibe-context.d.ts.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-context.js +88 -0
- package/dist/walls/06-memory/vibe/vibe-context.js.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-engine.d.ts +45 -0
- package/dist/walls/06-memory/vibe/vibe-engine.d.ts.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-engine.js +670 -0
- package/dist/walls/06-memory/vibe/vibe-engine.js.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-intelligence.d.ts +19 -0
- package/dist/walls/06-memory/vibe/vibe-intelligence.d.ts.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-intelligence.js +264 -0
- package/dist/walls/06-memory/vibe/vibe-intelligence.js.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-signals.d.ts +27 -0
- package/dist/walls/06-memory/vibe/vibe-signals.d.ts.map +1 -0
- package/dist/walls/06-memory/vibe/vibe-signals.js +251 -0
- package/dist/walls/06-memory/vibe/vibe-signals.js.map +1 -0
- package/dist/walls/07-runtime/cli/cli.js +25 -0
- package/dist/walls/07-runtime/cli/cli.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/branch.js +6 -6
- package/dist/walls/07-runtime/cli/commands/branch.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/cloud.d.ts +3 -0
- package/dist/walls/07-runtime/cli/commands/cloud.d.ts.map +1 -0
- package/dist/walls/07-runtime/cli/commands/cloud.js +219 -0
- package/dist/walls/07-runtime/cli/commands/cloud.js.map +1 -0
- package/dist/walls/07-runtime/cli/commands/community.d.ts.map +1 -1
- package/dist/walls/07-runtime/cli/commands/community.js +6 -0
- package/dist/walls/07-runtime/cli/commands/community.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/help.d.ts.map +1 -1
- package/dist/walls/07-runtime/cli/commands/help.js +87 -77
- package/dist/walls/07-runtime/cli/commands/help.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/memory.js +5 -5
- package/dist/walls/07-runtime/cli/commands/memory.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/scan.d.ts.map +1 -1
- package/dist/walls/07-runtime/cli/commands/scan.js +39 -20
- package/dist/walls/07-runtime/cli/commands/scan.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/session.d.ts.map +1 -1
- package/dist/walls/07-runtime/cli/commands/session.js +2 -1
- package/dist/walls/07-runtime/cli/commands/session.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/setup.js +2 -2
- package/dist/walls/07-runtime/cli/commands/setup.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/status.js +7 -7
- package/dist/walls/07-runtime/cli/commands/status.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/sync.js +1 -1
- package/dist/walls/07-runtime/cli/commands/sync.js.map +1 -1
- package/dist/walls/07-runtime/cli/commands/teach.d.ts +3 -0
- package/dist/walls/07-runtime/cli/commands/teach.d.ts.map +1 -0
- package/dist/walls/07-runtime/cli/commands/teach.js +203 -0
- package/dist/walls/07-runtime/cli/commands/teach.js.map +1 -0
- package/dist/walls/07-runtime/cli/utils.js +2 -2
- package/dist/walls/07-runtime/daemon/lifecycle.d.ts.map +1 -1
- package/dist/walls/07-runtime/daemon/lifecycle.js +13 -1
- package/dist/walls/07-runtime/daemon/lifecycle.js.map +1 -1
- package/dist/walls/07-runtime/daemon/routes/session.d.ts.map +1 -1
- package/dist/walls/07-runtime/daemon/routes/session.js +4 -3
- package/dist/walls/07-runtime/daemon/routes/session.js.map +1 -1
- package/dist/walls/07-runtime/daemon/server.d.ts.map +1 -1
- package/dist/walls/07-runtime/daemon/server.js +3 -0
- package/dist/walls/07-runtime/daemon/server.js.map +1 -1
- package/package.json +1 -1
- package/scripts/deep-audit.js +103 -0
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// vibe-engine.ts — Core Vibe Learning Engine v3 Supreme
|
|
3
|
+
// Analyzes sessions, detects signals, generates rules, builds identity
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.analyzeSession = analyzeSession;
|
|
39
|
+
exports.buildVibeSummary = buildVibeSummary;
|
|
40
|
+
exports.getVibeSummaryFromVibeEngine_forTests = buildVibeSummary;
|
|
41
|
+
exports.getVibeData = getVibeData;
|
|
42
|
+
exports.getVibeSummary = getVibeSummary;
|
|
43
|
+
exports.getVibeMarkdown = getVibeMarkdown;
|
|
44
|
+
exports.resetVibe = resetVibe;
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const path = __importStar(require("path"));
|
|
47
|
+
const database_1 = require("../database/database");
|
|
48
|
+
const vibe_signals_1 = require("./vibe-signals");
|
|
49
|
+
const vibe_confidence_1 = require("./vibe-confidence");
|
|
50
|
+
const vibe_intelligence_1 = require("./vibe-intelligence");
|
|
51
|
+
function getVibeDir(projectDir) {
|
|
52
|
+
return path.join(projectDir, '.cell', 'vibe');
|
|
53
|
+
}
|
|
54
|
+
function ensureVibeDir(projectDir) {
|
|
55
|
+
const dir = getVibeDir(projectDir);
|
|
56
|
+
if (!fs.existsSync(dir))
|
|
57
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
58
|
+
return dir;
|
|
59
|
+
}
|
|
60
|
+
function analyzeSession(project, projectDir, totalSessions) {
|
|
61
|
+
const existing = loadSignals(projectDir);
|
|
62
|
+
const db = (0, database_1.getDb)();
|
|
63
|
+
const sessions = db.prepare('SELECT id, tool_name, files_touched, key_decisions, start_time FROM sessions WHERE project = ? ORDER BY id DESC LIMIT 20').all(project);
|
|
64
|
+
const events = db.prepare('SELECT type, topic, summary, details_json, importance FROM memory_events WHERE project = ? ORDER BY id DESC LIMIT 500').all(project);
|
|
65
|
+
const decisions = db.prepare('SELECT decision, approach, worked FROM decision_log WHERE project = ? ORDER BY id DESC LIMIT 100').all(project);
|
|
66
|
+
let teachData = {};
|
|
67
|
+
try {
|
|
68
|
+
const t = db.prepare("SELECT section, raw_text FROM developer_profile ORDER BY updated_at DESC").all();
|
|
69
|
+
t.forEach((x) => { teachData[x.section] = x.raw_text; });
|
|
70
|
+
}
|
|
71
|
+
catch { }
|
|
72
|
+
let styleData = {};
|
|
73
|
+
try {
|
|
74
|
+
const s = db.prepare('SELECT pattern_key, pattern_value FROM style_profiles ORDER BY detection_count DESC').all();
|
|
75
|
+
s.forEach((x) => { styleData[x.pattern_key] = x.pattern_value; });
|
|
76
|
+
}
|
|
77
|
+
catch { }
|
|
78
|
+
let sessionTextRaw = '';
|
|
79
|
+
try {
|
|
80
|
+
const apps = db.prepare('SELECT approach, status, reason FROM session_approaches ORDER BY id DESC LIMIT 50').all();
|
|
81
|
+
for (const a of apps)
|
|
82
|
+
sessionTextRaw += (a.approach || '') + ' ' + (a.reason || '') + ' ' + (a.status || '') + '\n';
|
|
83
|
+
const qs = db.prepare('SELECT question, priority FROM session_questions ORDER BY id DESC LIMIT 50').all();
|
|
84
|
+
for (const q of qs)
|
|
85
|
+
sessionTextRaw += (q.question || '') + ' ' + (q.priority || '') + '\n';
|
|
86
|
+
}
|
|
87
|
+
catch { }
|
|
88
|
+
let deepAnalysisData = { totalApproaches: 0, accepted: 0, rejected: 0, tried: 0, approachTexts: '' };
|
|
89
|
+
try {
|
|
90
|
+
const apps = db.prepare('SELECT approach, status, reason FROM session_approaches ORDER BY id DESC LIMIT 100').all();
|
|
91
|
+
deepAnalysisData.totalApproaches = apps.length;
|
|
92
|
+
for (const a of apps) {
|
|
93
|
+
deepAnalysisData.approachTexts += (a.approach || '') + ' ' + (a.reason || '') + ' ';
|
|
94
|
+
if (a.status === 'accepted' || a.status === 'worked')
|
|
95
|
+
deepAnalysisData.accepted++;
|
|
96
|
+
else if (a.status === 'rejected' || a.status === 'failed')
|
|
97
|
+
deepAnalysisData.rejected++;
|
|
98
|
+
else if (a.status === 'tried')
|
|
99
|
+
deepAnalysisData.tried++;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch { }
|
|
103
|
+
const signals = detectAllSignals(existing, sessions, events, decisions, teachData, styleData, sessionTextRaw, deepAnalysisData, totalSessions);
|
|
104
|
+
const rules = generateVibeRules(signals);
|
|
105
|
+
const correlated = (0, vibe_intelligence_1.generateCorrelatedInsights)(signals);
|
|
106
|
+
const traits = (0, vibe_intelligence_1.generateTraitInsights)(signals);
|
|
107
|
+
const allInsights = (0, vibe_intelligence_1.rankInsights)([...correlated, ...traits]);
|
|
108
|
+
const identitySummary = (0, vibe_intelligence_1.generateIdentitySummary)(signals, allInsights);
|
|
109
|
+
const aiGuide = (0, vibe_intelligence_1.generateAiGuide)(signals);
|
|
110
|
+
const vibeData = { sessionsAnalyzed: totalSessions, lastUpdated: new Date().toISOString(), signals, rules, insights: allInsights, identitySummary, aiGuide };
|
|
111
|
+
writeSignalsJson(projectDir, vibeData);
|
|
112
|
+
writeVibeMarkdown(projectDir, vibeData);
|
|
113
|
+
writeVibeSummary(projectDir, vibeData);
|
|
114
|
+
return vibeData;
|
|
115
|
+
}
|
|
116
|
+
// ─── All signal detection + rule generation + file I/O from existing code ───
|
|
117
|
+
// (preserved from previous version — same detectAllSignals, generateVibeRules, etc.)
|
|
118
|
+
function loadSignals(projectDir) {
|
|
119
|
+
try {
|
|
120
|
+
const p = path.join(getVibeDir(projectDir), 'signals.json');
|
|
121
|
+
if (!fs.existsSync(p))
|
|
122
|
+
return [];
|
|
123
|
+
const d = JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
124
|
+
return d.signals || [];
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function detectAllSignals(existingSignals, sessions, events, decisions, teachData, styleData, sessionTextRaw, deepAnalysisData, totalSessions) {
|
|
131
|
+
const signalMap = new Map();
|
|
132
|
+
existingSignals.forEach(s => signalMap.set(s.id, s));
|
|
133
|
+
const now = new Date().toISOString();
|
|
134
|
+
const allText = [...sessions.map((s) => (s.files_touched || '') + (s.key_decisions || '')), ...events.map((e) => (e.summary || '') + (e.topic || '') + (e.details_json || '')), ...decisions.map((d) => (d.decision || '') + (d.approach || '')), ...Object.values(teachData), ...Object.values(styleData), sessionTextRaw].join(' ').toLowerCase();
|
|
135
|
+
for (const sig of vibe_signals_1.VIBE_SIGNALS) {
|
|
136
|
+
let detected = false;
|
|
137
|
+
switch (sig.id) {
|
|
138
|
+
case 'language_hindi':
|
|
139
|
+
detected = /[अ-ह]|hinglish|hindi|kar\b|de\b|bata\b|hai\b/.test(allText);
|
|
140
|
+
break;
|
|
141
|
+
case 'language_english':
|
|
142
|
+
detected = !/[अ-ह]/.test(allText) && allText.length > 500;
|
|
143
|
+
break;
|
|
144
|
+
case 'language_mix_ratio':
|
|
145
|
+
const hc = (allText.match(/[अ-ह]|hinglish|hindi|kar\b|de\b|bata\b|hai\b/g) || []).length;
|
|
146
|
+
const ec = (allText.match(/[a-z]{3,}/g) || []).length;
|
|
147
|
+
detected = hc > 0 && ec > 0 && (hc / Math.max(ec, 1)) > 0.3;
|
|
148
|
+
break;
|
|
149
|
+
case 'structure_bullets':
|
|
150
|
+
detected = (allText.match(/^[-•*]\s|\d+[.)]\s/gm) || []).length > sessions.length * 2;
|
|
151
|
+
break;
|
|
152
|
+
case 'structure_paragraphs':
|
|
153
|
+
detected = allText.length / Math.max(sessions.length, 1) > 500;
|
|
154
|
+
break;
|
|
155
|
+
case 'tone_direct':
|
|
156
|
+
detected = /\b(kar|de|bata|fix|add|remove|create|delete|ship|launch)\b/.test(allText);
|
|
157
|
+
break;
|
|
158
|
+
case 'tone_formal':
|
|
159
|
+
detected = (allText.match(/\b(please|could you|would you|may i|kindly)\b/g) || []).length > 5;
|
|
160
|
+
break;
|
|
161
|
+
case 'verbosity_low':
|
|
162
|
+
detected = allText.length / Math.max(sessions.length, 1) < 300;
|
|
163
|
+
break;
|
|
164
|
+
case 'verbosity_high':
|
|
165
|
+
detected = allText.length / Math.max(sessions.length, 1) > 1500;
|
|
166
|
+
break;
|
|
167
|
+
case 'communication_cadence':
|
|
168
|
+
detected = sessions.length >= 3 && (allText.length / Math.max(sessions.length, 1)) < 400;
|
|
169
|
+
break;
|
|
170
|
+
case 'changes_minimal':
|
|
171
|
+
detected = /minimal|small change|patch|fix only|don't refactor|no rewrite/.test(allText);
|
|
172
|
+
break;
|
|
173
|
+
case 'changes_thorough':
|
|
174
|
+
detected = /rewrite|refactor entirely|full change|restructure/.test(allText);
|
|
175
|
+
break;
|
|
176
|
+
case 'change_size_from_diffs':
|
|
177
|
+
detected = /under 50 lines|small diff|minimal change|single file|one file|small patch/.test(allText);
|
|
178
|
+
break;
|
|
179
|
+
case 'abstraction_low':
|
|
180
|
+
detected = /keep flat|no abstraction|simple code|don't abstract|no util/.test(allText);
|
|
181
|
+
break;
|
|
182
|
+
case 'abstraction_high':
|
|
183
|
+
detected = /base class|abstract|interface|generic|util|helper/.test(allText);
|
|
184
|
+
break;
|
|
185
|
+
case 'abstraction_threshold':
|
|
186
|
+
detected = /duplication|dry after|third time|3rd occurrence|DRY/.test(allText) && allText.includes('abstraction');
|
|
187
|
+
break;
|
|
188
|
+
case 'testing_after':
|
|
189
|
+
detected = /code first|test later|write tests? after/.test(allText);
|
|
190
|
+
break;
|
|
191
|
+
case 'testing_first':
|
|
192
|
+
detected = /tdd|test first|write test|test-driven/.test(allText);
|
|
193
|
+
break;
|
|
194
|
+
case 'test_priority':
|
|
195
|
+
detected = /integration test|e2e|unit test|coverage|jest|vitest/.test(allText);
|
|
196
|
+
break;
|
|
197
|
+
case 'typescript_strict':
|
|
198
|
+
detected = /strict.*true|no any|explicit type|type safety/.test(allText);
|
|
199
|
+
break;
|
|
200
|
+
case 'typescript_loose':
|
|
201
|
+
detected = /any type|as cast|ts-ignore|skip check/.test(allText);
|
|
202
|
+
break;
|
|
203
|
+
case 'functional_style':
|
|
204
|
+
detected = /map|filter|reduce|immutable|pure function|const|arrow/.test(allText);
|
|
205
|
+
break;
|
|
206
|
+
case 'oop_style':
|
|
207
|
+
detected = /class |extends|implements|private|public|protected/.test(allText);
|
|
208
|
+
break;
|
|
209
|
+
case 'naming_philosophy':
|
|
210
|
+
detected = /short name|descriptive|domain language|single word|clear name/.test(allText);
|
|
211
|
+
break;
|
|
212
|
+
case 'audit_first':
|
|
213
|
+
detected = /audit|analyze|scan|review|understand first|check first/.test(allText);
|
|
214
|
+
break;
|
|
215
|
+
case 'code_first':
|
|
216
|
+
detected = /just build|start coding|implement now|bana de|seedha code/.test(allText);
|
|
217
|
+
break;
|
|
218
|
+
case 'workflow_sequence':
|
|
219
|
+
detected = allText.includes('audit') && allText.includes('plan') && (allText.includes('code') || allText.includes('implement'));
|
|
220
|
+
break;
|
|
221
|
+
case 'plan_phased':
|
|
222
|
+
detected = /phase|step by step|roadmap|plan first|milestone|iteration/.test(allText);
|
|
223
|
+
break;
|
|
224
|
+
case 'plan_single_shot':
|
|
225
|
+
detected = /everything at once|all together|ek sath|pura ek bar/.test(allText);
|
|
226
|
+
break;
|
|
227
|
+
case 'task_list_mode':
|
|
228
|
+
detected = /list banao|list bana|sab khatam|get them all done|task list|checklist/.test(allText);
|
|
229
|
+
break;
|
|
230
|
+
case 'focus_mode':
|
|
231
|
+
detected = /sirf ye|just that one|ek hi kaam|single focus|only this/.test(allText);
|
|
232
|
+
break;
|
|
233
|
+
case 'overnight_mode':
|
|
234
|
+
detected = /raat bhar|subah tak|overnight|subah report|crack on|going to bed|sleep/.test(allText);
|
|
235
|
+
break;
|
|
236
|
+
case 'ship_fast':
|
|
237
|
+
detected = /good enough|launch kar|ship it|mvp|80%|working hai|release now/.test(allText);
|
|
238
|
+
break;
|
|
239
|
+
case 'session_time_pattern':
|
|
240
|
+
const hrs = sessions.map((s) => s.start_time ? new Date(s.start_time).getHours() : -1).filter((h) => h >= 0);
|
|
241
|
+
const nc = hrs.filter((h) => h >= 20 || h <= 4).length;
|
|
242
|
+
const mc = hrs.filter((h) => h >= 5 && h <= 11).length;
|
|
243
|
+
detected = sessions.length >= 3 && (nc > mc * 2 || mc > nc * 2);
|
|
244
|
+
break;
|
|
245
|
+
case 'deadline_behavior':
|
|
246
|
+
detected = /deadline|urgent|asap|time is tight|rush|fast/.test(allText) && /ship|launch|release|deploy/.test(allText);
|
|
247
|
+
break;
|
|
248
|
+
case 'completion_discipline':
|
|
249
|
+
detected = deepAnalysisData.totalApproaches > 0 && (deepAnalysisData.accepted + deepAnalysisData.rejected) > deepAnalysisData.tried;
|
|
250
|
+
break;
|
|
251
|
+
case 'roi_first':
|
|
252
|
+
detected = /revenue|paisa|monetize|customer pays|profit|business value|making money/.test(allText);
|
|
253
|
+
break;
|
|
254
|
+
case 'ux_first':
|
|
255
|
+
detected = /user experience|ux|design|flow|usability|user friendly|ui/.test(allText);
|
|
256
|
+
break;
|
|
257
|
+
case 'tech_first':
|
|
258
|
+
detected = /architecture|performance|scale|clean code|best practice|properly/.test(allText);
|
|
259
|
+
break;
|
|
260
|
+
case 'decision_argument_type':
|
|
261
|
+
const ar = (allText.match(/revenue|paisa|profit|money|business/g) || []).length;
|
|
262
|
+
const au = (allText.match(/user experience|ux|design|flow|usability/g) || []).length;
|
|
263
|
+
const at = (allText.match(/performance|scale|architecture|clean/g) || []).length;
|
|
264
|
+
detected = Math.max(ar, au, at) > 3;
|
|
265
|
+
break;
|
|
266
|
+
case 'speed_over_quality':
|
|
267
|
+
detected = /deadline|urgent|asap|quick fix|fast|time pressure/.test(allText);
|
|
268
|
+
break;
|
|
269
|
+
case 'quality_over_speed':
|
|
270
|
+
detected = /properly|production ready|thoroughly|well tested|solid|resilient/.test(allText);
|
|
271
|
+
break;
|
|
272
|
+
case 'stick_to_known':
|
|
273
|
+
detected = /same setup|known stack|familiar|tried and tested|proven/.test(allText);
|
|
274
|
+
break;
|
|
275
|
+
case 'explore_new':
|
|
276
|
+
detected = /new framework|try new|experiment|latest|bleeding edge|cutting edge/.test(allText);
|
|
277
|
+
break;
|
|
278
|
+
case 'monetization_thinking':
|
|
279
|
+
detected = /monetize|pricing|revenue|paid|subscription|tier|freemium/.test(allText);
|
|
280
|
+
break;
|
|
281
|
+
case 'growth_strategy':
|
|
282
|
+
detected = /community|viral|organic|ads|marketing|github stars|growth/.test(allText);
|
|
283
|
+
break;
|
|
284
|
+
case 'user_focus':
|
|
285
|
+
detected = /power user|enterprise|casual|developer|end user/.test(allText);
|
|
286
|
+
break;
|
|
287
|
+
case 'trust_high':
|
|
288
|
+
detected = /accepted|good output|works perfectly|no changes needed/.test(allText);
|
|
289
|
+
break;
|
|
290
|
+
case 'trust_low':
|
|
291
|
+
detected = /verify|test karo|check|make sure|confirm|validate|double check/.test(allText);
|
|
292
|
+
break;
|
|
293
|
+
case 'acceptance_pattern':
|
|
294
|
+
detected = deepAnalysisData.totalApproaches >= 5 && (deepAnalysisData.accepted / deepAnalysisData.totalApproaches > 0.7 || deepAnalysisData.rejected / deepAnalysisData.totalApproaches > 0.5);
|
|
295
|
+
break;
|
|
296
|
+
case 'iterative_prompter':
|
|
297
|
+
detected = /edit|refine|modify|improve|tweak|update the|change that|redo/.test(allText);
|
|
298
|
+
break;
|
|
299
|
+
case 'prompt_iteration_count':
|
|
300
|
+
detected = deepAnalysisData.totalApproaches >= 5 && deepAnalysisData.tried > deepAnalysisData.accepted;
|
|
301
|
+
break;
|
|
302
|
+
case 'one_shot_user':
|
|
303
|
+
detected = sessions.length > 0 && allText.length / sessions.length < 200;
|
|
304
|
+
break;
|
|
305
|
+
case 'verify_always':
|
|
306
|
+
detected = (allText.match(/\b(verify|test karo|check|make sure|confirm|validate)\b/g) || []).length > 5;
|
|
307
|
+
break;
|
|
308
|
+
case 'edit_accepted_code':
|
|
309
|
+
detected = /modify output|tweak|adjust the code|change .* implementation/.test(allText);
|
|
310
|
+
break;
|
|
311
|
+
case 'output_modification_pattern':
|
|
312
|
+
detected = /modify|adjust|tweak|change that|update the|fix the|rework/.test(allText) && deepAnalysisData.accepted > 0;
|
|
313
|
+
break;
|
|
314
|
+
case 'model_switcher':
|
|
315
|
+
detected = /claude|gpt|gemini|sonar|copilot|codex|windsurf|cursor/.test(allText);
|
|
316
|
+
break;
|
|
317
|
+
case 'feedback_specificity':
|
|
318
|
+
detected = deepAnalysisData.approachTexts.length > 500 && (deepAnalysisData.approachTexts.match(/\b(because|due to|since|as the|should|instead of)\b/g) || []).length > 3;
|
|
319
|
+
break;
|
|
320
|
+
case 'prompt_complexity':
|
|
321
|
+
detected = allText.split(/[.!?]\s/).length / Math.max(sessions.length, 1) > 8;
|
|
322
|
+
break;
|
|
323
|
+
case 'exploration_bias':
|
|
324
|
+
try {
|
|
325
|
+
const d2 = (0, database_1.getDb)();
|
|
326
|
+
const pc = d2.prepare('SELECT COUNT(*) as c FROM projects').get()?.c || 1;
|
|
327
|
+
const cc = events.filter((e) => e.type === 'verification' && /complete|done|finished|launched/.test(e.summary || '')).length;
|
|
328
|
+
detected = pc > cc * 2;
|
|
329
|
+
}
|
|
330
|
+
catch {
|
|
331
|
+
detected = false;
|
|
332
|
+
}
|
|
333
|
+
break;
|
|
334
|
+
case 'completion_focused':
|
|
335
|
+
try {
|
|
336
|
+
const d2 = (0, database_1.getDb)();
|
|
337
|
+
const pc = d2.prepare('SELECT COUNT(*) as c FROM projects').get()?.c || 1;
|
|
338
|
+
const dc = events.filter((e) => e.type === 'verification' && /complete|done|finished|launched/.test(e.summary || '')).length;
|
|
339
|
+
detected = dc > 0 && pc <= dc + 2;
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
detected = false;
|
|
343
|
+
}
|
|
344
|
+
break;
|
|
345
|
+
case 'completion_rate':
|
|
346
|
+
detected = deepAnalysisData.totalApproaches > 10 && deepAnalysisData.tried < deepAnalysisData.accepted + deepAnalysisData.rejected;
|
|
347
|
+
break;
|
|
348
|
+
case 'scope_creep':
|
|
349
|
+
detected = /also add|and also|while we're at|might as well|ek aur|1 more thing/.test(allText);
|
|
350
|
+
break;
|
|
351
|
+
case 'scope_disciplined':
|
|
352
|
+
detected = /sticking to|on task|focused|only this|nothing else|bas itna/.test(allText);
|
|
353
|
+
break;
|
|
354
|
+
case 'solo_developer':
|
|
355
|
+
detected = sessions.length > 0 && allText.length > 0 && !/team|pair|collaborate|review my pr/.test(allText);
|
|
356
|
+
break;
|
|
357
|
+
case 'team_player':
|
|
358
|
+
detected = /team|pair programming|collaborate|review|standup|sprint|pr review/.test(allText);
|
|
359
|
+
break;
|
|
360
|
+
case 'refactor_trigger':
|
|
361
|
+
detected = /bug|fix|broken|error/.test(allText) && /refactor|rewrite|restructure/.test(allText);
|
|
362
|
+
break;
|
|
363
|
+
case 'commit_small':
|
|
364
|
+
detected = /small commit|atomic|single change|one thing|single file/.test(allText);
|
|
365
|
+
break;
|
|
366
|
+
case 'commit_large':
|
|
367
|
+
detected = /big commit|squash|merge everything|all changes/.test(allText);
|
|
368
|
+
break;
|
|
369
|
+
case 'docs_writer':
|
|
370
|
+
detected = /readme|documentation|docs|comment|wiki|guide|explanation/.test(allText);
|
|
371
|
+
break;
|
|
372
|
+
case 'docs_skipper':
|
|
373
|
+
detected = !/readme|documentation|docs|comment|wiki/.test(allText) && allText.length > 1000;
|
|
374
|
+
break;
|
|
375
|
+
case 'documentation_style':
|
|
376
|
+
detected = /README|documentation|docs|comment|JSDoc|wiki/.test(allText);
|
|
377
|
+
break;
|
|
378
|
+
case 'review_style':
|
|
379
|
+
detected = /nitpick|minor|approve|LGTM|ship it|looks good/.test(allText);
|
|
380
|
+
break;
|
|
381
|
+
case 'error_response_pattern':
|
|
382
|
+
detected = /fix immediately|fix now|quick fix|hotfix|patch/.test(allText) || /log and|note and|track and|later/.test(allText);
|
|
383
|
+
break;
|
|
384
|
+
case 'dependency_attitude':
|
|
385
|
+
detected = /no dependency|zero dep|add dep|new package|npm install|new library/.test(allText);
|
|
386
|
+
break;
|
|
387
|
+
case 'stack_loyalty':
|
|
388
|
+
detected = /same stack|consistent|tried and tested|proven|familiar/.test(allText) || /new framework|try something new|different/.test(allText);
|
|
389
|
+
break;
|
|
390
|
+
case 'learning_approach':
|
|
391
|
+
detected = /deep dive|source code|understand|learn|tutorial|guide|docs/.test(allText);
|
|
392
|
+
break;
|
|
393
|
+
case 'ui_preference_dark':
|
|
394
|
+
detected = /dark mode|dark theme|dark ui|dark background|never light/.test(allText);
|
|
395
|
+
break;
|
|
396
|
+
case 'ui_preference_minimal':
|
|
397
|
+
detected = /minimalist|minimal|simple|clean|no clutter|single column|fewer/.test(allText);
|
|
398
|
+
break;
|
|
399
|
+
case 'design_philosophy':
|
|
400
|
+
detected = /function over form|ugly.*fast|fast.*ugly|form over function|pretty|beautiful/.test(allText);
|
|
401
|
+
break;
|
|
402
|
+
case 'frustration_signal':
|
|
403
|
+
detected = /[!]{2,}|are yaar|yaar|damn|pagal|gussa|frustrat|what the|bc\b/i.test(allText);
|
|
404
|
+
break;
|
|
405
|
+
case 'correction_style':
|
|
406
|
+
detected = /galat hai|ye galat|nahi chahiye|dont do|stop that|mat kar|never do/i.test(allText);
|
|
407
|
+
break;
|
|
408
|
+
case 'satisfaction_signal':
|
|
409
|
+
detected = /sahi hai|perfect|bas yahi|exactly|correct|spot on|finally|thats it|acha hai/i.test(allText);
|
|
410
|
+
break;
|
|
411
|
+
case 'urgency_detection':
|
|
412
|
+
detected = /jaldi kar|jaldi se|fast|abhi karo|time nahi|asap|rush|urgent|hurry|jaldi/i.test(allText);
|
|
413
|
+
break;
|
|
414
|
+
case 'patience_level':
|
|
415
|
+
detected = deepAnalysisData.tried > deepAnalysisData.rejected && deepAnalysisData.tried > 2;
|
|
416
|
+
break;
|
|
417
|
+
case 'appreciation_style':
|
|
418
|
+
detected = /thanks|thank you|good job|great|nice work|awesome|accha|badhiya/i.test(allText);
|
|
419
|
+
break;
|
|
420
|
+
case 'thinking_aloud':
|
|
421
|
+
detected = /soch raha|let me think|hmm|wait|actually|i think|mujhe lagta|lagna/i.test(allText);
|
|
422
|
+
break;
|
|
423
|
+
case 'example_request_style':
|
|
424
|
+
detected = /example de|dikha|dikhao|samjha|samjhao|show me|example|give me example/i.test(allText);
|
|
425
|
+
break;
|
|
426
|
+
case 'comparison_style':
|
|
427
|
+
detected = /vs\.?|compared|better way|faster way|alternative|which one|difference between/i.test(allText);
|
|
428
|
+
break;
|
|
429
|
+
case 'certainty_language':
|
|
430
|
+
detected = /pakka|definitely|100%|absolutely|sure|for sure|shayad|maybe|ho sakta|might be|probably|not sure/i.test(allText);
|
|
431
|
+
break;
|
|
432
|
+
case 'ownership_language':
|
|
433
|
+
const oc = (allText.match(/maine\b|main\s+ne|mera\b/i) || []).length;
|
|
434
|
+
const wc = (allText.match(/hum\b|we\b|hamara\b/i) || []).length;
|
|
435
|
+
detected = oc > 3 || wc > 3;
|
|
436
|
+
break;
|
|
437
|
+
case 'pattern_recognition_skill':
|
|
438
|
+
detected = /pichli baar|last time|remember|jaise pahle|similar|same pattern|kabhi kiya/i.test(allText);
|
|
439
|
+
break;
|
|
440
|
+
case 'architecture_question_depth':
|
|
441
|
+
const wc2 = (allText.match(/kyun\b|why\b|reason|what if|what about/i) || []).length;
|
|
442
|
+
const hc2 = (allText.match(/kaise\b|how\b|karo|banao|create/i) || []).length;
|
|
443
|
+
detected = wc2 > 2 || hc2 > 5;
|
|
444
|
+
break;
|
|
445
|
+
case 'refactoring_motivation':
|
|
446
|
+
detected = (/refactor|rewrite|restructure/i.test(allText) && (/clean|performance|bug|fix|slow|ugly/i.test(allText)));
|
|
447
|
+
break;
|
|
448
|
+
case 'tech_curiosity':
|
|
449
|
+
detected = /try karte|try karo|explore|naya|latest|new tech|what about|check out|dekhte/i.test(allText);
|
|
450
|
+
break;
|
|
451
|
+
case 'simplicity_bias':
|
|
452
|
+
detected = /simple\b|easy\b|seedha\b|straightforward\b|minimal\b|no complexity|keep it simple/i.test(allText);
|
|
453
|
+
break;
|
|
454
|
+
case 'context_switch_frequency':
|
|
455
|
+
detected = deepAnalysisData.totalApproaches > 5 && deepAnalysisData.totalApproaches < 15;
|
|
456
|
+
break;
|
|
457
|
+
case 'deep_work_detection':
|
|
458
|
+
detected = sessions.length === 1 && deepAnalysisData.totalApproaches >= 3 && allText.length > 500;
|
|
459
|
+
break;
|
|
460
|
+
case 'break_pattern':
|
|
461
|
+
detected = sessions.length >= 2;
|
|
462
|
+
break;
|
|
463
|
+
case 'task_chaining':
|
|
464
|
+
detected = /ab ye|next\b|after this|fir\b|then\b|now this|ab ise|uske baad/i.test(allText);
|
|
465
|
+
break;
|
|
466
|
+
default: detected = false;
|
|
467
|
+
}
|
|
468
|
+
const existing = signalMap.get(sig.id);
|
|
469
|
+
const count = detected ? (existing?.count || 0) + 1 : (existing?.count || 0);
|
|
470
|
+
const vibe = (0, vibe_confidence_1.evolveVibe)(existing?.vibe || 0, detected, count, totalSessions, sig.multiplier);
|
|
471
|
+
signalMap.set(sig.id, { id: sig.id, group: sig.group, category: sig.category, count, vibe, firstSeen: existing?.firstSeen || (detected ? now : ''), lastSeen: detected ? now : existing?.lastSeen || '' });
|
|
472
|
+
}
|
|
473
|
+
return [...signalMap.values()].sort((a, b) => b.vibe - a.vibe);
|
|
474
|
+
}
|
|
475
|
+
function generateVibeRules(signals) {
|
|
476
|
+
const tmpl = {
|
|
477
|
+
language_hindi: (s) => `Hinglish preferred — Hindi explanations, English code, mixed casually. Vibe: ${s.vibe}`, language_english: (s) => `English only communication. Code and explanations both in English. Vibe: ${s.vibe}`, structure_bullets: (s) => `Bullet points over paragraphs. Max 3 lines per bullet. Vibe: ${s.vibe}`, structure_paragraphs: (s) => `Detailed paragraphs preferred. Vibe: ${s.vibe}`, tone_direct: (s) => `Seedha bolo, no sugar-coating. Direct imperatives over polite requests. Vibe: ${s.vibe}`, tone_formal: (s) => `Formal, polite communication preferred. Vibe: ${s.vibe}`, verbosity_low: (s) => `Short answers only. Explain only when explicitly asked. Vibe: ${s.vibe}`, verbosity_high: (s) => `Detailed, thorough explanations expected with every answer. Vibe: ${s.vibe}`,
|
|
478
|
+
changes_minimal: (s) => `Changes must be minimal — diff under 50 lines. Never propose full rewrites. Vibe: ${s.vibe}`, changes_thorough: (s) => `Full rewrites accepted. Large-scope changes preferred over patches. Vibe: ${s.vibe}`, abstraction_low: (s) => `Keep code flat. No abstraction until 3rd duplication. Vibe: ${s.vibe}`, abstraction_high: (s) => `Well-abstracted code. Use interfaces, base classes, utils. Vibe: ${s.vibe}`, testing_after: (s) => `Code first, tests after. Integration tests over unit tests. Vibe: ${s.vibe}`, testing_first: (s) => `TDD approach. Write tests before implementation. Vibe: ${s.vibe}`, typescript_strict: (s) => `TypeScript strict mode always. any only with documented reason. Vibe: ${s.vibe}`,
|
|
479
|
+
ship_fast: (s) => `Ship at 80%. Polish is infinite, shipping is finite. Good enough beats perfect. Vibe: ${s.vibe}`, audit_first: (s) => `Always audit before code: scan → understand → plan → implement. Vibe: ${s.vibe}`, roi_first: (s) => `Revenue-first decision making. Ask "kya paisa dega?" before any feature. Vibe: ${s.vibe}`, trust_low: (s) => `Verify everything. Never accept first AI output without testing. Vibe: ${s.vibe}`, trust_high: (s) => `High trust in AI output. Accepts suggestions readily. Vibe: ${s.vibe}`, iterative_prompter: (s) => `Iterative refiner. Edits prompts 3-5 times until exact result. Vibe: ${s.vibe}`, exploration_bias: (s) => `Starts many projects. Exploration over completion. Vibe: ${s.vibe}`, completion_focused: (s) => `Finishes projects before starting new ones. Completion-driven. Vibe: ${s.vibe}`, commit_small: (s) => `Small atomic commits. Present tense. Each commit does exactly one thing. Vibe: ${s.vibe}`, solo_developer: (s) => `Solo developer. Works independently. Full ownership. Vibe: ${s.vibe}`, team_player: (s) => `Team player. Collaborates, reviews PRs, pairs frequently. Vibe: ${s.vibe}`, overnight_mode: (s) => `Autonomous overnight mode active. Vibe: ${s.vibe}`, focus_mode: (s) => `Single focus mode — one task at a time, strict scope. Vibe: ${s.vibe}`, task_list_mode: (s) => `Task list mode — create checklist, work through systematically. Vibe: ${s.vibe}`, scope_creep: (s) => `Scope creep tendency — expands features during implementation. Vibe: ${s.vibe}`, docs_writer: (s) => `Documentation writer. READMEs, comments, wikis well-maintained. Vibe: ${s.vibe}`, verify_always: (s) => `Always verifies. Runs tests after every change. Vibe: ${s.vibe}`,
|
|
480
|
+
language_mix_ratio: (s) => `Mixed language communication — Hinglish pattern. Vibe: ${s.vibe}`, change_size_from_diffs: (s) => `Small, focused code changes — single files, minimal diffs. Vibe: ${s.vibe}`, test_priority: (s) => `Testing-aware developer — actively tracks coverage. Vibe: ${s.vibe}`, workflow_sequence: (s) => `Structured workflow: audit → plan → implement. Vibe: ${s.vibe}`, deadline_behavior: (s) => `Deadline-driven — shifts to speed mode under time pressure. Vibe: ${s.vibe}`, completion_discipline: (s) => `Completes what is started — high session resolution rate. Vibe: ${s.vibe}`, decision_argument_type: (s) => `Uses multiple argument types — balanced thinking. Vibe: ${s.vibe}`, monetization_thinking: (s) => `Business-aware — thinks about monetization in technical decisions. Vibe: ${s.vibe}`, acceptance_pattern: (s) => `Distinct AI acceptance pattern. Vibe: ${s.vibe}`, prompt_iteration_count: (s) => `Iterative prompter — refines through multiple edits. Vibe: ${s.vibe}`, output_modification_pattern: (s) => `Always enhances AI output. Vibe: ${s.vibe}`, feedback_specificity: (s) => `Detailed feedback giver — specific, actionable rejection reasons. Vibe: ${s.vibe}`, completion_rate: (s) => `High task completion rate. Vibe: ${s.vibe}`, refactor_trigger: (s) => `Bug-driven refactorer — changes structure when bugs force it. Vibe: ${s.vibe}`, documentation_style: (s) => `Documentation-conscious. Vibe: ${s.vibe}`, error_response_pattern: (s) => `Immediate error responder — fixes bugs quickly. Vibe: ${s.vibe}`, ui_preference_dark: (s) => `Dark mode devotee. Vibe: ${s.vibe}`, ui_preference_minimal: (s) => `Minimalist aesthetic. Vibe: ${s.vibe}`, design_philosophy: (s) => `Function-first designer. Vibe: ${s.vibe}`,
|
|
481
|
+
frustration_signal: (s) => `Shows frustration directly — uses strong language when things go wrong. Vibe: ${s.vibe}`, correction_style: (s) => `Direct corrector — gives blunt, undiplomatic feedback. Vibe: ${s.vibe}`, satisfaction_signal: (s) => `Expresses satisfaction — gives clear positive signals. Vibe: ${s.vibe}`, urgency_detection: (s) => `Urgency-aware — frequently operates under time pressure. Vibe: ${s.vibe}`, patience_level: (s) => `Patient iterater — refines through edits rather than immediately rejecting. Vibe: ${s.vibe}`, appreciation_style: (s) => `Expresses appreciation — acknowledges good work. Vibe: ${s.vibe}`, thinking_aloud: (s) => `Visible thinker — shares thought process openly. Vibe: ${s.vibe}`, example_request_style: (s) => `Example-driven learner — prefers concrete examples. Vibe: ${s.vibe}`, comparison_style: (s) => `Comparison-driven — evaluates by comparing alternatives. Vibe: ${s.vibe}`, certainty_language: (s) => `Uses certainty markers — expresses confidence through language. Vibe: ${s.vibe}`, ownership_language: (s) => `Distinct ownership voice. Vibe: ${s.vibe}`, pattern_recognition_skill: (s) => `Pattern-aware — references past experiences. Vibe: ${s.vibe}`, architecture_question_depth: (s) => `Deep questioner — asks why, not just how. Vibe: ${s.vibe}`, refactoring_motivation: (s) => `Purposeful refactorer — specific motivation behind changes. Vibe: ${s.vibe}`, tech_curiosity: (s) => `Tech-curious — explores new technologies. Vibe: ${s.vibe}`, simplicity_bias: (s) => `Simplicity-first — values simple solutions. Vibe: ${s.vibe}`, context_switch_frequency: (s) => `Moderate context switcher. Vibe: ${s.vibe}`, deep_work_detection: (s) => `Deep worker — capable of long focused sessions. Vibe: ${s.vibe}`, task_chaining: (s) => `Sequential planner — chains tasks together. Vibe: ${s.vibe}`,
|
|
482
|
+
};
|
|
483
|
+
const rules = [];
|
|
484
|
+
for (const s of signals) {
|
|
485
|
+
if (!(0, vibe_confidence_1.shouldWriteToFile)(s.vibe))
|
|
486
|
+
continue;
|
|
487
|
+
const t = tmpl[s.id];
|
|
488
|
+
if (t)
|
|
489
|
+
rules.push({ text: t(s), category: s.category, vibe: s.vibe, count: s.count, level: (0, vibe_confidence_1.getVibeLevel)(s.vibe) });
|
|
490
|
+
}
|
|
491
|
+
return rules.sort((a, b) => b.vibe - a.vibe);
|
|
492
|
+
}
|
|
493
|
+
function buildVibeSummary(signals, rules) {
|
|
494
|
+
const sigMap = new Map(signals.map(s => [s.id, s]));
|
|
495
|
+
const g = (id) => sigMap.get(id)?.vibe ?? 0;
|
|
496
|
+
const comm = {};
|
|
497
|
+
if (g('language_hindi') >= 65)
|
|
498
|
+
comm.language = 'hinglish';
|
|
499
|
+
else if (g('language_english') >= 65)
|
|
500
|
+
comm.language = 'english';
|
|
501
|
+
if (g('structure_bullets') >= 65)
|
|
502
|
+
comm.structure = 'bullets';
|
|
503
|
+
if (g('tone_direct') >= 65)
|
|
504
|
+
comm.tone = 'direct';
|
|
505
|
+
if (g('verbosity_low') >= 65)
|
|
506
|
+
comm.verbosity = 'low';
|
|
507
|
+
const coding = {};
|
|
508
|
+
if (g('changes_minimal') >= 65)
|
|
509
|
+
coding.changeSize = 'minimal';
|
|
510
|
+
if (g('abstraction_low') >= 65)
|
|
511
|
+
coding.abstraction = 'low';
|
|
512
|
+
if (g('testing_after') >= 65)
|
|
513
|
+
coding.testing = 'after-code';
|
|
514
|
+
if (g('typescript_strict') >= 65)
|
|
515
|
+
coding.typescript = 'strict';
|
|
516
|
+
let decisionDriver = 'balanced';
|
|
517
|
+
if (g('roi_first') >= 65)
|
|
518
|
+
decisionDriver = 'roi';
|
|
519
|
+
else if (g('ux_first') >= 65)
|
|
520
|
+
decisionDriver = 'ux';
|
|
521
|
+
else if (g('tech_first') >= 65)
|
|
522
|
+
decisionDriver = 'tech';
|
|
523
|
+
let uiPreference = 'unknown';
|
|
524
|
+
if (g('ui_preference_dark') >= 65)
|
|
525
|
+
uiPreference = 'dark';
|
|
526
|
+
let shipStyle = 'balanced';
|
|
527
|
+
if (g('ship_fast') >= 65)
|
|
528
|
+
shipStyle = 'fast';
|
|
529
|
+
let aiTrust = 'balanced';
|
|
530
|
+
if (g('trust_low') >= 65 || g('verify_always') >= 65)
|
|
531
|
+
aiTrust = 'verify_always';
|
|
532
|
+
else if (g('trust_high') >= 65)
|
|
533
|
+
aiTrust = 'high';
|
|
534
|
+
const strengths = [];
|
|
535
|
+
if (g('audit_first') >= 65)
|
|
536
|
+
strengths.push('Systematic auditor');
|
|
537
|
+
if (g('ship_fast') >= 65)
|
|
538
|
+
strengths.push('Fast shipper');
|
|
539
|
+
if (g('tone_direct') >= 65)
|
|
540
|
+
strengths.push('Direct communicator');
|
|
541
|
+
if (g('commit_small') >= 65)
|
|
542
|
+
strengths.push('Clean git hygiene');
|
|
543
|
+
if (g('completion_focused') >= 65)
|
|
544
|
+
strengths.push('Completion driven');
|
|
545
|
+
if (g('simplicity_bias') >= 65)
|
|
546
|
+
strengths.push('Simplicity advocate');
|
|
547
|
+
if (g('deep_work_detection') >= 65)
|
|
548
|
+
strengths.push('Deep focus capability');
|
|
549
|
+
const risks = (0, vibe_confidence_1.detectRisks)(signals);
|
|
550
|
+
if (g('exploration_bias') >= 65)
|
|
551
|
+
risks.push('Exploration bias — starts more than finishes');
|
|
552
|
+
if (g('scope_creep') >= 65)
|
|
553
|
+
risks.push('Scope creep — features expand during work');
|
|
554
|
+
if (g('frustration_signal') >= 65)
|
|
555
|
+
risks.push('Frustration under pressure — communication may intensify');
|
|
556
|
+
const avoid = [];
|
|
557
|
+
if (g('changes_minimal') >= 65)
|
|
558
|
+
avoid.push('Large rewrites');
|
|
559
|
+
if (g('abstraction_low') >= 65)
|
|
560
|
+
avoid.push('Over-abstraction');
|
|
561
|
+
if (g('tone_direct') >= 65)
|
|
562
|
+
avoid.push('Corporate/formal language');
|
|
563
|
+
if (g('language_hindi') >= 65)
|
|
564
|
+
avoid.push('Pure English responses');
|
|
565
|
+
if (g('simplicity_bias') >= 65)
|
|
566
|
+
avoid.push('Over-engineering');
|
|
567
|
+
let bestWorkflow = 'Standard workflow';
|
|
568
|
+
if (g('audit_first') >= 65 && g('ship_fast') >= 65)
|
|
569
|
+
bestWorkflow = 'Audit → phased plan → incremental delivery → ship at 80%';
|
|
570
|
+
else if (g('audit_first') >= 65)
|
|
571
|
+
bestWorkflow = 'Audit → plan → thorough implementation';
|
|
572
|
+
else if (g('ship_fast') >= 65)
|
|
573
|
+
bestWorkflow = 'Build fast → test → ship';
|
|
574
|
+
let riskProfile = 'medium';
|
|
575
|
+
if (g('ship_fast') >= 65 && g('speed_over_quality') >= 60)
|
|
576
|
+
riskProfile = 'high';
|
|
577
|
+
else if (g('quality_over_speed') >= 65)
|
|
578
|
+
riskProfile = 'low';
|
|
579
|
+
const catAvgs = [];
|
|
580
|
+
for (const cat of (0, vibe_signals_1.getAllCategories)()) {
|
|
581
|
+
const cs = signals.filter(s => s.category === cat);
|
|
582
|
+
const a = (0, vibe_confidence_1.categoryVibeAverage)(cs);
|
|
583
|
+
if (a > 0)
|
|
584
|
+
catAvgs.push({ cat, avg: a });
|
|
585
|
+
}
|
|
586
|
+
const topCats = catAvgs.sort((a, b) => b.avg - a.avg).slice(0, 5).map(c => c.cat);
|
|
587
|
+
const sp = [];
|
|
588
|
+
if (decisionDriver === 'roi')
|
|
589
|
+
sp.push('ROI-driven');
|
|
590
|
+
if (decisionDriver === 'ux')
|
|
591
|
+
sp.push('UX-focused');
|
|
592
|
+
if (shipStyle === 'fast')
|
|
593
|
+
sp.push('ships fast');
|
|
594
|
+
if (comm.language === 'hinglish')
|
|
595
|
+
sp.push('Hinglish communicator');
|
|
596
|
+
if (aiTrust === 'verify_always')
|
|
597
|
+
sp.push('verification-obsessed');
|
|
598
|
+
const summary = sp.length > 0 ? sp.join(', ') + '.' : 'Style still learning.';
|
|
599
|
+
return { summary, strengths: strengths.length > 0 ? strengths : ['Still discovering strengths'], risks: risks.length > 0 ? risks : ['No risks detected yet'], bestWorkflow, avoid: avoid.length > 0 ? avoid : ['Nothing specific yet'], communication: comm, coding, decisionDriver, riskProfile, uiPreference, shipStyle, aiTrust, totalRules: rules.length, averageVibe: Math.round(signals.reduce((acc, s) => acc + s.vibe, 0) / Math.max(signals.length, 1)), topCategories: topCats };
|
|
600
|
+
}
|
|
601
|
+
function writeSignalsJson(projectDir, data) { ensureVibeDir(projectDir); fs.writeFileSync(path.join(getVibeDir(projectDir), 'signals.json'), JSON.stringify(data, null, 2), 'utf-8'); }
|
|
602
|
+
function writeVibeMarkdown(projectDir, data) {
|
|
603
|
+
ensureVibeDir(projectDir);
|
|
604
|
+
const lines = ['# Cell Vibe — Your Developer Personality\n', `*Learned from ${data.sessionsAnalyzed} sessions. Last updated: ${data.lastUpdated}*\n`];
|
|
605
|
+
if (data.identitySummary) {
|
|
606
|
+
lines.push(`## 🔮 Identity`);
|
|
607
|
+
lines.push('');
|
|
608
|
+
lines.push(data.identitySummary);
|
|
609
|
+
lines.push('');
|
|
610
|
+
}
|
|
611
|
+
const byCat = new Map();
|
|
612
|
+
for (const r of data.rules) {
|
|
613
|
+
const e = byCat.get(r.category) || [];
|
|
614
|
+
e.push(r);
|
|
615
|
+
byCat.set(r.category, e);
|
|
616
|
+
}
|
|
617
|
+
for (const [cat, rules] of byCat) {
|
|
618
|
+
lines.push(`## ${cat}\n`);
|
|
619
|
+
for (const r of rules.sort((a, b) => b.vibe - a.vibe))
|
|
620
|
+
lines.push(`- ${r.text}`);
|
|
621
|
+
lines.push('');
|
|
622
|
+
}
|
|
623
|
+
if (data.insights && data.insights.length > 0) {
|
|
624
|
+
lines.push('## 🧬 Deep Insights');
|
|
625
|
+
lines.push('');
|
|
626
|
+
for (const i of data.insights.slice(0, 5))
|
|
627
|
+
lines.push(`- ${i.text} (${i.confidence}/100)`);
|
|
628
|
+
lines.push('');
|
|
629
|
+
}
|
|
630
|
+
if (data.aiGuide) {
|
|
631
|
+
lines.push('## 🤖 AI Guide — How To Work With This Developer');
|
|
632
|
+
lines.push('');
|
|
633
|
+
lines.push(data.aiGuide);
|
|
634
|
+
lines.push('');
|
|
635
|
+
}
|
|
636
|
+
fs.writeFileSync(path.join(getVibeDir(projectDir), 'vibe.md'), lines.join('\n'), 'utf-8');
|
|
637
|
+
}
|
|
638
|
+
function writeVibeSummary(projectDir, data) { ensureVibeDir(projectDir); const s = buildVibeSummary(data.signals, data.rules); if (data.identitySummary)
|
|
639
|
+
s.summary = data.identitySummary; fs.writeFileSync(path.join(getVibeDir(projectDir), 'vibe-summary.json'), JSON.stringify(s, null, 2), 'utf-8'); }
|
|
640
|
+
function getVibeData(projectDir) { try {
|
|
641
|
+
const p = path.join(getVibeDir(projectDir), 'signals.json');
|
|
642
|
+
if (!fs.existsSync(p))
|
|
643
|
+
return null;
|
|
644
|
+
return JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
645
|
+
}
|
|
646
|
+
catch {
|
|
647
|
+
return null;
|
|
648
|
+
} }
|
|
649
|
+
function getVibeSummary(projectDir) { try {
|
|
650
|
+
const p = path.join(getVibeDir(projectDir), 'vibe-summary.json');
|
|
651
|
+
if (!fs.existsSync(p))
|
|
652
|
+
return null;
|
|
653
|
+
return JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
654
|
+
}
|
|
655
|
+
catch {
|
|
656
|
+
return null;
|
|
657
|
+
} }
|
|
658
|
+
function getVibeMarkdown(projectDir) { try {
|
|
659
|
+
const p = path.join(getVibeDir(projectDir), 'vibe.md');
|
|
660
|
+
if (!fs.existsSync(p))
|
|
661
|
+
return '# Vibe\n\nNo vibe data yet.';
|
|
662
|
+
return fs.readFileSync(p, 'utf-8');
|
|
663
|
+
}
|
|
664
|
+
catch {
|
|
665
|
+
return '# Vibe\n\nCould not read.';
|
|
666
|
+
} }
|
|
667
|
+
function resetVibe(projectDir) { const d = getVibeDir(projectDir); if (fs.existsSync(d))
|
|
668
|
+
for (const f of fs.readdirSync(d))
|
|
669
|
+
fs.unlinkSync(path.join(d, f)); }
|
|
670
|
+
//# sourceMappingURL=vibe-engine.js.map
|