@echomem/mcp 1.4.47 → 1.4.48

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.
Files changed (46) hide show
  1. package/README.md +22 -26
  2. package/dist/context-analysis/claude-native-canonical.js +2 -2
  3. package/dist/context-analysis/vendored-canonical.js +2 -2
  4. package/dist/context-analysis/workspace-report.js +3 -3
  5. package/dist/index.js +5 -8
  6. package/dist/local-jsonl.js +87 -0
  7. package/dist/migrate.js +6 -4
  8. package/dist/onboarding-stats.js +16 -0
  9. package/dist/save-checkpoint-hook.js +1 -1
  10. package/dist/setup-page/client-core.js +18 -372
  11. package/dist/setup-page/client-extraction.js +14 -129
  12. package/dist/setup-page/client-lifecycle.js +28 -101
  13. package/dist/setup-page/client.js +0 -2
  14. package/dist/setup-page/styles-extraction.js +1 -31
  15. package/dist/setup-page/styles-foundation.js +0 -89
  16. package/dist/setup-page/styles-mvp.js +10 -155
  17. package/dist/setup-page/styles-website-alignment.js +0 -204
  18. package/dist/setup-page/styles.js +0 -4
  19. package/dist/setup-page.js +4 -4
  20. package/dist/setup-preview.js +4 -212
  21. package/dist/setup.js +94 -580
  22. package/dist/v1-contract.js +0 -8
  23. package/package.json +5 -7
  24. package/dist/city/README.md +0 -9
  25. package/dist/city/echo-ai-city-only.html +0 -2232
  26. package/dist/city/echo-extraction-plate.html +0 -330
  27. package/dist/city/echo-face-cutout.png +0 -0
  28. package/dist/city/personality_stickers/bossy.png +0 -0
  29. package/dist/city/personality_stickers/ghosty.png +0 -0
  30. package/dist/city/personality_stickers/loopy.png +0 -0
  31. package/dist/city/personality_stickers/lusty.png +0 -0
  32. package/dist/city/personality_stickers/maxxy.png +0 -0
  33. package/dist/city/personality_stickers/tabby.png +0 -0
  34. package/dist/city/vendor/OrbitControls.js +0 -1417
  35. package/dist/city/vendor/RoundedBoxGeometry.js +0 -155
  36. package/dist/city/vendor/echo_general-file-21.riv +0 -0
  37. package/dist/city/vendor/rive.js +0 -8139
  38. package/dist/city/vendor/rive.wasm +0 -0
  39. package/dist/city/vendor/three.module.min.js +0 -6
  40. package/dist/forensics.js +0 -1531
  41. package/dist/report.js +0 -721
  42. package/dist/setup-page/client-report-audit.js +0 -819
  43. package/dist/setup-page/client-report-city.js +0 -356
  44. package/dist/setup-page/client-report.js +0 -6
  45. package/dist/setup-page/styles-city-report.js +0 -880
  46. package/dist/setup-page/styles-context-audit.js +0 -470
@@ -1,10 +1,6 @@
1
1
  export const SETUP_PREVIEW_STATES = [
2
2
  "consent",
3
3
  "consent-required",
4
- "scan",
5
- "scan-error",
6
- "bridge-error",
7
- "report",
8
4
  "extract-counting",
9
5
  "extract-degraded",
10
6
  "extract-degraded-exact",
@@ -38,189 +34,12 @@ export const SETUP_PREVIEW_STATES = [
38
34
  export function parseSetupPreviewState(value) {
39
35
  return SETUP_PREVIEW_STATES.includes(value) ? value : null;
40
36
  }
41
- export const SETUP_PREVIEW_REPORT = {
42
- schemaVersion: 1,
43
- dataOrigin: "design-preview",
44
- generatedFrom: [],
45
- llmCallsUsed: 0,
46
- transcriptsUploaded: false,
47
- scanStartDate: "2026-05-01",
48
- scanEndDate: "2026-07-09",
49
- firstSession: {
50
- date: "2026-05-01T16:14:00.000Z",
51
- source: "codex",
52
- repo: "Preview Workspace",
53
- },
54
- activeSessionCoverage: { codex: 82, claudeCode: 54, total: 136 },
55
- scale: {
56
- sessionCount: 136,
57
- repoCount: 4,
58
- totalTokens: 140_400_000,
59
- totalInputTokens: 138_000_000,
60
- totalCommits: 312,
61
- },
62
- cost: { total: 428, byModel: { "preview-model": { total: 140_400_000, cost: 428 } } },
63
- modelUsage: { topModel: "preview-model", topModelShare: 62, identityLabel: "Design preview" },
64
- userWorkingHours: { userAttentionHours: 184.5, averageDailyAttentionHours: 3.8 },
65
- rhythm: { lateNightShare: 18, hourHistogram: [0, 0, 0, 0, 0, 0, 1, 2, 5, 8, 10, 11, 9, 8, 7, 8, 10, 12, 11, 8, 5, 3, 1, 0] },
66
- cleanliness: { staleReadSharePct: 42 },
67
- contextWindow: { sampleCount: 0, metrics: {} },
68
- rereadForensics: {
69
- topFiles: [
70
- { file: "src/preview-alpha.ts", repo: "Preview Workspace", totalReads: 37, sessionsTouched: 12, daysTouched: 9, everChanged: true },
71
- { file: "src/preview-beta.ts", repo: "Sample Service", totalReads: 21, sessionsTouched: 7, daysTouched: 5, everChanged: true },
72
- ],
73
- },
74
- avoidableWait: {},
75
- counterfactual: { targetScore: 86, daysGained: 20.3, counterfactualDate: "2026-06-19" },
76
- repos: [
77
- { name: "Preview Workspace", sessions: 62, tokens: 78_000_000, totalTokens: 78_000_000, attentionHours: 72, assistantMessages: 740 },
78
- { name: "Sample Service", sessions: 31, tokens: 41_000_000, totalTokens: 41_000_000, attentionHours: 39, assistantMessages: 360 },
79
- { name: "Example CLI", sessions: 27, tokens: 12_000_000, totalTokens: 12_000_000, attentionHours: 28, assistantMessages: 250 },
80
- { name: "Demo Library", sessions: 16, tokens: 7_000_000, totalTokens: 7_000_000, attentionHours: 22, assistantMessages: 180 },
81
- ],
82
- canonicalGoldenStandard: {
83
- summary: {
84
- sessionsAnalyzed: 136,
85
- reposAnalyzed: 4,
86
- turnsAnalyzed: 1_840,
87
- officialInputTokens: 18_400_000,
88
- usefulTokens: 10_672_000,
89
- wasteTokens: 7_728_000,
90
- usefulPct: 58,
91
- wastePct: 42,
92
- attributedWasteTokens: 7_140_000,
93
- unattributedWasteTokens: 588_000,
94
- },
95
- diagnostics: { skippedSessions: 0 },
96
- buckets: { duplicate: 1_280_000, refind: 1_750_000, dead: 4_110_000, unattributed: 588_000 },
97
- problems: [
98
- {
99
- id: "P13",
100
- label: "Agent's Reasoning Notes",
101
- bucket: "dead",
102
- category: "Context Hygiene",
103
- count: 96,
104
- sessions: 32,
105
- allocatedWasteTokens: 2_180_000,
106
- examples: [{
107
- repo: "Preview Workspace",
108
- session: "preview-session-1",
109
- agentSource: "codex",
110
- turn: 30,
111
- sessionTitle: "Preview context report",
112
- sessionOrdinal: 82,
113
- sourceSessionCount: 82,
114
- sessionTurns: 41,
115
- timestampMs: Date.UTC(2026, 6, 6),
116
- tokens: 82_000,
117
- turnInputTokens: 212_400,
118
- turnUsefulTokens: 61_000,
119
- turnWasteTokens: 151_400,
120
- prompt: "Preview prompt. This is not local user data.",
121
- evidence: "Preview evidence used only in an explicitly authorized design state.",
122
- }],
123
- },
124
- {
125
- id: "P01",
126
- label: "Outdated Images & Screenshots",
127
- bucket: "dead",
128
- category: "Runtime Bug",
129
- count: 70,
130
- sessions: 18,
131
- allocatedWasteTokens: 1_930_000,
132
- examples: [{
133
- repo: "Sample Service",
134
- session: "preview-session-2",
135
- agentSource: "codex",
136
- turn: 67,
137
- sessionTitle: "Preview visual verification",
138
- sessionOrdinal: 79,
139
- sourceSessionCount: 82,
140
- sessionTurns: 88,
141
- timestampMs: Date.UTC(2026, 6, 3),
142
- tokens: 118_000,
143
- turnInputTokens: 224_300,
144
- turnUsefulTokens: 52_300,
145
- turnWasteTokens: 172_000,
146
- prompt: "Preview prompt. This is not local user data.",
147
- evidence: "Preview evidence used only in an explicitly authorized design state.",
148
- }],
149
- },
150
- {
151
- id: "P12",
152
- label: "Tool Call Logs",
153
- bucket: "refind",
154
- category: "Structural Accumulation",
155
- count: 428,
156
- sessions: 41,
157
- allocatedWasteTokens: 1_750_000,
158
- examples: [{
159
- repo: "Example CLI",
160
- session: "preview-session-3",
161
- agentSource: "claude-code",
162
- turn: 44,
163
- sessionTitle: "Preview build repair",
164
- sessionOrdinal: 51,
165
- sourceSessionCount: 54,
166
- sessionTurns: 63,
167
- timestampMs: Date.UTC(2026, 6, 7),
168
- tokens: 96_000,
169
- turnInputTokens: 198_600,
170
- turnUsefulTokens: 74_700,
171
- turnWasteTokens: 123_900,
172
- prompt: "Preview prompt. This is not local user data.",
173
- command: "npm run build",
174
- evidence: "Preview evidence used only in an explicitly authorized design state.",
175
- }],
176
- },
177
- {
178
- id: "P07",
179
- label: "Failed Turn Leftovers",
180
- bucket: "dead",
181
- category: "Model Behavior",
182
- count: 54,
183
- sessions: 27,
184
- allocatedWasteTokens: 1_280_000,
185
- examples: [{
186
- repo: "Demo Library",
187
- session: "preview-session-4",
188
- agentSource: "codex",
189
- turn: 23,
190
- sessionTitle: "Preview onboarding flow",
191
- sessionOrdinal: 74,
192
- sourceSessionCount: 82,
193
- sessionTurns: 35,
194
- timestampMs: Date.UTC(2026, 5, 30),
195
- tokens: 74_000,
196
- turnInputTokens: 176_800,
197
- turnUsefulTokens: 68_900,
198
- turnWasteTokens: 107_900,
199
- prompt: "Preview prompt. This is not local user data.",
200
- evidence: "Preview evidence used only in an explicitly authorized design state.",
201
- }],
202
- },
203
- ],
204
- },
205
- billedWasteProjection: {
206
- method: "canonical-window-share-over-provider-input",
207
- billedInputTokens: 138_000_000,
208
- canonicalInputTokens: 18_400_000,
209
- canonicalUsefulTokens: 10_672_000,
210
- canonicalWasteTokens: 7_728_000,
211
- billingMultiplier: 7.5,
212
- projectedUsefulTokens: 80_040_000,
213
- projectedWasteTokens: 57_960_000,
214
- usefulPct: 58,
215
- wastePct: 42,
216
- },
217
- };
218
37
  function previewWatermarkScript() {
219
38
  return `
220
39
  document.body.setAttribute("data-preview", "true");
221
40
  var previewWatermark = document.createElement("div");
222
41
  previewWatermark.setAttribute("role", "status");
223
- previewWatermark.textContent = "DESIGN PREVIEW · SAMPLE DATA · NOT YOUR LOCAL REPORT";
42
+ previewWatermark.textContent = "DESIGN PREVIEW · SAMPLE DATA · NOT YOUR LOCAL DATA";
224
43
  previewWatermark.style.cssText = "position:fixed;z-index:99999;left:50%;top:10px;transform:translateX(-50%);padding:7px 12px;border:1px solid #8b2c26;border-radius:999px;background:#fff4e8;color:#8b2c26;font:700 11px/1.2 ui-monospace,monospace;letter-spacing:.05em;box-shadow:0 4px 16px rgba(0,0,0,.12)";
225
44
  document.body.appendChild(previewWatermark);
226
45
  `;
@@ -288,40 +107,13 @@ export function renderSetupPreviewBootstrap(state) {
288
107
  const watermark = previewWatermarkScript();
289
108
  if (state === "consent") {
290
109
  return `${watermark}
291
- renderLocalScanConsent();`;
110
+ renderLocalHistoryConsent();`;
292
111
  }
293
112
  if (state === "consent-required") {
294
113
  return `${watermark}
295
- renderLocalScanConsent();
114
+ renderLocalHistoryConsent();
296
115
  setConsentStatus("Local history access is required to continue setup. Nothing will be scanned or uploaded unless you allow it.", "required");`;
297
116
  }
298
- if (state === "scan") {
299
- return `${watermark}
300
- reportEnvelope = {
301
- schemaVersion: 1,
302
- kind: "scanning",
303
- mode: "preview",
304
- scanId: "design-preview",
305
- progress: { stage: "reading-transcripts", label: "Reading transcript files", scanned: 116, total: 180, overall: 0.451, stageElapsedMs: 3000 }
306
- };
307
- renderLoading();`;
308
- }
309
- if (state === "scan-error") {
310
- return `${watermark}
311
- renderReportIssue("REPORT_CANONICAL_INVALID", "Preview-only canonical reconciliation failure.");`;
312
- }
313
- if (state === "bridge-error") {
314
- return `${watermark}
315
- renderBridgeIssue();`;
316
- }
317
- if (state === "report") {
318
- const reportJson = JSON.stringify(SETUP_PREVIEW_REPORT);
319
- return `${watermark}
320
- localHistoryConsentGranted = true;
321
- report = ${reportJson};
322
- reportEnvelope = { schemaVersion: 1, kind: "ready", mode: "preview", scanId: "design-preview", report: report };
323
- renderForensicReport();`;
324
- }
325
117
  if (state === "extract-counting") {
326
118
  return `${watermark}
327
119
  stats = null;
@@ -341,7 +133,7 @@ export function renderSetupPreviewBootstrap(state) {
341
133
  quotaLimit: 100, quotaRemaining: 100, candidateCount: 7, selectFree: true,
342
134
  })}
343
135
  stats.discovery = { phase: "exact", exact: true };
344
- stats.optionalDiagnostics = { degraded: true, reason: "FULL_STATS_FAILED", countsTrusted: true };
136
+ stats.optionalDiagnostics = { degraded: true, reason: "ACCOUNT_RECONCILIATION_FAILED", countsTrusted: true };
345
137
  renderDashboard();`;
346
138
  if (state === "extract-ready")
347
139
  return `${watermark}${extractionPreviewBootstrap({