truememory-mirror 1.0.7 → 1.0.8
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/bin/mirror.js +43 -43
- package/package.json +1 -1
package/bin/mirror.js
CHANGED
|
@@ -99,37 +99,46 @@ function clearLine() {
|
|
|
99
99
|
if (!_jsonMode) process.stderr.write('\r\x1b[K');
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
const
|
|
103
|
-
'scanning cognitive patterns',
|
|
104
|
-
'indexing conversation fragments',
|
|
105
|
-
'parsing behavioral signals',
|
|
106
|
-
'extracting reasoning signatures',
|
|
107
|
-
'profiling communication style',
|
|
108
|
-
'detecting stress responses',
|
|
109
|
-
'measuring risk tolerance curves',
|
|
110
|
-
'mapping decision architecture',
|
|
111
|
-
'isolating personality markers',
|
|
112
|
-
'tracing collaboration fingerprint',
|
|
113
|
-
'decoding problem-solving heuristics',
|
|
114
|
-
'analyzing delegation patterns',
|
|
115
|
-
'triangulating identity vectors',
|
|
116
|
-
'calibrating behavioral model',
|
|
117
|
-
'resolving cognitive tensions',
|
|
118
|
-
'consolidating trait matrix',
|
|
119
|
-
'building predictive scaffolding',
|
|
120
|
-
'running scenario simulations',
|
|
121
|
-
'stress-testing edge cases',
|
|
122
|
-
'computing confidence intervals',
|
|
123
|
-
'rendering identity surface',
|
|
124
|
-
'locking archetype match',
|
|
125
|
-
'sealing behavioral predictions',
|
|
126
|
-
'finalizing your mirror',
|
|
102
|
+
const PROGRESS_PHRASES = [
|
|
103
|
+
[0, 'scanning cognitive patterns'],
|
|
104
|
+
[4, 'indexing conversation fragments'],
|
|
105
|
+
[8, 'parsing behavioral signals'],
|
|
106
|
+
[12, 'extracting reasoning signatures'],
|
|
107
|
+
[16, 'profiling communication style'],
|
|
108
|
+
[20, 'detecting stress responses'],
|
|
109
|
+
[25, 'measuring risk tolerance curves'],
|
|
110
|
+
[30, 'mapping decision architecture'],
|
|
111
|
+
[35, 'isolating personality markers'],
|
|
112
|
+
[40, 'tracing collaboration fingerprint'],
|
|
113
|
+
[45, 'decoding problem-solving heuristics'],
|
|
114
|
+
[50, 'analyzing delegation patterns'],
|
|
115
|
+
[55, 'triangulating identity vectors'],
|
|
116
|
+
[60, 'calibrating behavioral model'],
|
|
117
|
+
[65, 'resolving cognitive tensions'],
|
|
118
|
+
[70, 'consolidating trait matrix'],
|
|
119
|
+
[75, 'building predictive scaffolding'],
|
|
120
|
+
[80, 'running scenario simulations'],
|
|
121
|
+
[84, 'stress-testing edge cases'],
|
|
122
|
+
[88, 'computing confidence intervals'],
|
|
123
|
+
[91, 'rendering identity surface'],
|
|
124
|
+
[94, 'locking archetype match'],
|
|
125
|
+
[97, 'sealing behavioral predictions'],
|
|
126
|
+
[99, 'finalizing your mirror'],
|
|
127
127
|
];
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
function phraseForProgress(pct) {
|
|
130
|
+
let phrase = PROGRESS_PHRASES[0][1];
|
|
131
|
+
for (const [threshold, text] of PROGRESS_PHRASES) {
|
|
132
|
+
if (pct >= threshold) phrase = text;
|
|
133
|
+
else break;
|
|
134
|
+
}
|
|
135
|
+
return phrase;
|
|
136
|
+
}
|
|
130
137
|
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
let _scanPhraseIndex = 0;
|
|
139
|
+
function nextScanPhrase() {
|
|
140
|
+
const scanPhrases = PROGRESS_PHRASES.slice(0, 3);
|
|
141
|
+
return scanPhrases[_scanPhraseIndex++ % scanPhrases.length][1];
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
function progressBar(pct, width = 30) {
|
|
@@ -168,10 +177,10 @@ async function main() {
|
|
|
168
177
|
// --- Scan & parse with rotating status ---
|
|
169
178
|
const spinTimer = setInterval(() => {
|
|
170
179
|
clearLine();
|
|
171
|
-
write(` ${DIM}${
|
|
180
|
+
write(` ${DIM}${nextScanPhrase()}...${R}`);
|
|
172
181
|
}, 3750);
|
|
173
182
|
|
|
174
|
-
write(` ${DIM}${
|
|
183
|
+
write(` ${DIM}${nextScanPhrase()}...${R}`);
|
|
175
184
|
const sources = await scan(args.source);
|
|
176
185
|
|
|
177
186
|
let claudeSessions = [];
|
|
@@ -233,23 +242,14 @@ async function main() {
|
|
|
233
242
|
process.exit(1);
|
|
234
243
|
}
|
|
235
244
|
|
|
236
|
-
// --- Poll with
|
|
237
|
-
let lastPhraseTick = 0;
|
|
238
|
-
let currentPhrase = nextPhrase();
|
|
239
|
-
|
|
245
|
+
// --- Poll with progress-locked status ---
|
|
240
246
|
try {
|
|
241
247
|
await pollStatus(result.profile_id, args.apiUrl, (status) => {
|
|
242
|
-
const pct = status.progress || 0;
|
|
243
|
-
const bar = progressBar(pct);
|
|
244
|
-
const now = Date.now();
|
|
245
|
-
|
|
246
|
-
if (now - lastPhraseTick > 3750) {
|
|
247
|
-
currentPhrase = nextPhrase();
|
|
248
|
-
lastPhraseTick = now;
|
|
249
|
-
}
|
|
248
|
+
const pct = Math.round((status.progress || 0) * 100);
|
|
249
|
+
const bar = progressBar(pct / 100);
|
|
250
250
|
|
|
251
251
|
clearLine();
|
|
252
|
-
write(` ${bar} ${WHITE}${
|
|
252
|
+
write(` ${bar} ${WHITE}${pct}%${R} ${DIM}${phraseForProgress(pct)}...${R}`);
|
|
253
253
|
});
|
|
254
254
|
} catch (err) {
|
|
255
255
|
write(`\n\n ✗ extraction failed: ${err.message}\n\n`);
|