claude-launchpad 1.4.0 → 1.6.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/dist/{chunk-UQOBOHKN.js → chunk-GLFJ2B43.js} +24 -11
- package/dist/chunk-GLFJ2B43.js.map +1 -0
- package/dist/{chunk-ADZ45KHX.js → chunk-LOUSTE6C.js} +2 -2
- package/dist/{chunk-RJEPJ4JE.js → chunk-WUJWETUJ.js} +14 -3
- package/dist/chunk-WUJWETUJ.js.map +1 -0
- package/dist/{chunk-WOC2PKT2.js → chunk-YF6HCPVY.js} +2 -2
- package/dist/{chunk-MQJA7TGY.js → chunk-ZI2PZSG4.js} +88 -2
- package/dist/chunk-ZI2PZSG4.js.map +1 -0
- package/dist/cli.js +302 -58
- package/dist/cli.js.map +1 -1
- package/dist/commands/memory/server.js +8 -74
- package/dist/commands/memory/server.js.map +1 -1
- package/dist/{context-NCV46PTY.js → context-DQQGQ767.js} +73 -9
- package/dist/context-DQQGQ767.js.map +1 -0
- package/dist/{install-DORMJYCU.js → install-MTDWI6RO.js} +5 -5
- package/dist/{pull-UYLUGILU.js → pull-O6TLQGAQ.js} +6 -6
- package/dist/{push-HWXJGSTL.js → push-VDADQVA5.js} +6 -6
- package/dist/{require-deps-RUXTMQUV.js → require-deps-MCFEZOIF.js} +3 -3
- package/dist/{stats-DFV24AJW.js → stats-OJEG5W2D.js} +6 -6
- package/dist/{sync-clean-GFX5F55E.js → sync-clean-2BMOFDV7.js} +2 -2
- package/dist/{sync-status-VXMDWDRG.js → sync-status-IN5434DI.js} +6 -6
- package/dist/{tui-ELOJ37ZA.js → tui-DQD26BU6.js} +4 -4
- package/package.json +3 -2
- package/dist/chunk-MQJA7TGY.js.map +0 -1
- package/dist/chunk-RJEPJ4JE.js.map +0 -1
- package/dist/chunk-UQOBOHKN.js.map +0 -1
- package/dist/context-NCV46PTY.js.map +0 -1
- /package/dist/{chunk-ADZ45KHX.js.map → chunk-LOUSTE6C.js.map} +0 -0
- /package/dist/{chunk-WOC2PKT2.js.map → chunk-YF6HCPVY.js.map} +0 -0
- /package/dist/{install-DORMJYCU.js.map → install-MTDWI6RO.js.map} +0 -0
- /package/dist/{pull-UYLUGILU.js.map → pull-O6TLQGAQ.js.map} +0 -0
- /package/dist/{push-HWXJGSTL.js.map → push-VDADQVA5.js.map} +0 -0
- /package/dist/{require-deps-RUXTMQUV.js.map → require-deps-MCFEZOIF.js.map} +0 -0
- /package/dist/{stats-DFV24AJW.js.map → stats-OJEG5W2D.js.map} +0 -0
- /package/dist/{sync-clean-GFX5F55E.js.map → sync-clean-2BMOFDV7.js.map} +0 -0
- /package/dist/{sync-status-VXMDWDRG.js.map → sync-status-IN5434DI.js.map} +0 -0
- /package/dist/{tui-ELOJ37ZA.js.map → tui-DQD26BU6.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/memory/subcommands/context.ts","../src/commands/memory/services/decay-service.ts","../src/commands/memory/services/consolidation-service.ts","../src/commands/memory/utils/mmr.ts","../src/commands/memory/services/injection-service.ts"],"sourcesContent":["import { readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { DecayService } from '../services/decay-service.js';\nimport { ConsolidationService } from '../services/consolidation-service.js';\nimport { InjectionService } from '../services/injection-service.js';\nimport { detectProject } from '../utils/project.js';\nimport { getGitContext } from '../utils/git-context.js';\nimport { initStorage } from './init-storage.js';\n\ninterface ContextOpts {\n readonly json?: boolean;\n readonly dbPath?: string;\n}\n\nconst CONSOLIDATION_FILE = '.last-consolidation';\n\nfunction shouldConsolidate(dataDir: string, intervalDays: number): boolean {\n const checkpointPath = join(dataDir, CONSOLIDATION_FILE);\n try {\n const raw = readFileSync(checkpointPath, 'utf-8').trim();\n const lastRun = parseInt(raw, 10);\n if (isNaN(lastRun)) return true;\n const daysSince = (Date.now() - lastRun) / 86_400_000;\n return daysSince >= intervalDays;\n } catch {\n return true;\n }\n}\n\nfunction markConsolidated(dataDir: string): void {\n writeFileSync(join(dataDir, CONSOLIDATION_FILE), String(Date.now()), 'utf-8');\n}\n\nfunction write(msg: string): void {\n process.stdout.write(msg + '\\n');\n}\n\nexport async function runContext(opts: ContextOpts): Promise<void> {\n const ctx = initStorage(opts.dbPath);\n\n try {\n // Run maintenance (decay + consolidation) before loading context\n try {\n const decayService = new DecayService({\n memoryRepo: ctx.memoryRepo,\n relationRepo: ctx.relationRepo,\n });\n decayService.run();\n\n if (shouldConsolidate(ctx.dataDir, ctx.config.consolidationInterval)) {\n const consolidationService = new ConsolidationService({\n memoryRepo: ctx.memoryRepo,\n relationRepo: ctx.relationRepo,\n });\n await consolidationService.consolidate();\n markConsolidated(ctx.dataDir);\n }\n } catch (err) {\n process.stderr.write(`[agentic-memory] maintenance error: ${err instanceof Error ? err.message : err}\\n`);\n }\n\n const project = detectProject(process.cwd());\n const gitContext = getGitContext();\n\n const injectionService = new InjectionService({\n memoryRepo: ctx.memoryRepo,\n relationRepo: ctx.relationRepo,\n gitContext: gitContext ?? undefined,\n });\n\n const result = injectionService.selectForInjection(\n ctx.config.injectionBudget,\n project ?? undefined,\n );\n\n write(injectionService.formatInjection(result));\n } finally {\n ctx.close();\n }\n}\n","import type { Memory, DecayParams } from '../types.js';\nimport type { MemoryRepo } from '../storage/memory-repo.js';\nimport type { RelationRepo } from '../storage/relation-repo.js';\nimport { DEFAULT_DECAY_PARAMS } from '../config.js';\n\n// ── Types ────────────────────────────────────────────────────\n\nexport interface DecayServiceDeps {\n readonly memoryRepo: MemoryRepo;\n readonly relationRepo: RelationRepo;\n readonly params?: DecayParams;\n}\n\nexport interface DecayReport {\n readonly decayed: number;\n readonly pruned: number;\n readonly workingCleared: number;\n}\n\n// ── Decay Service ────────────────────────────────────────────\n\nexport class DecayService {\n readonly #memoryRepo: MemoryRepo;\n readonly #relationRepo: RelationRepo;\n readonly #params: DecayParams;\n\n constructor(deps: DecayServiceDeps) {\n this.#memoryRepo = deps.memoryRepo;\n this.#relationRepo = deps.relationRepo;\n this.#params = deps.params ?? DEFAULT_DECAY_PARAMS;\n }\n\n /**\n * Run full decay cycle: clear working memories, apply decay, prune dead memories.\n */\n run(): DecayReport {\n const workingCleared = this.clearWorkingMemories();\n const decayed = this.decayAll();\n const pruned = this.prune();\n return { decayed, pruned, workingCleared };\n }\n\n clearWorkingMemories(): number {\n return this.#memoryRepo.deleteByType('working');\n }\n\n /**\n * Apply decay formula to all non-working memories.\n */\n decayAll(): number {\n const memories = this.#memoryRepo.getAll();\n let updated = 0;\n\n for (const memory of memories) {\n if (memory.type === 'working') continue;\n\n const newImportance = this.computeDecayedImportance(memory);\n if (Math.abs(newImportance - memory.importance) > 0.001) {\n this.#memoryRepo.updateImportanceOnly(memory.id, newImportance);\n updated++;\n }\n }\n\n return updated;\n }\n\n /**\n * Hard-delete memories below prune threshold.\n */\n prune(): number {\n const memories = this.#memoryRepo.getAll();\n const now = Date.now();\n let pruned = 0;\n\n for (const memory of memories) {\n if (memory.type === 'working') continue;\n\n const ageDays = (now - new Date(memory.createdAt).getTime()) / (1000 * 60 * 60 * 24);\n if (\n ageDays > this.#params.pruneMinAgeDays &&\n memory.importance < this.#params.pruneThreshold &&\n memory.accessCount === 0\n ) {\n this.#memoryRepo.hardDelete(memory.id);\n pruned++;\n }\n }\n\n return pruned;\n }\n\n /**\n * Compute decayed importance as a pure function of age from creation.\n * Uses createdAt (immutable) to avoid compounding decay across sessions.\n */\n computeDecayedImportance(memory: Memory): number {\n const tau = this.#params.tauByType[memory.type];\n if (tau === 0) return memory.importance;\n\n const ageDays = (Date.now() - new Date(memory.createdAt).getTime()) / (1000 * 60 * 60 * 24);\n if (ageDays < 0) return memory.importance;\n\n // Synaptic consolidation window (days 0-7)\n if (ageDays <= 7) {\n if (memory.type === 'episodic') {\n // Ebbinghaus curve: steep initial drop with residual floor\n const ebbinghaus = Math.exp(-ageDays * 0.7) + 0.2;\n return Math.max(this.#params.importanceFloor, memory.importance * Math.min(1, ebbinghaus));\n }\n return memory.importance;\n }\n\n // Access modifier: logarithmic curve (spacing effect)\n const accessModifier = this.getAccessModifier(memory.accessCount);\n\n // Relation modifier: connected memories decay slower, highly connected near-immune\n const relationCount = this.#relationRepo.countByMemory(memory.id);\n const rm = this.#params.relationModifier;\n const relationModifier = relationCount >= rm.highlyConnectedThreshold\n ? rm.highlyConnectedMultiplier\n : relationCount >= rm.connectedThreshold\n ? rm.connectedMultiplier\n : rm.isolatedMultiplier;\n\n let effectiveTau = tau * accessModifier * relationModifier;\n\n // Injection penalty: surfaced but never used = noise\n if (memory.injectionCount > 5 && memory.accessCount === 0) {\n effectiveTau /= 1.5;\n }\n\n const decayFactor = Math.exp(-(ageDays - 7) / effectiveTau);\n const newImportance = memory.importance * decayFactor;\n\n return Math.max(this.#params.importanceFloor, newImportance);\n }\n\n private getAccessModifier(accessCount: number): number {\n // Logarithmic curve: 1 + log2(1 + count). Smoother than step function.\n // At 0: 1.0, at 3: 2.0, at 10: 3.5, at 30: 5.0\n return 1 + Math.log2(1 + accessCount);\n }\n}\n","import type { MemoryRepo } from '../storage/memory-repo.js';\nimport type { RelationRepo } from '../storage/relation-repo.js';\n\n// ── Types ────────────────────────────────────────────────────\n\nexport interface ConsolidationDeps {\n readonly memoryRepo: MemoryRepo;\n readonly relationRepo: RelationRepo;\n}\n\nexport interface ConsolidationReport {\n readonly deduplicated: number;\n readonly episodicsCompressed: number;\n readonly pruned: number;\n}\n\n// ── Consolidation Service ────────────────────────────────────\n\nexport class ConsolidationService {\n readonly #deps: ConsolidationDeps;\n\n constructor(deps: ConsolidationDeps) {\n this.#deps = deps;\n }\n\n /**\n * Run consolidation pipeline.\n * Phase 1: Deduplicate exact/near-exact content matches\n * Phase 2: Compress old consolidated episodics\n * Phase 3: Prune dead memories\n */\n async consolidate(): Promise<ConsolidationReport> {\n const deduplicated = this.deduplicateMemories();\n const episodicsCompressed = this.compressEpisodics();\n const pruned = this.prune();\n return { deduplicated, episodicsCompressed, pruned };\n }\n\n /**\n * Phase 1: Deduplication via content similarity.\n */\n deduplicateMemories(): number {\n const memories = this.#deps.memoryRepo.getAll();\n const seen = new Set<string>();\n let merged = 0;\n\n for (const memory of memories) {\n if (seen.has(memory.id)) continue;\n\n const normalizedContent = normalizeText(memory.content);\n\n for (const other of memories) {\n if (other.id === memory.id) continue;\n if (seen.has(other.id)) continue;\n\n const otherNormalized = normalizeText(other.content);\n if (normalizedContent !== otherNormalized) continue;\n\n const [keeper, discard] = memory.importance >= other.importance\n ? [memory, other] : [other, memory];\n\n const mergedTags = [...new Set([...keeper.tags, ...discard.tags])];\n this.#deps.memoryRepo.updateContent(keeper.id, {\n tags: mergedTags,\n importance: Math.max(keeper.importance, discard.importance),\n });\n\n this.#deps.memoryRepo.hardDelete(discard.id);\n seen.add(discard.id);\n merged++;\n\n if (discard.id === memory.id) break;\n }\n\n seen.add(memory.id);\n }\n\n return merged;\n }\n\n /**\n * Phase 2: Compress old episodic memories that have been consolidated.\n */\n compressEpisodics(): number {\n const episodics = this.#deps.memoryRepo.getByType('episodic');\n const now = Date.now();\n let compressed = 0;\n\n for (const memory of episodics) {\n const ageDays = (now - new Date(memory.createdAt).getTime()) / (1000 * 60 * 60 * 24);\n if (ageDays <= 60) continue;\n if (memory.accessCount > 0) continue;\n if (memory.importance >= 0.2) continue;\n\n const relations = this.#deps.relationRepo.getBySource(memory.id);\n const isConsolidated = relations.some(r => r.relationType === 'derived_from');\n if (!isConsolidated) continue;\n\n this.#deps.memoryRepo.hardDelete(memory.id);\n compressed++;\n }\n\n return compressed;\n }\n\n /**\n * Phase 3: Prune dead memories.\n */\n prune(): number {\n const memories = this.#deps.memoryRepo.getAll();\n const now = Date.now();\n let pruned = 0;\n\n for (const memory of memories) {\n if (memory.type === 'working') continue;\n const ageDays = (now - new Date(memory.createdAt).getTime()) / (1000 * 60 * 60 * 24);\n if (ageDays > 90 && memory.importance < 0.1 && memory.accessCount === 0) {\n this.#deps.memoryRepo.hardDelete(memory.id);\n pruned++;\n }\n }\n\n return pruned;\n }\n}\n\n// ── Helpers ──────────────────────────────────────────────────\n\nfunction normalizeText(text: string): string {\n return text.toLowerCase().replace(/\\s+/g, ' ').trim();\n}\n","import type { Memory } from \"../types.js\";\nimport { extractKeywords, jaccardOverlap } from \"./similarity.js\";\n\n// ── MMR (Maximal Marginal Relevance) ───────────────────────────\n// Carbonell & Goldstein (1998). Re-ranks a relevance-sorted list\n// by penalizing candidates too similar to already-selected items.\n// Same relevance budget, more topic coverage per slot.\n//\n// MMR(c) = λ · Rel(c) − (1 − λ) · max_{s ∈ S} Sim(c, s)\n//\n// λ=1 preserves pure relevance order. λ=0 maximizes diversity.\n\nexport interface MMRScored {\n readonly memory: Memory;\n readonly score: number;\n}\n\nexport interface MMROptions {\n readonly lambda: number;\n readonly maxRerank: number;\n readonly contentWeight: number;\n readonly tagsWeight: number;\n}\n\ninterface Features {\n readonly content: ReadonlySet<string>;\n readonly tags: ReadonlySet<string>;\n}\n\nfunction featuresOf(memory: Memory): Features {\n return {\n content: extractKeywords(memory.content),\n tags: new Set(memory.tags),\n };\n}\n\nfunction blendedSimilarity(\n a: Features,\n b: Features,\n contentWeight: number,\n tagsWeight: number,\n): number {\n return (\n jaccardOverlap(a.content, b.content) * contentWeight\n + jaccardOverlap(a.tags, b.tags) * tagsWeight\n );\n}\n\nexport function applyMMR<T extends MMRScored>(\n scored: readonly T[],\n options: MMROptions,\n): readonly T[] {\n if (scored.length <= 1) return scored;\n\n const { lambda, maxRerank, contentWeight, tagsWeight } = options;\n const rerankCount = Math.min(scored.length, maxRerank);\n const pool = scored.slice(0, rerankCount);\n const tail = scored.slice(rerankCount);\n\n const features = new Map<string, Features>();\n for (const s of pool) {\n features.set(s.memory.id, featuresOf(s.memory));\n }\n\n const remaining = new Set(pool.map((s) => s.memory.id));\n const selected: T[] = [];\n\n while (remaining.size > 0) {\n let best: T | null = null;\n let bestMMR = -Infinity;\n\n for (const candidate of pool) {\n if (!remaining.has(candidate.memory.id)) continue;\n\n const candFeat = features.get(candidate.memory.id);\n if (!candFeat) continue;\n\n let maxSim = 0;\n for (const picked of selected) {\n const pickedFeat = features.get(picked.memory.id);\n if (!pickedFeat) continue;\n const sim = blendedSimilarity(candFeat, pickedFeat, contentWeight, tagsWeight);\n if (sim > maxSim) maxSim = sim;\n }\n\n const mmr = lambda * candidate.score - (1 - lambda) * maxSim;\n if (mmr > bestMMR) {\n bestMMR = mmr;\n best = candidate;\n }\n }\n\n if (!best) break;\n selected.push(best);\n remaining.delete(best.memory.id);\n }\n\n return [...selected, ...tail];\n}\n","import type { MemoryRepo } from \"../storage/memory-repo.js\";\nimport type { RelationRepo } from \"../storage/relation-repo.js\";\nimport type { Memory } from \"../types.js\";\nimport {\n estimateTokens,\n DEFAULT_DECAY_PARAMS,\n INJECTION_WEIGHTS as W,\n TYPE_INJECTION_BONUS,\n RECENCY_HALF_LIFE,\n INJECTION_MIN_SCORE,\n INJECTION_COLD_START_THRESHOLD,\n INJECTION_COLD_START_RAMP_END,\n INJECTION_HEADER_TOKENS,\n INJECTION_MAX_SAME_TYPE_FULL,\n INJECTION_PINNED_BUDGET_PCT,\n INJECTION_PINNED_IMPORTANCE,\n INJECTION_MMR_LAMBDA,\n INJECTION_MMR_MAX_RERANK,\n INJECTION_MMR_SIM_WEIGHTS,\n} from \"../config.js\";\nimport { computeContextScore, type GitContext } from \"../utils/git-context.js\";\nimport { applyMMR } from \"../utils/mmr.js\";\n\n// ── Types ──────────────────────────────────────────────────────\n\nexport type InjectionTier = \"full\" | \"summary\" | \"index\";\n\nexport interface ScoredMemory {\n readonly memory: Memory;\n readonly score: number;\n readonly tier: InjectionTier;\n readonly tokenCost: number;\n}\n\nexport interface InjectionResult {\n readonly memories: readonly ScoredMemory[];\n readonly tokensUsed: number;\n readonly tokenBudget: number;\n readonly totalCount: number;\n}\n\ninterface InjectionDeps {\n readonly memoryRepo: MemoryRepo;\n readonly relationRepo: RelationRepo;\n readonly gitContext?: GitContext;\n}\n\n// ── Service ────────────────────────────────────────────────────\n\nexport class InjectionService {\n readonly #deps: InjectionDeps;\n\n constructor(deps: InjectionDeps) {\n this.#deps = deps;\n }\n\n selectForInjection(tokenBudget: number, project?: string): InjectionResult {\n const allMemories = this.#deps.memoryRepo.getAll(project);\n const totalCount = allMemories.length;\n\n // Gate: skip working memories and below-floor importance\n const candidates = allMemories.filter(\n (m) => m.type !== \"working\" && m.importance >= DEFAULT_DECAY_PARAMS.importanceFloor,\n );\n\n if (candidates.length === 0) {\n return { memories: [], tokensUsed: 0, tokenBudget, totalCount };\n }\n\n // Cold start: smooth ramp from 0.10 to INJECTION_MIN_SCORE\n const minScore = candidates.length <= INJECTION_COLD_START_THRESHOLD\n ? 0.10\n : candidates.length <= INJECTION_COLD_START_RAMP_END\n ? 0.10 + (INJECTION_MIN_SCORE - 0.10) * (candidates.length - INJECTION_COLD_START_THRESHOLD) / (INJECTION_COLD_START_RAMP_END - INJECTION_COLD_START_THRESHOLD)\n : INJECTION_MIN_SCORE;\n\n // Score all candidates\n const scored = candidates\n .map((m) => ({ memory: m, score: this.#scoreMemory(m) }))\n .filter((s) => s.score >= minScore)\n .sort((a, b) => b.score - a.score);\n\n // MMR diversity re-ranking on non-pinned pool; pinned keep relevance order\n // so oracle-preferred high-importance memories are not demoted by duplicates.\n const pinned = scored.filter((s) => s.memory.importance >= INJECTION_PINNED_IMPORTANCE);\n const nonPinned = scored.filter((s) => s.memory.importance < INJECTION_PINNED_IMPORTANCE);\n const diversified = applyMMR(nonPinned, {\n lambda: INJECTION_MMR_LAMBDA,\n maxRerank: INJECTION_MMR_MAX_RERANK,\n contentWeight: INJECTION_MMR_SIM_WEIGHTS.content,\n tagsWeight: INJECTION_MMR_SIM_WEIGHTS.tags,\n });\n const ordered = [...pinned, ...diversified];\n\n // Greedy token-budget packing with tier assignment\n return this.#packBudget(ordered, tokenBudget, totalCount);\n }\n\n formatInjection(result: InjectionResult): string {\n const { memories, tokensUsed, tokenBudget, totalCount } = result;\n\n if (memories.length === 0) {\n return \"No memories stored for this project. Use memory_store to save knowledge across sessions.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Agentic Memory (${memories.length} of ${totalCount} memories, ${tokensUsed}/${tokenBudget} tokens)`);\n lines.push(\"Use memory_search to retrieve full content for any memory listed here.\\n\");\n\n const full = memories.filter((m) => m.tier === \"full\");\n const summary = memories.filter((m) => m.tier === \"summary\");\n const index = memories.filter((m) => m.tier === \"index\");\n\n if (full.length > 0) {\n lines.push(\"## Key Memories\");\n for (const { memory: m } of full) {\n lines.push(`### ${m.title ?? \"(untitled)\"} [${m.type}]`);\n lines.push(m.content.slice(0, 500));\n if (m.tags.length > 0) lines.push(`Tags: ${m.tags.join(\", \")}`);\n lines.push(\"\");\n }\n }\n\n if (summary.length > 0) {\n lines.push(\"## Related Memories\");\n for (const { memory: m } of summary) {\n const snippet = m.content.slice(0, 350);\n const ellipsis = m.content.length > 350 ? \"...\" : \"\";\n lines.push(`- **${m.title ?? \"(untitled)\"}** [${m.type}]: ${snippet}${ellipsis}`);\n }\n lines.push(\"\");\n }\n\n if (index.length > 0) {\n lines.push(\"## Also Available (use memory_search)\");\n for (const { memory: m } of index) {\n lines.push(`- ${m.id.slice(0, 8)} ${m.title ?? \"(untitled)\"} [${m.type}]`);\n }\n }\n\n return lines.join(\"\\n\");\n }\n\n // ── Scoring ────────────────────────────────────────────────\n\n #scoreMemory(memory: Memory): number {\n const hasGit = !!this.#deps.gitContext;\n const ctx = hasGit ? this.#contextRelevance(memory) : 0;\n const val = this.#valueSignal(memory);\n const imp = memory.importance;\n const rec = this.#recencyScore(memory);\n const typ = TYPE_INJECTION_BONUS[memory.type] ?? 0.5;\n const noise = this.#noisePenalty(memory);\n const branch = this.#branchHeuristic(memory);\n\n // Redistribute context weight when git is unavailable\n if (!hasGit) {\n return (\n val * (W.value + W.context * 0.4) +\n imp * (W.importance + W.context * 0.3) +\n rec * (W.recency + W.context * 0.3) +\n typ * W.typeBonus +\n noise * W.noise\n );\n }\n\n return (\n ctx * W.context +\n val * W.value +\n imp * W.importance +\n rec * W.recency +\n typ * W.typeBonus +\n noise * W.noise +\n branch * 0.05\n );\n }\n\n #contextRelevance(memory: Memory): number {\n if (!this.#deps.gitContext) return 0;\n return computeContextScore(memory.context, this.#deps.gitContext, \"\");\n }\n\n #branchHeuristic(memory: Memory): number {\n if (!this.#deps.gitContext?.branch) return 0;\n const branch = this.#deps.gitContext.branch.toLowerCase();\n if (branch.startsWith('fix/') || branch.startsWith('bugfix/')) {\n return memory.type === 'pattern' ? 1.0 : memory.type === 'episodic' ? 0.5 : 0;\n }\n if (branch.startsWith('feat/') || branch.startsWith('feature/')) {\n return memory.type === 'procedural' ? 1.0 : memory.type === 'semantic' ? 0.5 : 0;\n }\n return 0;\n }\n\n #valueSignal(memory: Memory): number {\n const { accessCount, injectionCount } = memory;\n\n // Never injected or accessed: neutral — give it a chance\n if (accessCount === 0 && injectionCount === 0) return 0.5;\n\n // Injected but never accessed: noise\n if (injectionCount > 0 && accessCount === 0) {\n return Math.max(0.0, 0.5 - Math.min(1.0, injectionCount / 10) * 0.5);\n }\n\n // Access-to-injection ratio\n const ratio = Math.min(1.0, accessCount / Math.max(1, injectionCount));\n return 0.4 + ratio * 0.6;\n }\n\n #recencyScore(memory: Memory): number {\n const halfLife = RECENCY_HALF_LIFE[memory.type] ?? 30;\n const ageDays = (Date.now() - new Date(memory.updatedAt).getTime()) / 86_400_000;\n return Math.exp(-ageDays * Math.LN2 / halfLife);\n }\n\n #noisePenalty(memory: Memory): number {\n if (memory.injectionCount <= 3) return 1.0; // no penalty for first 3\n if (memory.accessCount > 0) return 1.0; // any access = useful\n return Math.max(0.2, 1.0 - Math.log2(memory.injectionCount - 2) * 0.15);\n }\n\n // ── Token Budget Packing ───────────────────────────────────\n\n #packBudget(\n scored: readonly { readonly memory: Memory; readonly score: number }[],\n tokenBudget: number,\n totalCount: number,\n ): InjectionResult {\n const selected: ScoredMemory[] = [];\n let tokensUsed = INJECTION_HEADER_TOKENS;\n const fullTypeCount = new Map<string, number>();\n\n // Phase 1: pinned memories get guaranteed slots\n const pinnedBudget = INJECTION_HEADER_TOKENS + Math.floor(tokenBudget * INJECTION_PINNED_BUDGET_PCT);\n for (const { memory, score } of scored) {\n if (memory.importance < INJECTION_PINNED_IMPORTANCE || tokensUsed >= pinnedBudget) continue;\n const cost = this.#estimateTierTokens(memory, \"full\");\n if (tokensUsed + cost > pinnedBudget) continue;\n selected.push({ memory, score, tier: \"full\", tokenCost: cost });\n tokensUsed += cost;\n this.#bumpTypeCount(fullTypeCount, memory.type);\n }\n\n // Phase 2: remaining memories packed by score\n for (const { memory, score } of scored) {\n if (tokensUsed >= tokenBudget) break;\n if (selected.some((s) => s.memory.id === memory.id)) continue;\n tokensUsed = this.#tryPack(memory, score, tokenBudget, tokensUsed, selected, fullTypeCount);\n }\n\n for (const entry of selected) {\n this.#deps.memoryRepo.incrementInjection(entry.memory.id);\n }\n return { memories: selected, tokensUsed, tokenBudget, totalCount };\n }\n\n #tryPack(\n memory: Memory, score: number, tokenBudget: number, tokensUsed: number,\n selected: ScoredMemory[], fullTypeCount: Map<string, number>,\n ): number {\n const remaining = tokenBudget - tokensUsed;\n let tier = this.#assignTier(score, selected.length, remaining);\n\n if (tier === 'full' && (fullTypeCount.get(memory.type) ?? 0) >= INJECTION_MAX_SAME_TYPE_FULL) {\n tier = 'summary';\n }\n\n const cost = this.#estimateTierTokens(memory, tier);\n if (tokensUsed + cost <= tokenBudget) {\n selected.push({ memory, score, tier, tokenCost: cost });\n if (tier === 'full') this.#bumpTypeCount(fullTypeCount, memory.type);\n return tokensUsed + cost;\n }\n\n const demoted = tier === \"full\" ? \"summary\" as const : tier === \"summary\" ? \"index\" as const : null;\n if (!demoted) return tokensUsed;\n const demotedCost = this.#estimateTierTokens(memory, demoted);\n if (tokensUsed + demotedCost <= tokenBudget) {\n selected.push({ memory, score, tier: demoted, tokenCost: demotedCost });\n return tokensUsed + demotedCost;\n }\n return tokensUsed;\n }\n\n #bumpTypeCount(counts: Map<string, number>, type: string): void {\n counts.set(type, (counts.get(type) ?? 0) + 1);\n }\n\n #assignTier(score: number, position: number, remainingBudget: number): InjectionTier {\n if (position < 3 && score >= 0.60 && remainingBudget > 200) return \"full\";\n if (position < 8 && score >= 0.35 && remainingBudget > 80) return \"summary\";\n return \"index\";\n }\n\n #estimateTierTokens(memory: Memory, tier: InjectionTier): number {\n const meta = `[${memory.type}] ${memory.title ?? \"\"} (${memory.tags.join(\", \")})`;\n switch (tier) {\n case \"full\":\n return estimateTokens(memory.content.slice(0, 500)) + estimateTokens(meta) + 10;\n case \"summary\":\n return estimateTokens(memory.content.slice(0, 350)) + estimateTokens(meta) + 8;\n case \"index\":\n return estimateTokens(`${memory.id.slice(0, 8)} [${memory.type}] ${memory.title ?? \"(untitled)\"}`) + 4;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc,qBAAqB;AAC5C,SAAS,YAAY;;;ACoBd,IAAM,eAAN,MAAmB;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAwB;AAClC,SAAK,cAAc,KAAK;AACxB,SAAK,gBAAgB,KAAK;AAC1B,SAAK,UAAU,KAAK,UAAU;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAmB;AACjB,UAAM,iBAAiB,KAAK,qBAAqB;AACjD,UAAM,UAAU,KAAK,SAAS;AAC9B,UAAM,SAAS,KAAK,MAAM;AAC1B,WAAO,EAAE,SAAS,QAAQ,eAAe;AAAA,EAC3C;AAAA,EAEA,uBAA+B;AAC7B,WAAO,KAAK,YAAY,aAAa,SAAS;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA,EAKA,WAAmB;AACjB,UAAM,WAAW,KAAK,YAAY,OAAO;AACzC,QAAI,UAAU;AAEd,eAAW,UAAU,UAAU;AAC7B,UAAI,OAAO,SAAS,UAAW;AAE/B,YAAM,gBAAgB,KAAK,yBAAyB,MAAM;AAC1D,UAAI,K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AAc,IAAI;AAAA,MAClB,YAAY,cAAc;AAAA,IAC5B,CAAC;AAED,UAAM,SAAS,iBAAiB;AAAA,MAC9B,IAAI,OAAO;AAAA,MACX,WAAW;AAAA,IACb;AAEA,UAAM,iBAAiB,gBAAgB,MAAM,CAAC;AAAA,EAChD,UAAE;AACA,QAAI,MAAM;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
loadConfig,
|
|
6
6
|
migrate,
|
|
7
7
|
resolveDataDir
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-WUJWETUJ.js";
|
|
9
|
+
import "./chunk-YF6HCPVY.js";
|
|
10
10
|
import {
|
|
11
11
|
getMemoryPlacement,
|
|
12
12
|
log,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readSettingsLocalJson,
|
|
15
15
|
writeSettingsJson,
|
|
16
16
|
writeSettingsLocalJson
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GLFJ2B43.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/memory/subcommands/install.ts
|
|
20
20
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -181,7 +181,7 @@ function addToolPermissions(settings) {
|
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
async function ensureNativeDeps() {
|
|
184
|
-
const { cwdRequire } = await import("./require-deps-
|
|
184
|
+
const { cwdRequire } = await import("./require-deps-MCFEZOIF.js");
|
|
185
185
|
try {
|
|
186
186
|
cwdRequire("better-sqlite3");
|
|
187
187
|
return;
|
|
@@ -308,4 +308,4 @@ export {
|
|
|
308
308
|
detectExistingSetup,
|
|
309
309
|
runInstall
|
|
310
310
|
};
|
|
311
|
-
//# sourceMappingURL=install-
|
|
311
|
+
//# sourceMappingURL=install-MTDWI6RO.js.map
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
} from "./chunk-NAW47BYA.js";
|
|
18
18
|
import {
|
|
19
19
|
initStorage
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LOUSTE6C.js";
|
|
21
21
|
import "./chunk-DXDOVWOA.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-WUJWETUJ.js";
|
|
23
|
+
import "./chunk-YF6HCPVY.js";
|
|
24
24
|
import {
|
|
25
25
|
log
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GLFJ2B43.js";
|
|
27
27
|
|
|
28
28
|
// src/commands/memory/subcommands/pull.ts
|
|
29
29
|
async function runPull(opts) {
|
|
@@ -33,7 +33,7 @@ async function runPull(opts) {
|
|
|
33
33
|
log.error("No sync gist found. Run `memory push` first.");
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
36
|
+
const { requireMemoryDeps } = await import("./require-deps-MCFEZOIF.js");
|
|
37
37
|
await requireMemoryDeps();
|
|
38
38
|
const ctx = initStorage();
|
|
39
39
|
try {
|
|
@@ -137,4 +137,4 @@ function printResult(result, project) {
|
|
|
137
137
|
export {
|
|
138
138
|
runPull
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=pull-
|
|
140
|
+
//# sourceMappingURL=pull-O6TLQGAQ.js.map
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
} from "./chunk-NAW47BYA.js";
|
|
20
20
|
import {
|
|
21
21
|
initStorage
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LOUSTE6C.js";
|
|
23
23
|
import "./chunk-DXDOVWOA.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-WUJWETUJ.js";
|
|
25
|
+
import "./chunk-YF6HCPVY.js";
|
|
26
26
|
import {
|
|
27
27
|
log
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-GLFJ2B43.js";
|
|
29
29
|
|
|
30
30
|
// src/commands/memory/subcommands/push.ts
|
|
31
31
|
import { hostname } from "os";
|
|
@@ -50,7 +50,7 @@ function filterRelations(allRelations, memoryIds) {
|
|
|
50
50
|
}
|
|
51
51
|
async function runPush(opts) {
|
|
52
52
|
assertGhAvailable();
|
|
53
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
53
|
+
const { requireMemoryDeps } = await import("./require-deps-MCFEZOIF.js");
|
|
54
54
|
await requireMemoryDeps();
|
|
55
55
|
const ctx = initStorage();
|
|
56
56
|
try {
|
|
@@ -171,4 +171,4 @@ async function confirmCreate() {
|
|
|
171
171
|
export {
|
|
172
172
|
runPush
|
|
173
173
|
};
|
|
174
|
-
//# sourceMappingURL=push-
|
|
174
|
+
//# sourceMappingURL=push-VDADQVA5.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
cwdRequire,
|
|
4
4
|
requireMemoryDeps
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-YF6HCPVY.js";
|
|
6
|
+
import "./chunk-GLFJ2B43.js";
|
|
7
7
|
export {
|
|
8
8
|
cwdRequire,
|
|
9
9
|
requireMemoryDeps
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=require-deps-
|
|
11
|
+
//# sourceMappingURL=require-deps-MCFEZOIF.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
initStorage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LOUSTE6C.js";
|
|
5
5
|
import "./chunk-DXDOVWOA.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-WUJWETUJ.js";
|
|
7
|
+
import "./chunk-YF6HCPVY.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GLFJ2B43.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/memory/subcommands/stats.ts
|
|
13
13
|
import { existsSync, statSync } from "fs";
|
|
@@ -18,7 +18,7 @@ function formatBytes(bytes) {
|
|
|
18
18
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
19
19
|
}
|
|
20
20
|
async function runStats(opts) {
|
|
21
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
21
|
+
const { requireMemoryDeps } = await import("./require-deps-MCFEZOIF.js");
|
|
22
22
|
await requireMemoryDeps();
|
|
23
23
|
const ctx = initStorage(opts.dbPath);
|
|
24
24
|
try {
|
|
@@ -72,4 +72,4 @@ async function runStats(opts) {
|
|
|
72
72
|
export {
|
|
73
73
|
runStats
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=stats-
|
|
75
|
+
//# sourceMappingURL=stats-OJEG5W2D.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-3UJYOWGF.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GLFJ2B43.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/memory/subcommands/sync-clean.ts
|
|
15
15
|
import { confirm } from "@inquirer/prompts";
|
|
@@ -50,4 +50,4 @@ async function runSyncClean(project, opts) {
|
|
|
50
50
|
export {
|
|
51
51
|
runSyncClean
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=sync-clean-
|
|
53
|
+
//# sourceMappingURL=sync-clean-2BMOFDV7.js.map
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
import "./chunk-YZ53W47Z.js";
|
|
13
13
|
import {
|
|
14
14
|
initStorage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LOUSTE6C.js";
|
|
16
16
|
import "./chunk-DXDOVWOA.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-WUJWETUJ.js";
|
|
18
|
+
import "./chunk-YF6HCPVY.js";
|
|
19
19
|
import {
|
|
20
20
|
log
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GLFJ2B43.js";
|
|
22
22
|
|
|
23
23
|
// src/commands/memory/subcommands/sync-status.ts
|
|
24
24
|
async function runSyncStatus() {
|
|
@@ -28,7 +28,7 @@ async function runSyncStatus() {
|
|
|
28
28
|
log.error("No sync gist found. Run `memory push` first.");
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
31
|
+
const { requireMemoryDeps } = await import("./require-deps-MCFEZOIF.js");
|
|
32
32
|
await requireMemoryDeps();
|
|
33
33
|
const ctx = initStorage();
|
|
34
34
|
try {
|
|
@@ -67,4 +67,4 @@ async function runSyncStatus() {
|
|
|
67
67
|
export {
|
|
68
68
|
runSyncStatus
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=sync-status-
|
|
70
|
+
//# sourceMappingURL=sync-status-IN5434DI.js.map
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
loadConfig,
|
|
12
12
|
migrate,
|
|
13
13
|
resolveDataDir
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-WUJWETUJ.js";
|
|
15
|
+
import "./chunk-YF6HCPVY.js";
|
|
16
|
+
import "./chunk-GLFJ2B43.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/memory/dashboard/tui.tsx
|
|
19
19
|
import { render } from "ink";
|
|
@@ -1306,4 +1306,4 @@ async function startTui(options) {
|
|
|
1306
1306
|
export {
|
|
1307
1307
|
startTui
|
|
1308
1308
|
};
|
|
1309
|
-
//# sourceMappingURL=tui-
|
|
1309
|
+
//# sourceMappingURL=tui-DQD26BU6.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-launchpad",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "CLI toolkit for Claude Code — scaffold CLAUDE.md, diagnose config, enforce hooks, test with eval, add persistent memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"start": "tsx src/cli.ts",
|
|
13
13
|
"test": "vitest",
|
|
14
14
|
"test:run": "vitest run",
|
|
15
|
-
"lint": "eslint src/ --ext .ts",
|
|
16
15
|
"typecheck": "tsc --noEmit",
|
|
17
16
|
"prepublishOnly": "pnpm build",
|
|
18
17
|
"publish:dev": "npm version prerelease --preid=dev --no-git-tag-version && node scripts/sync-version.mjs && npm publish --tag dev",
|
|
@@ -67,6 +66,7 @@
|
|
|
67
66
|
"chalk": "^5.6.2",
|
|
68
67
|
"commander": "^14.0.3",
|
|
69
68
|
"ora": "^9.3.0",
|
|
69
|
+
"shell-quote": "^1.8.3",
|
|
70
70
|
"yaml": "^2.8.3"
|
|
71
71
|
},
|
|
72
72
|
"optionalDependencies": {
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"@types/better-sqlite3": "^7.6.12",
|
|
84
84
|
"@types/node": "^25.5.0",
|
|
85
85
|
"@types/react": "^19.2.14",
|
|
86
|
+
"@types/shell-quote": "^1.7.5",
|
|
86
87
|
"better-sqlite3": "^11.10.0",
|
|
87
88
|
"sqlite-vec": "^0.1.9",
|
|
88
89
|
"tsup": "^8.5.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/memory/utils/git-context.ts"],"sourcesContent":["import { execSync } from 'node:child_process';\n\nexport interface GitContext {\n readonly branch: string | null;\n readonly recentFiles: readonly string[];\n}\n\nlet cached: GitContext | null = null;\n\nexport function getGitContext(): GitContext {\n if (cached) return cached;\n\n let branch: string | null = null;\n let recentFiles: string[] = [];\n\n try {\n branch = execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf-8', timeout: 3000 }).trim() || null;\n } catch { /* not in a git repo or git not available */ }\n\n try {\n const raw = execSync('git diff --name-only HEAD~5', { encoding: 'utf-8', timeout: 3000 }).trim();\n recentFiles = raw ? raw.split('\\n').filter(Boolean) : [];\n } catch { /* shallow clone or no commits */ }\n\n cached = { branch, recentFiles };\n return cached;\n}\n\nexport function clearGitContextCache(): void {\n cached = null;\n}\n\nexport function computeContextScore(\n storedContext: string | null,\n currentContext: GitContext,\n query: string,\n): number {\n if (!storedContext) return 0;\n\n let parsed: { files?: string[]; branch?: string; intent?: string };\n try {\n parsed = JSON.parse(storedContext) as { files?: string[]; branch?: string; intent?: string };\n } catch {\n return 0;\n }\n\n // Branch match (weight 0.4)\n const branchScore = (parsed.branch && currentContext.branch && parsed.branch === currentContext.branch) ? 1.0 : 0;\n\n // File overlap — Jaccard similarity (weight 0.4)\n let fileScore = 0;\n if (parsed.files?.length && currentContext.recentFiles.length) {\n const stored = new Set(parsed.files);\n const current = new Set(currentContext.recentFiles);\n let intersection = 0;\n for (const f of stored) {\n if (current.has(f)) intersection++;\n }\n const union = stored.size + current.size - intersection;\n fileScore = union > 0 ? intersection / union : 0;\n }\n\n // Intent keyword overlap with query (weight 0.2)\n let intentScore = 0;\n if (parsed.intent && query) {\n const intentWords = new Set(parsed.intent.toLowerCase().split(/\\s+/).filter(Boolean));\n const queryWords = new Set(query.toLowerCase().split(/\\s+/).filter(Boolean));\n let overlap = 0;\n for (const w of intentWords) {\n if (queryWords.has(w)) overlap++;\n }\n const union = intentWords.size + queryWords.size - overlap;\n intentScore = union > 0 ? overlap / union : 0;\n }\n\n return branchScore * 0.4 + fileScore * 0.4 + intentScore * 0.2;\n}\n"],"mappings":";;;AAAA,SAAS,gBAAgB;AAOzB,IAAI,SAA4B;AAEzB,SAAS,gBAA4B;AAC1C,MAAI,OAAQ,QAAO;AAEnB,MAAI,SAAwB;AAC5B,MAAI,cAAwB,CAAC;AAE7B,MAAI;AACF,aAAS,SAAS,mCAAmC,EAAE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,YAAY,OAAO,WAAW,OAAO;AACnD,kBAAc,QAAQ,IAAI,UAAU,QAAQ;AAAA,EAC9C;AAEA,SAAO,cAAc,MAAM,YAAY,MAAM,cAAc;AAC7D;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/memory/config.ts","../src/commands/memory/storage/database.ts","../src/commands/memory/storage/migrations/001-initial.ts","../src/commands/memory/storage/migrations/002-add-project.ts","../src/commands/memory/storage/migrations/003-add-content-hash.ts","../src/commands/memory/storage/migrations/004-add-tombstones.ts","../src/commands/memory/storage/migrator.ts"],"sourcesContent":["import { z } from 'zod';\nimport { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { homedir } from 'node:os';\nimport type { DecayParams } from './types.js';\n\n// ── Config Schema ─────────────────────────────────────────────\n\nconst ConfigSchema = z.object({\n dataDir: z.string().default('~/.agentic-memory'),\n injectionBudget: z.number().int().min(100).max(20000).default(3000),\n consolidationInterval: z.number().int().min(1).default(10),\n enableReranker: z.boolean().default(true),\n logLevel: z.enum(['debug', 'info', 'warn', 'error']).default('warn'),\n});\n\nexport type Config = z.infer<typeof ConfigSchema>;\n\n// ── Defaults ──────────────────────────────────────────────────\n\nexport const DEFAULT_CONFIG: Config = {\n dataDir: '~/.agentic-memory',\n injectionBudget: 3000,\n consolidationInterval: 10,\n enableReranker: true,\n logLevel: 'warn',\n};\n\nexport const DEFAULT_DECAY_PARAMS: DecayParams = {\n tauByType: {\n working: 0, // cleared each session, tau irrelevant\n episodic: 30, // fast decay (was 60, cognitive science: unrehearsed episodes fade in ~30d)\n semantic: 540, // slow decay (was 365, extracted facts are stable for years)\n procedural: 730, // near-permanent\n pattern: 180, // medium decay\n },\n accessModifiers: [\n { maxCount: 3, multiplier: 1.0 },\n { maxCount: 10, multiplier: 2.0 },\n { maxCount: Infinity, multiplier: 4.0 },\n ],\n relationModifier: {\n connectedThreshold: 3,\n connectedMultiplier: 1.8, // higher tau = slower decay for connected memories\n isolatedMultiplier: 0.8, // lower tau = slightly faster decay for isolated memories\n highlyConnectedThreshold: 6,\n highlyConnectedMultiplier: 2.5, // near-immune: ~2.5x longer effective half-life\n },\n importanceFloor: 0.05,\n pruneThreshold: 0.1,\n pruneMinAgeDays: 90,\n};\n\nexport const SCORING_WEIGHTS = {\n text: 0.35,\n importance: 0.20,\n recency: 0.20,\n access: 0.10,\n context: 0.15,\n} as const;\n\n// ── Injection Algorithm Constants ──────────────────────────────\n\nexport const INJECTION_WEIGHTS = {\n context: 0.30,\n value: 0.25,\n importance: 0.20,\n recency: 0.15,\n typeBonus: 0.05,\n noise: 0.05,\n} as const;\n\nexport const TYPE_INJECTION_BONUS: Record<string, number> = {\n procedural: 1.0,\n pattern: 0.8,\n semantic: 0.6,\n episodic: 0.3,\n working: 0.0,\n};\n\nexport const RECENCY_HALF_LIFE: Record<string, number> = {\n working: 1,\n episodic: 7,\n pattern: 14,\n semantic: 30,\n procedural: 90,\n};\n\nexport const INJECTION_MIN_SCORE = 0.25;\nexport const INJECTION_COLD_START_THRESHOLD = 5;\nexport const INJECTION_COLD_START_RAMP_END = 20;\nexport const INJECTION_HEADER_TOKENS = 50;\nexport const INJECTION_MAX_SAME_TYPE_FULL = 2;\nexport const INJECTION_PINNED_BUDGET_PCT = 0.10;\n\n// ── Config Loader ─────────────────────────────────────────────\n\nexport function resolveDataDir(dataDir: string): string {\n if (dataDir.startsWith('~')) {\n return join(homedir(), dataDir.slice(1));\n }\n return dataDir;\n}\n\nexport function loadConfig(overrides?: Partial<Config>): Config {\n const envOverrides: Record<string, unknown> = {};\n\n const envBudget = process.env['AGENTIC_MEMORY_INJECTION_BUDGET'];\n if (envBudget !== undefined) {\n envOverrides['injectionBudget'] = parseInt(envBudget, 10);\n }\n\n const envLogLevel = process.env['AGENTIC_MEMORY_LOG_LEVEL'];\n if (envLogLevel !== undefined) {\n envOverrides['logLevel'] = envLogLevel;\n }\n\n const envDataDir = process.env['AGENTIC_MEMORY_DATA_DIR'];\n if (envDataDir !== undefined) {\n envOverrides['dataDir'] = envDataDir;\n }\n\n // Try loading config.json from data dir\n let fileConfig: Record<string, unknown> = {};\n const baseDir = resolveDataDir(overrides?.dataDir ?? envOverrides['dataDir'] as string ?? DEFAULT_CONFIG.dataDir);\n try {\n const raw = readFileSync(join(baseDir, 'config.json'), 'utf-8');\n fileConfig = JSON.parse(raw) as Record<string, unknown>;\n } catch (err) {\n const isNotFound = err instanceof Error && 'code' in err && (err as NodeJS.ErrnoException).code === 'ENOENT';\n if (!isNotFound) {\n // Malformed JSON or permissions error - warn, don't silently ignore\n console.error('[agentic-memory] Failed to load config.json:', err instanceof Error ? err.message : err);\n }\n }\n\n const merged = { ...DEFAULT_CONFIG, ...fileConfig, ...envOverrides, ...overrides };\n return ConfigSchema.parse(merged);\n}\n\n// ── Token Estimation ──────────────────────────────────────────\n\nexport function estimateTokens(text: string): number {\n return Math.ceil(text.length / 4);\n}\n","import type DatabaseConstructor from 'better-sqlite3';\nimport { resolveDataDir } from '../config.js';\nimport { mkdirSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { cwdRequire } from '../utils/require-deps.js';\n\nexport interface DatabaseOptions {\n readonly dbPath?: string; // full path override (e.g. ':memory:' for tests)\n readonly dataDir?: string; // resolved data dir (default ~/.agentic-memory)\n}\n\nexport function createDatabase(options: DatabaseOptions = {}): DatabaseConstructor.Database {\n const dbPath = options.dbPath ?? resolveDbPath(options.dataDir);\n\n if (dbPath !== ':memory:') {\n mkdirSync(dirname(dbPath), { recursive: true });\n }\n\n const Database = cwdRequire('better-sqlite3') as typeof DatabaseConstructor;\n const sqliteVec = cwdRequire('sqlite-vec') as { load: (db: DatabaseConstructor.Database) => void };\n\n const db = new Database(dbPath);\n\n // Load sqlite-vec extension\n sqliteVec.load(db);\n\n // Configure PRAGMAs (order matters: foreign_keys before any ops, journal_mode is persistent)\n db.pragma('journal_mode = WAL');\n db.pragma('busy_timeout = 5000');\n db.pragma('foreign_keys = ON');\n db.pragma('cache_size = -64000');\n db.pragma('mmap_size = 268435456');\n db.pragma('synchronous = NORMAL');\n db.pragma('temp_store = MEMORY');\n db.pragma('journal_size_limit = 33554432');\n\n return db;\n}\n\nexport function closeDatabase(db: DatabaseConstructor.Database): void {\n try {\n db.pragma('wal_checkpoint(TRUNCATE)');\n } catch {\n // Checkpoint may fail on :memory: - that's fine\n }\n db.close();\n}\n\nfunction resolveDbPath(dataDir?: string): string {\n const dir = resolveDataDir(dataDir ?? '~/.agentic-memory');\n return join(dir, 'memory.db');\n}\n","import type Database from 'better-sqlite3';\n\nexport const version = 1;\n\nexport function up(db: Database.Database): void {\n db.exec(`\n CREATE TABLE IF NOT EXISTS meta (\n key TEXT PRIMARY KEY,\n value TEXT\n );\n\n CREATE TABLE IF NOT EXISTS memories (\n id TEXT PRIMARY KEY,\n type TEXT NOT NULL CHECK(type IN ('episodic','semantic','procedural','working','pattern')),\n title TEXT,\n content TEXT NOT NULL,\n context TEXT,\n source TEXT CHECK(source IN ('manual','session_end','consolidation','hook','import')),\n tags TEXT NOT NULL DEFAULT '[]',\n importance REAL NOT NULL DEFAULT 0.5 CHECK(importance >= 0.0 AND importance <= 1.0),\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now')),\n access_count INTEGER NOT NULL DEFAULT 0 CHECK(access_count >= 0),\n last_accessed TEXT,\n injection_count INTEGER NOT NULL DEFAULT 0 CHECK(injection_count >= 0),\n embedding BLOB\n );\n\n CREATE TABLE IF NOT EXISTS relations (\n source_id TEXT NOT NULL REFERENCES memories(id) ON DELETE CASCADE,\n target_id TEXT NOT NULL REFERENCES memories(id) ON DELETE CASCADE,\n relation_type TEXT NOT NULL CHECK(relation_type IN (\n 'relates_to','depends_on','contradicts','extends','implements','derived_from'\n )),\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n PRIMARY KEY (source_id, target_id, relation_type)\n );\n\n -- FTS5 external content (no data duplication)\n CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(\n title, content, tags,\n content=memories,\n content_rowid=rowid,\n tokenize='porter unicode61'\n );\n\n -- FTS5 sync triggers\n CREATE TRIGGER IF NOT EXISTS memories_ai AFTER INSERT ON memories BEGIN\n INSERT INTO memories_fts(rowid, title, content, tags)\n VALUES (new.rowid, new.title, new.content, new.tags);\n END;\n\n CREATE TRIGGER IF NOT EXISTS memories_ad AFTER DELETE ON memories BEGIN\n INSERT INTO memories_fts(memories_fts, rowid, title, content, tags)\n VALUES ('delete', old.rowid, old.title, old.content, old.tags);\n END;\n\n CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE ON memories BEGIN\n INSERT INTO memories_fts(memories_fts, rowid, title, content, tags)\n VALUES ('delete', old.rowid, old.title, old.content, old.tags);\n INSERT INTO memories_fts(rowid, title, content, tags)\n VALUES (new.rowid, new.title, new.content, new.tags);\n END;\n\n -- Vector search (synced manually in application code)\n CREATE VIRTUAL TABLE IF NOT EXISTS memories_vec USING vec0(\n memory_id TEXT PRIMARY KEY,\n embedding float[384] distance_metric=cosine\n );\n\n -- Indexes\n CREATE INDEX IF NOT EXISTS idx_memories_type ON memories(type);\n CREATE INDEX IF NOT EXISTS idx_memories_importance ON memories(importance);\n CREATE INDEX IF NOT EXISTS idx_memories_created_at ON memories(created_at);\n CREATE INDEX IF NOT EXISTS idx_relations_target ON relations(target_id);\n `);\n}\n","import type Database from 'better-sqlite3';\n\nexport const version = 2;\n\nexport function up(db: Database.Database): void {\n db.exec(`\n ALTER TABLE memories ADD COLUMN project TEXT;\n CREATE INDEX IF NOT EXISTS idx_memories_project ON memories(project);\n `);\n}\n","import { createHash } from 'node:crypto';\nimport type Database from 'better-sqlite3';\n\nexport const version = 3;\n\nexport function up(db: Database.Database): void {\n db.exec('ALTER TABLE memories ADD COLUMN content_hash TEXT');\n\n // Backfill existing rows with SHA-256 hashes\n const rows = db.prepare('SELECT id, content FROM memories ORDER BY updated_at DESC').all() as { id: string; content: string }[];\n const update = db.prepare('UPDATE memories SET content_hash = ? WHERE id = ?');\n const remove = db.prepare('DELETE FROM memories WHERE id = ?');\n\n // Track seen hashes — keep the most recently updated, remove older duplicates\n const seen = new Set<string>();\n for (const row of rows) {\n const hash = createHash('sha256').update(row.content).digest('hex');\n if (seen.has(hash)) {\n remove.run(row.id);\n } else {\n seen.add(hash);\n update.run(hash, row.id);\n }\n }\n\n db.exec('CREATE UNIQUE INDEX IF NOT EXISTS idx_memories_content_hash ON memories(content_hash)');\n}\n","import type Database from 'better-sqlite3';\n\nexport const version = 4;\n\nexport function up(db: Database.Database): void {\n db.exec(`\n CREATE TABLE IF NOT EXISTS memory_tombstones (\n id TEXT PRIMARY KEY,\n project TEXT,\n deleted_at TEXT NOT NULL\n );\n\n CREATE INDEX IF NOT EXISTS idx_tombstones_project ON memory_tombstones(project);\n CREATE INDEX IF NOT EXISTS idx_tombstones_deleted_at ON memory_tombstones(deleted_at);\n `);\n}\n","import type Database from 'better-sqlite3';\nimport * as migration001 from './migrations/001-initial.js';\nimport * as migration002 from './migrations/002-add-project.js';\nimport * as migration003 from './migrations/003-add-content-hash.js';\nimport * as migration004 from './migrations/004-add-tombstones.js';\n\ninterface Migration {\n readonly version: number;\n readonly up: (db: Database.Database) => void;\n}\n\nconst migrations: readonly Migration[] = [\n migration001,\n migration002,\n migration003,\n migration004,\n];\n\nexport function getSchemaVersion(db: Database.Database): number {\n try {\n const row = db.prepare(\"SELECT value FROM meta WHERE key = 'schema_version'\").get() as\n { value: string } | undefined;\n return row ? parseInt(row.value, 10) : 0;\n } catch {\n return 0;\n }\n}\n\nexport function migrate(db: Database.Database): void {\n const current = getSchemaVersion(db);\n const pending = migrations.filter(m => m.version > current);\n\n if (pending.length === 0) return;\n\n const runMigrations = db.transaction(() => {\n for (const m of pending) {\n m.up(db);\n db.prepare(\"INSERT OR REPLACE INTO meta (key, value) VALUES ('schema_version', ?)\")\n .run(String(m.version));\n }\n });\n\n runMigrations();\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,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