memctx 1.0.10 → 1.0.11
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/dashboard/dist/assets/index-BlydT9ue.js +712 -0
- package/dashboard/dist/assets/index-CahA5NDR.css +1 -0
- package/dashboard/dist/assets/{index.es-D85_UUf8.js → index.es-DQCQVjyb.js} +1 -1
- package/dashboard/dist/assets/{jszip.min-CSBY1G_D.js → jszip.min-B4jg4J0T.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/src/api/graph.d.ts +3 -0
- package/dist/src/api/graph.js +118 -0
- package/dist/src/api/graph.js.map +1 -0
- package/dist/src/db/graph-queries.d.ts +28 -0
- package/dist/src/db/graph-queries.js +65 -0
- package/dist/src/db/graph-queries.js.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/services/graph-extractor.d.ts +26 -0
- package/dist/src/services/graph-extractor.js +68 -0
- package/dist/src/services/graph-extractor.js.map +1 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/index-B83_W4qH.css +0 -1
- package/dashboard/dist/assets/index-DDN6Gx1_.js +0 -628
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GraphExtractor = void 0;
|
|
7
|
+
const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
|
|
8
|
+
class GraphExtractor {
|
|
9
|
+
client;
|
|
10
|
+
constructor(apiKey) {
|
|
11
|
+
this.client = new sdk_1.default({ apiKey });
|
|
12
|
+
}
|
|
13
|
+
async extractFromTranscript(sessionId, transcript) {
|
|
14
|
+
const prompt = `Extract a knowledge graph from this AI coding session transcript.
|
|
15
|
+
|
|
16
|
+
Identify:
|
|
17
|
+
1. Files mentioned (type: 'file')
|
|
18
|
+
2. Functions/classes discussed (type: 'function', 'class')
|
|
19
|
+
3. Concepts explained (type: 'concept')
|
|
20
|
+
4. Problems solved (type: 'problem')
|
|
21
|
+
5. Decisions made (type: 'decision')
|
|
22
|
+
|
|
23
|
+
For each entity, provide:
|
|
24
|
+
- id: unique identifier (e.g., "file:src/index.ts", "concept:authentication")
|
|
25
|
+
- label: human-readable name
|
|
26
|
+
- type: entity type
|
|
27
|
+
- confidence: EXTRACTED (explicitly mentioned), INFERRED (implied), or AMBIGUOUS (unclear)
|
|
28
|
+
|
|
29
|
+
Also identify relationships:
|
|
30
|
+
- imports: file A imports file B
|
|
31
|
+
- calls: function A calls function B
|
|
32
|
+
- implements: class A implements concept B
|
|
33
|
+
- solves: solution A solves problem B
|
|
34
|
+
- related_to: general relationship
|
|
35
|
+
|
|
36
|
+
Return JSON:
|
|
37
|
+
{
|
|
38
|
+
"nodes": [{"id": "...", "label": "...", "type": "...", "confidence": "..."}],
|
|
39
|
+
"edges": [{"sourceId": "...", "targetId": "...", "relationship": "...", "confidence": "..."}]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Transcript:
|
|
43
|
+
${transcript}`;
|
|
44
|
+
const response = await this.client.messages.create({
|
|
45
|
+
model: 'claude-sonnet-4-6',
|
|
46
|
+
max_tokens: 4096,
|
|
47
|
+
messages: [{ role: 'user', content: prompt }],
|
|
48
|
+
});
|
|
49
|
+
const content = response.content[0];
|
|
50
|
+
if (content.type !== 'text') {
|
|
51
|
+
throw new Error('Unexpected response type');
|
|
52
|
+
}
|
|
53
|
+
// Extract JSON from response
|
|
54
|
+
const jsonMatch = content.text.match(/\{[\s\S]*\}/);
|
|
55
|
+
if (!jsonMatch) {
|
|
56
|
+
throw new Error('No JSON found in response');
|
|
57
|
+
}
|
|
58
|
+
const result = JSON.parse(jsonMatch[0]);
|
|
59
|
+
// Add unique IDs to edges
|
|
60
|
+
result.edges = result.edges.map((edge, idx) => ({
|
|
61
|
+
...edge,
|
|
62
|
+
id: `${sessionId}_edge_${idx}`,
|
|
63
|
+
}));
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.GraphExtractor = GraphExtractor;
|
|
68
|
+
//# sourceMappingURL=graph-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-extractor.js","sourceRoot":"","sources":["../../../src/services/graph-extractor.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA0C;AAyB1C,MAAa,cAAc;IACjB,MAAM,CAAY;IAE1B,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,aAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,SAAiB,EACjB,UAAkB;QAElB,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BjB,UAAU,EAAE,CAAC;QAEX,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YACjD,KAAK,EAAE,mBAAmB;YAC1B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;SAC9C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QAED,6BAA6B;QAC7B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACpD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAqB,CAAC;QAE5D,0BAA0B;QAC1B,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;YAC9C,GAAG,IAAI;YACP,EAAE,EAAE,GAAG,SAAS,SAAS,GAAG,EAAE;SAC/B,CAAC,CAAC,CAAC;QAEJ,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AArED,wCAqEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memctx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Autonomous session memory for Claude Code - automatically captures, analyzes, and summarizes your development sessions",
|
|
5
5
|
"author": "Fahad Aziz Qureshi <info@memctx.dev> (https://memctx.dev)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.border{border-style:var(--tw-border-style);border-width:1px}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}:root,:root.dark{--bg:#0d0d0f;--surface:#16161a;--surface2:#1e1e24;--border:#2a2a35;--text:#e8e8f0;--text-muted:#7a7a99;--accent:#7c6cfc;--accent-hover:#9181fd;--green:#22c55e;--yellow:#eab308;--red:#ef4444;--blue:#3b82f6;--orange:#f97316}:root:not(.dark){--bg:#fff;--surface:#f9fafb;--surface2:#f3f4f6;--border:#e5e7eb;--text:#111827;--text-muted:#6b7280;--accent:#7c6cfc;--accent-hover:#6b5ce8;--green:#16a34a;--yellow:#ca8a04;--red:#dc2626;--blue:#2563eb;--orange:#ea580c}*{box-sizing:border-box;margin:0;padding:0}body{background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif;font-size:15px;line-height:1.5}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}a{color:inherit;text-decoration:none}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes slideIn{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@media(max-width:1024px){body{font-size:14px}}@media(max-width:768px){body{font-size:14px}::-webkit-scrollbar{width:3px;height:3px}.projects-grid,[style*="gridTemplateColumns: 'repeat(3, 1fr')"]{grid-template-columns:1fr!important}[style*="padding: '28px 32px'"]{padding:16px!important}}.mobile-hidden{display:block}.mobile-only{display:none}@media(max-width:768px){.mobile-hidden{display:none}.mobile-only{display:block}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
|