memhouse 0.0.1 → 0.3.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/LICENSE +22 -0
- package/README.md +59 -3
- package/bin/memhouse.js +487 -0
- package/cache.js +850 -0
- package/ch-ingest.js +329 -0
- package/ch-schema.js +152 -0
- package/clickhouse.js +87 -0
- package/editors/antigravity.js +1019 -0
- package/editors/base.js +321 -0
- package/editors/claude.js +386 -0
- package/editors/codebuff.js +338 -0
- package/editors/codex.js +537 -0
- package/editors/commandcode.js +166 -0
- package/editors/copilot-jetbrains.js +207 -0
- package/editors/copilot.js +260 -0
- package/editors/cursor-agent.js +202 -0
- package/editors/cursor.js +438 -0
- package/editors/gemini.js +231 -0
- package/editors/goose.js +358 -0
- package/editors/gsd.js +366 -0
- package/editors/index.js +179 -0
- package/editors/kiro.js +315 -0
- package/editors/opencode.js +374 -0
- package/editors/vscode.js +413 -0
- package/editors/windsurf.js +634 -0
- package/editors/zed.js +213 -0
- package/index.js +424 -2
- package/mcp-server.js +294 -0
- package/mem-house/DESIGN.md +119 -0
- package/mem-house/delivery/AGENT-INSTALL.md +75 -0
- package/mem-house/delivery/PROMPT.md +42 -0
- package/mem-house/delivery/install.sh +181 -0
- package/mem-house/delivery/kernel-install.md +76 -0
- package/mem-house/delivery/plugin/.claude-plugin/plugin.json +8 -0
- package/mem-house/delivery/skills/memhouse-search/SKILL.md +104 -0
- package/mem-house/delivery/skills/memhouse-sessions/SKILL.md +94 -0
- package/mem-house/delivery/skills/memhouse-sql/SKILL.md +115 -0
- package/mem-house/rls.sql +17 -0
- package/mem-house/schema.sql +145 -0
- package/mem-house/server/queries.js +878 -0
- package/mem-house/server/server.js +228 -0
- package/mem-house/shipper/ship.js +402 -0
- package/misc/syntax-check.js +38 -0
- package/package.json +56 -7
- package/pricing.js +88 -0
- package/pricing.json +992 -0
- package/public/assets/index-BsgjOSTv.js +75 -0
- package/public/assets/index-DV6ONi_F.css +2 -0
- package/public/index.html +16 -0
- package/relay-client.js +306 -0
- package/relay-server.js +577 -0
- package/server.js +860 -0
- package/share-image.js +367 -0
- package/ui/eslint.config.js +29 -0
- package/ui/index.html +15 -0
- package/ui/package-lock.json +4229 -0
- package/ui/package.json +38 -0
- package/ui/src/App.jsx +364 -0
- package/ui/src/components/ActivityHeatmap.jsx +206 -0
- package/ui/src/components/AiAuditCard.jsx +254 -0
- package/ui/src/components/AnimatedLoader.jsx +14 -0
- package/ui/src/components/AnimatedLogo.jsx +96 -0
- package/ui/src/components/ChatSidebar.jsx +226 -0
- package/ui/src/components/DateRangePicker.jsx +104 -0
- package/ui/src/components/EditorDot.jsx +11 -0
- package/ui/src/components/EditorIcon.jsx +117 -0
- package/ui/src/components/KpiCard.jsx +9 -0
- package/ui/src/components/LiveFeed.jsx +128 -0
- package/ui/src/components/LoginScreen.jsx +81 -0
- package/ui/src/components/MessageRenderer.jsx +148 -0
- package/ui/src/components/PageHeader.jsx +11 -0
- package/ui/src/components/SectionTitle.jsx +3 -0
- package/ui/src/components/ShareModal.jsx +305 -0
- package/ui/src/components/TokenTimeline.jsx +258 -0
- package/ui/src/hooks/useLive.jsx +15 -0
- package/ui/src/index.css +83 -0
- package/ui/src/lib/api.js +343 -0
- package/ui/src/lib/constants.js +88 -0
- package/ui/src/lib/theme.jsx +23 -0
- package/ui/src/main.jsx +16 -0
- package/ui/src/pages/Artifacts.jsx +575 -0
- package/ui/src/pages/Compare.jsx +232 -0
- package/ui/src/pages/CostAnalysis.jsx +354 -0
- package/ui/src/pages/Dashboard.jsx +529 -0
- package/ui/src/pages/DeepAnalysis.jsx +495 -0
- package/ui/src/pages/GSD.jsx +726 -0
- package/ui/src/pages/MCPs.jsx +744 -0
- package/ui/src/pages/ProjectDetail.jsx +325 -0
- package/ui/src/pages/Projects.jsx +249 -0
- package/ui/src/pages/RelayDashboard.jsx +590 -0
- package/ui/src/pages/RelayUserDetail.jsx +466 -0
- package/ui/src/pages/Sessions.jsx +535 -0
- package/ui/src/pages/Settings.jsx +241 -0
- package/ui/src/pages/SqlViewer.jsx +344 -0
- package/ui/src/pages/Subscriptions.jsx +411 -0
- package/ui/vite.config.js +18 -0
package/package.json
CHANGED
|
@@ -1,16 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memhouse",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "memhouse \u2014 agent conversation memory across 17 editors: parse-on-client shippers, a typed ClickHouse store, kernel-agency install, and the agentlytics dashboard",
|
|
5
|
+
"main": "bin/memhouse.js",
|
|
5
6
|
"bin": {
|
|
6
|
-
"memhouse": "
|
|
7
|
+
"memhouse": "./bin/memhouse.js",
|
|
8
|
+
"agentlytics": "./index.js"
|
|
7
9
|
},
|
|
8
10
|
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"mem-house/",
|
|
13
|
+
"misc/syntax-check.js",
|
|
9
14
|
"index.js",
|
|
15
|
+
"cache.js",
|
|
16
|
+
"ch-schema.js",
|
|
17
|
+
"ch-ingest.js",
|
|
18
|
+
"clickhouse.js",
|
|
19
|
+
"server.js",
|
|
20
|
+
"share-image.js",
|
|
21
|
+
"relay-server.js",
|
|
22
|
+
"relay-client.js",
|
|
23
|
+
"mcp-server.js",
|
|
24
|
+
"pricing.js",
|
|
25
|
+
"pricing.json",
|
|
26
|
+
"editors/",
|
|
27
|
+
"ui/src/",
|
|
28
|
+
"ui/index.html",
|
|
29
|
+
"ui/package.json",
|
|
30
|
+
"ui/package-lock.json",
|
|
31
|
+
"ui/vite.config.js",
|
|
32
|
+
"ui/eslint.config.js",
|
|
33
|
+
"public/",
|
|
10
34
|
"README.md"
|
|
11
35
|
],
|
|
12
|
-
"
|
|
13
|
-
|
|
36
|
+
"scripts": {
|
|
37
|
+
"start": "node bin/memhouse.js",
|
|
38
|
+
"build": "cd ui && npm install && npm run build",
|
|
39
|
+
"dev": "cd ui && npm run dev",
|
|
40
|
+
"test": "node misc/syntax-check.js",
|
|
41
|
+
"prepack": "cd ui && npm install --no-audit --no-fund && npm run build"
|
|
42
|
+
},
|
|
14
43
|
"keywords": [
|
|
15
44
|
"memory",
|
|
16
45
|
"agents",
|
|
@@ -18,6 +47,26 @@
|
|
|
18
47
|
"claude",
|
|
19
48
|
"codex",
|
|
20
49
|
"gemini",
|
|
21
|
-
"
|
|
22
|
-
|
|
50
|
+
"cursor",
|
|
51
|
+
"analytics",
|
|
52
|
+
"mem-house"
|
|
53
|
+
],
|
|
54
|
+
"author": "Ramazan Polat <ramazanpolat@gmail.com> (built on agentlytics by fkadev)",
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=20.19.0"
|
|
58
|
+
},
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://github.com/agent-realm/memhouse"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@clickhouse/client": "^1.23.1",
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
66
|
+
"better-sqlite3": "^12.6.2",
|
|
67
|
+
"chalk": "^4.1.2",
|
|
68
|
+
"express": "^4.22.1",
|
|
69
|
+
"log-update": "^4.0.0",
|
|
70
|
+
"open": "^8.4.2"
|
|
71
|
+
}
|
|
23
72
|
}
|
package/pricing.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Load pricing data from JSON – edit pricing.json to add/update models
|
|
2
|
+
const _raw = require('./pricing.json');
|
|
3
|
+
const MODEL_PRICING = Object.fromEntries(
|
|
4
|
+
Object.entries(_raw).filter(([k]) => !k.startsWith('_'))
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
// Normalize a model identifier to match pricing keys
|
|
8
|
+
// Handles versioned names like "claude-sonnet-4-20250514", "gpt-4o-2024-08-06", etc.
|
|
9
|
+
function normalizeModelName(name) {
|
|
10
|
+
if (!name) return null;
|
|
11
|
+
let n = name.toLowerCase().trim();
|
|
12
|
+
|
|
13
|
+
// Strip leading provider prefixes (e.g. "anthropic/claude-..." or "openai/gpt-...")
|
|
14
|
+
const slashIdx = n.lastIndexOf('/');
|
|
15
|
+
if (slashIdx !== -1) n = n.substring(slashIdx + 1);
|
|
16
|
+
|
|
17
|
+
// Strip dot-delimited provider prefixes (e.g. "us.anthropic.claude-sonnet-4-6")
|
|
18
|
+
// Only strip if all prefix segments are simple words (no dashes), to avoid
|
|
19
|
+
// splitting version dots like "claude-4.6-opus"
|
|
20
|
+
const dotParts = n.split('.');
|
|
21
|
+
if (dotParts.length > 1) {
|
|
22
|
+
const prefixes = dotParts.slice(0, -1);
|
|
23
|
+
const last = dotParts[dotParts.length - 1];
|
|
24
|
+
if (last.includes('-') && prefixes.every(p => !p.includes('-'))) n = last;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Handle MODEL_CLAUDE_* / MODEL_GPT_* enum constants
|
|
28
|
+
if (n.startsWith('model_')) {
|
|
29
|
+
n = n.substring(6).replace(/_/g, '-');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Build candidate list: original + dots→dashes + reversed claude names
|
|
33
|
+
const candidates = [n];
|
|
34
|
+
if (n.includes('.')) candidates.push(n.replace(/\./g, '-'));
|
|
35
|
+
|
|
36
|
+
// Rearrange reversed claude names: "claude-4-6-opus-..." → "claude-opus-4-6"
|
|
37
|
+
// Run on all candidates so dots→dashes variant is also checked
|
|
38
|
+
for (const c of [...candidates]) {
|
|
39
|
+
const rev = c.match(/^(claude)-(\d+)-(\d+)-(opus|sonnet|haiku)/);
|
|
40
|
+
if (rev) candidates.push(`${rev[1]}-${rev[4]}-${rev[2]}-${rev[3]}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Pass 1: exact and precise matches across ALL candidates first
|
|
44
|
+
for (const c of candidates) {
|
|
45
|
+
if (MODEL_PRICING[c]) return c;
|
|
46
|
+
}
|
|
47
|
+
for (const c of candidates) {
|
|
48
|
+
const withoutDate = c.replace(/-\d{4}-?\d{2}-?\d{2}$/, '');
|
|
49
|
+
if (MODEL_PRICING[withoutDate]) return withoutDate;
|
|
50
|
+
const withoutTag = c.replace(/:(latest|thinking)$/, '');
|
|
51
|
+
if (MODEL_PRICING[withoutTag]) return withoutTag;
|
|
52
|
+
const withoutQual = c.replace(/-(thinking|high|xhigh|preview|latest)(-thinking|-high|-xhigh|-preview)*/g, '');
|
|
53
|
+
if (withoutQual !== c && MODEL_PRICING[withoutQual]) return withoutQual;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Pass 2: fuzzy startsWith (longest key match wins)
|
|
57
|
+
const keys = Object.keys(MODEL_PRICING);
|
|
58
|
+
for (const c of candidates) {
|
|
59
|
+
let best = null;
|
|
60
|
+
for (const key of keys) {
|
|
61
|
+
if (c.startsWith(key) && (!best || key.length > best.length)) best = key;
|
|
62
|
+
}
|
|
63
|
+
if (best) return best;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getModelPricing(modelName) {
|
|
70
|
+
const key = normalizeModelName(modelName);
|
|
71
|
+
return key ? MODEL_PRICING[key] : null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Calculate cost for a set of token counts and a model
|
|
75
|
+
// Returns cost in USD or null if model is unknown
|
|
76
|
+
function calculateCost(modelName, inputTokens, outputTokens, cacheRead, cacheWrite) {
|
|
77
|
+
const pricing = getModelPricing(modelName);
|
|
78
|
+
if (!pricing) return null;
|
|
79
|
+
|
|
80
|
+
const input = ((inputTokens || 0) / 1_000_000) * pricing.input;
|
|
81
|
+
const output = ((outputTokens || 0) / 1_000_000) * pricing.output;
|
|
82
|
+
const cr = ((cacheRead || 0) / 1_000_000) * pricing.cacheRead;
|
|
83
|
+
const cw = ((cacheWrite || 0) / 1_000_000) * pricing.cacheWrite;
|
|
84
|
+
|
|
85
|
+
return input + output + cr + cw;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
module.exports = { MODEL_PRICING, normalizeModelName, getModelPricing, calculateCost };
|