- adapter: memory ids are strings; single-memory calls take only the id
(no ?mind= disambiguation). searchMemory takes the workspace as its own
parameter. New getMemoryCapabilities / setMemoryExtraction. Removed:
incrementFrameAccess, getMemoryOriginalSource, listSuppression,
allowReimport, getWeaverStatus, and the dead importPreview, importCommit
and getWikiWatermark. eraseMemory takes { id } or { sessionId }.
- memory-features reads GET /api/memory/capabilities for the knowledge
graph; history import, wiki, hooks, Room and the memory MCP stay hidden
(ADR-0002). useMemoryCapabilities re-renders the Memory screens.
- Settings > General has a Memory toggle for background fact extraction.
- Memory Center: the confidence filter, the erased-sources panel, the
original-source view and the Deprecated chip are gone; Erase forgets
every memory saved from the chat a memory came from and is offered only
for memories with a chat session. Memory kinds follow the contract.
- Trust views show short memory labels for the new string ids and drop the
per-row "not scored yet" badge (v1 stores no confidence).
- The Weaver maintenance view and the Cockpit weaver card are removed
(the weaver package and its routes are deleted).
- Timeline uses the contract kinds and maps important/temporary
importance.
Logs UF-033 (search scope sent as the workspace id), UF-034 (importance
mapping) and UF-035 (restore over open databases, open).
51 lines
2.1 KiB
TypeScript
51 lines
2.1 KiB
TypeScript
// Pure display mapping for the canonical PRD §15.2 `MemoryKind` vocabulary (B6).
|
|
//
|
|
// `MemoryKind` is the single source of truth for memory typing (defined once in
|
|
// `@waggle/shared`, mirroring the memory contract's kinds). This module maps each kind to (a) a human label for Memory
|
|
// Center filter chips / cards (S04) and (b) an onboarding Memory Review grouping
|
|
// bucket (S16). The server-side `ImportItemType → MemoryKind` normalization lives
|
|
// in the sidecar harvest layer (Phase 2B), NOT here — the build order forbids
|
|
// `@waggle/shared` from importing the hive-mind-core `ImportItemType` union.
|
|
//
|
|
// Pure functions only; no side effects. The `Record<MemoryKind, …>` map is the
|
|
// safety net: tsc fails if a new `MemoryKind` member is added without a mapping.
|
|
|
|
import type { MemoryKind } from '@waggle/shared';
|
|
|
|
/** Onboarding Memory Review grouping buckets (S16). Artifacts are sourced from
|
|
* the Artifact entity, not a `MemoryKind`, so they are not a target here. */
|
|
export type MemoryDisplayCategory = 'Memories' | 'Decisions' | 'Tasks' | 'Projects';
|
|
|
|
interface MemoryKindMeta {
|
|
/** Human label for filter chips / cards (S04). */
|
|
label: string;
|
|
/** Memory Review grouping bucket (S16). */
|
|
category: MemoryDisplayCategory;
|
|
}
|
|
|
|
export const MEMORY_KIND_META: Record<MemoryKind, MemoryKindMeta> = {
|
|
fact: { label: 'Fact', category: 'Memories' },
|
|
event: { label: 'Event', category: 'Memories' },
|
|
preference: { label: 'Preference', category: 'Memories' },
|
|
profile: { label: 'About you', category: 'Memories' },
|
|
decision: { label: 'Decision', category: 'Decisions' },
|
|
summary: { label: 'Summary', category: 'Projects' },
|
|
note: { label: 'Note', category: 'Tasks' },
|
|
};
|
|
|
|
export function memoryKindLabel(kind: MemoryKind): string {
|
|
return MEMORY_KIND_META[kind]?.label ?? 'Memory';
|
|
}
|
|
|
|
export function memoryKindDisplayCategory(kind: MemoryKind): MemoryDisplayCategory {
|
|
return MEMORY_KIND_META[kind]?.category ?? 'Memories';
|
|
}
|
|
|
|
/** Display categories in render order for the Review step grouping (S16). */
|
|
export const MEMORY_DISPLAY_CATEGORIES: readonly MemoryDisplayCategory[] = [
|
|
'Memories',
|
|
'Decisions',
|
|
'Tasks',
|
|
'Projects',
|
|
] as const;
|