New shared package: packages/palace/ (@bytelyst/palace) Modules: - types.ts — BasePalaceWingDoc, RoomDoc, MemoryDoc, TunnelDoc, KGTripleDoc, DiaryDoc - halls.ts — HallType union, HALL_PRESETS (notelett/mindlyst/coding), hallFromLabel() - cosine.ts — cosineSimilarity(), topKByCosine(), normalizeVector() - dedup.ts — isContentDuplicate(), isExactDuplicate(), findClosestMatch() - decay.ts — computeDecayedRelevance(), boostRelevance() - extraction.ts — buildExtractionPrompt(), parseExtractionResponse(), regexFallbackExtraction() - kg.ts — findContradictions(), mergeTriples(), isTripleCurrent() - wakeup.ts — buildWakeUpLayers(), truncateToTokenBudget(), WAKEUP_PRESETS - config.ts — palaceConfigSchema (Zod) 7 test files, 91 tests passing. Consumed by NoteLett, MindLyst, and future palace-enabled products.
49 lines
2.7 KiB
TypeScript
49 lines
2.7 KiB
TypeScript
// ── Types ──────────────────────────────────────────────────────────
|
|
export type {
|
|
BasePalaceWingDoc,
|
|
BasePalaceRoomDoc,
|
|
BasePalaceMemoryDoc,
|
|
BasePalaceTunnelDoc,
|
|
BasePalaceKGTripleDoc,
|
|
BasePalaceDiaryDoc,
|
|
ExtractedMemory,
|
|
} from './types.js';
|
|
|
|
// ── Halls ──────────────────────────────────────────────────────────
|
|
export { ALL_HALL_TYPES, HALL_PRESETS, getHallPreset, hallFromLabel } from './halls.js';
|
|
export type { HallType, HallPreset } from './halls.js';
|
|
|
|
// ── Cosine Similarity ──────────────────────────────────────────────
|
|
export { cosineSimilarity, normalizeVector, topKByCosine } from './cosine.js';
|
|
|
|
// ── Deduplication ──────────────────────────────────────────────────
|
|
export { isContentDuplicate, isExactDuplicate, findClosestMatch } from './dedup.js';
|
|
|
|
// ── Relevance Decay ────────────────────────────────────────────────
|
|
export { computeDecayedRelevance, boostRelevance } from './decay.js';
|
|
|
|
// ── Extraction ─────────────────────────────────────────────────────
|
|
export {
|
|
buildExtractionPrompt,
|
|
parseExtractionResponse,
|
|
regexFallbackExtraction,
|
|
} from './extraction.js';
|
|
export type { ExtractionContext } from './extraction.js';
|
|
|
|
// ── Knowledge Graph ────────────────────────────────────────────────
|
|
export { findContradictions, mergeTriples, isTripleCurrent } from './kg.js';
|
|
export type { TripleInput } from './kg.js';
|
|
|
|
// ── Wake-Up Context ────────────────────────────────────────────────
|
|
export {
|
|
buildWakeUpLayers,
|
|
truncateToTokenBudget,
|
|
estimateTokens,
|
|
WAKEUP_PRESETS,
|
|
} from './wakeup.js';
|
|
export type { WakeUpConfig, WakeUpContext, WakeUpLayer } from './wakeup.js';
|
|
|
|
// ── Config ─────────────────────────────────────────────────────────
|
|
export { palaceConfigSchema, parsePalaceConfig } from './config.js';
|
|
export type { PalaceConfig } from './config.js';
|