claude-memory-layer 2.2.2 → 2.2.3
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/dist/cli/index.js
CHANGED
|
@@ -26126,7 +26126,7 @@ async function runOperationCli(action, label) {
|
|
|
26126
26126
|
}
|
|
26127
26127
|
}
|
|
26128
26128
|
var program = new Command();
|
|
26129
|
-
program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("2.2.
|
|
26129
|
+
program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("2.2.3");
|
|
26130
26130
|
program.command("market-context").description("Fetch read-only DART/FRED/Finnhub context with structured MarketContextSnapshot bull/bear/risk/catalyst analysis").option("--company <name>", "Company name for DART fallback search and report subject").option("--dart-corp-code <code>", "Exact DART corp_code for issuer-specific filings").option("--symbol <ticker>", "Listed ticker for Finnhub company profile").option("--providers <list>", "Comma-separated providers: dart,fred,finnhub").option("--fred-series <list>", "Comma-separated FRED series IDs").option("--json", "Print structured JSON including analysis.marketSnapshot").option("--no-snapshot", "Disable MarketContextSnapshot and DART company snapshot analysis").action(async (options) => {
|
|
26131
26131
|
try {
|
|
26132
26132
|
await runMarketContextCommand(options);
|
|
@@ -15810,6 +15810,7 @@ var CORE_MEMORY_BLOCK_LABELS = {
|
|
|
15810
15810
|
user: "User"
|
|
15811
15811
|
};
|
|
15812
15812
|
var SESSION_START_TIERS = ["session_summary", "agent_response"];
|
|
15813
|
+
var SESSION_START_MAX_SUMMARIES = 1;
|
|
15813
15814
|
var SESSION_START_EXCERPT_BUDGET = {
|
|
15814
15815
|
session_summary: 900,
|
|
15815
15816
|
agent_response: 400
|
|
@@ -15817,9 +15818,30 @@ var SESSION_START_EXCERPT_BUDGET = {
|
|
|
15817
15818
|
var DEFAULT_EXCERPT_BUDGET = 400;
|
|
15818
15819
|
var SESSION_START_MAX_MEMORIES = 3;
|
|
15819
15820
|
var SESSION_START_SCAN_WINDOW = 60;
|
|
15821
|
+
function dedupeKeyFor(event) {
|
|
15822
|
+
return event.content.trim().replace(/\s+/g, " ").slice(0, 200);
|
|
15823
|
+
}
|
|
15820
15824
|
function selectSessionStartMemories(events, limit) {
|
|
15821
15825
|
const usable = events.filter((event) => SESSION_START_TIERS.includes(event.eventType) && !(event.eventType === "session_summary" && isPromptOnlySessionSummary(event.content)) && event.content.trim().length > 0);
|
|
15822
|
-
|
|
15826
|
+
const byRecency = usable.map((event, index) => ({ event, index })).sort((a, b) => b.event.timestamp.getTime() - a.event.timestamp.getTime() || a.index - b.index);
|
|
15827
|
+
const selected = [];
|
|
15828
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15829
|
+
let summaries = 0;
|
|
15830
|
+
for (const { event } of byRecency) {
|
|
15831
|
+
if (selected.length >= limit) break;
|
|
15832
|
+
if (event.eventType === "session_summary") {
|
|
15833
|
+
if (summaries >= SESSION_START_MAX_SUMMARIES) continue;
|
|
15834
|
+
summaries += 1;
|
|
15835
|
+
}
|
|
15836
|
+
const key = dedupeKeyFor(event);
|
|
15837
|
+
if (seen.has(key)) {
|
|
15838
|
+
if (event.eventType === "session_summary") summaries -= 1;
|
|
15839
|
+
continue;
|
|
15840
|
+
}
|
|
15841
|
+
seen.add(key);
|
|
15842
|
+
selected.push(event);
|
|
15843
|
+
}
|
|
15844
|
+
return selected;
|
|
15823
15845
|
}
|
|
15824
15846
|
function sessionStartExcerpt(event) {
|
|
15825
15847
|
const collapsed = event.content.trim().replace(/\s*\n+\s*/g, " / ");
|