@echomem/mcp 1.4.44 → 1.4.46

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 (50) hide show
  1. package/README.md +28 -25
  2. package/dist/city/README.md +9 -0
  3. package/dist/city/echo-ai-city-only.html +2232 -0
  4. package/dist/city/echo-extraction-plate.html +330 -0
  5. package/dist/city/echo-face-cutout.png +0 -0
  6. package/dist/city/personality_stickers/bossy.png +0 -0
  7. package/dist/city/personality_stickers/ghosty.png +0 -0
  8. package/dist/city/personality_stickers/loopy.png +0 -0
  9. package/dist/city/personality_stickers/lusty.png +0 -0
  10. package/dist/city/personality_stickers/maxxy.png +0 -0
  11. package/dist/city/personality_stickers/tabby.png +0 -0
  12. package/dist/city/vendor/OrbitControls.js +1417 -0
  13. package/dist/city/vendor/RoundedBoxGeometry.js +155 -0
  14. package/dist/city/vendor/echo_general-file-21.riv +0 -0
  15. package/dist/city/vendor/rive.js +8139 -0
  16. package/dist/city/vendor/rive.wasm +0 -0
  17. package/dist/city/vendor/three.module.min.js +6 -0
  18. package/dist/context-analysis/claude-native-canonical.js +2 -2
  19. package/dist/context-analysis/vendored-canonical.js +2 -2
  20. package/dist/context-analysis/workspace-report.js +3 -3
  21. package/dist/forensics.js +1531 -0
  22. package/dist/hud/hooks.js +31 -43
  23. package/dist/index.js +79 -15
  24. package/dist/local-data-paths.js +38 -0
  25. package/dist/migrate.js +140 -70
  26. package/dist/report.js +721 -0
  27. package/dist/save-checkpoint-hook.js +1 -1
  28. package/dist/setup-page/client-core.js +372 -18
  29. package/dist/setup-page/client-extraction.js +204 -37
  30. package/dist/setup-page/client-lifecycle.js +101 -31
  31. package/dist/setup-page/client-report-audit.js +819 -0
  32. package/dist/setup-page/client-report-city.js +356 -0
  33. package/dist/setup-page/client-report.js +6 -0
  34. package/dist/setup-page/client.js +2 -0
  35. package/dist/setup-page/styles-city-report.js +880 -0
  36. package/dist/setup-page/styles-context-audit.js +470 -0
  37. package/dist/setup-page/styles-extraction.js +31 -1
  38. package/dist/setup-page/styles-foundation.js +89 -0
  39. package/dist/setup-page/styles-mvp.js +155 -10
  40. package/dist/setup-page/styles-website-alignment.js +204 -0
  41. package/dist/setup-page/styles.js +4 -0
  42. package/dist/setup-page.js +4 -4
  43. package/dist/setup-preview.js +212 -4
  44. package/dist/setup.js +793 -300
  45. package/dist/source-session.js +3 -9
  46. package/dist/v1-contract.js +8 -0
  47. package/package.json +7 -9
  48. package/dist/config-files.js +0 -63
  49. package/dist/local-jsonl.js +0 -87
  50. package/dist/onboarding-stats.js +0 -16
@@ -1,6 +1,10 @@
1
1
  export const SETUP_PREVIEW_STATES = [
2
2
  "consent",
3
3
  "consent-required",
4
+ "scan",
5
+ "scan-error",
6
+ "bridge-error",
7
+ "report",
4
8
  "extract-counting",
5
9
  "extract-degraded",
6
10
  "extract-degraded-exact",
@@ -34,12 +38,189 @@ export const SETUP_PREVIEW_STATES = [
34
38
  export function parseSetupPreviewState(value) {
35
39
  return SETUP_PREVIEW_STATES.includes(value) ? value : null;
36
40
  }
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
+ };
37
218
  function previewWatermarkScript() {
38
219
  return `
39
220
  document.body.setAttribute("data-preview", "true");
40
221
  var previewWatermark = document.createElement("div");
41
222
  previewWatermark.setAttribute("role", "status");
42
- previewWatermark.textContent = "DESIGN PREVIEW · SAMPLE DATA · NOT YOUR LOCAL DATA";
223
+ previewWatermark.textContent = "DESIGN PREVIEW · SAMPLE DATA · NOT YOUR LOCAL REPORT";
43
224
  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)";
44
225
  document.body.appendChild(previewWatermark);
45
226
  `;
@@ -107,13 +288,40 @@ export function renderSetupPreviewBootstrap(state) {
107
288
  const watermark = previewWatermarkScript();
108
289
  if (state === "consent") {
109
290
  return `${watermark}
110
- renderLocalHistoryConsent();`;
291
+ renderLocalScanConsent();`;
111
292
  }
112
293
  if (state === "consent-required") {
113
294
  return `${watermark}
114
- renderLocalHistoryConsent();
295
+ renderLocalScanConsent();
115
296
  setConsentStatus("Local history access is required to continue setup. Nothing will be scanned or uploaded unless you allow it.", "required");`;
116
297
  }
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
+ }
117
325
  if (state === "extract-counting") {
118
326
  return `${watermark}
119
327
  stats = null;
@@ -133,7 +341,7 @@ export function renderSetupPreviewBootstrap(state) {
133
341
  quotaLimit: 100, quotaRemaining: 100, candidateCount: 7, selectFree: true,
134
342
  })}
135
343
  stats.discovery = { phase: "exact", exact: true };
136
- stats.optionalDiagnostics = { degraded: true, reason: "ACCOUNT_RECONCILIATION_FAILED", countsTrusted: true };
344
+ stats.optionalDiagnostics = { degraded: true, reason: "FULL_STATS_FAILED", countsTrusted: true };
137
345
  renderDashboard();`;
138
346
  if (state === "extract-ready")
139
347
  return `${watermark}${extractionPreviewBootstrap({