@paraharness/memory
Variables
| Variable | Description |
|---|---|
| DistillerChoiceOutputSchema | Choice item produced directly by the Distiller LLM (referencing targetId without echoing full record metadata). |
| DistillerStructuredOutputSchema | Structured output schema that the Distiller LLM must produce. |
| DrainNoteModeSelectorSchema | Selector for note lifecycle modes in memory_drain_notes, where '*' selects all modes. |
| FileInteractionHookInputSchema | Normalized input payload passed to MemoryHarness.handleFileInteractionHook. |
| FileInteractionHookOutputSchema | Output payload returned by MemoryHarness.handleFileInteractionHook. |
| MemoryBucketStatusSchema | Capacity status of the target bucket evaluated during memory_propose and memory_commit. |
| MemoryCapMergeProposalSchema | Consolidation merge payload attached to an op: 'add' choice when two existing records of the same type in a bucket at or above softCap genuinely share the same underlying mechanism. |
| MemoryCapRuleSchema | Scoped or unscoped capacity rule governing soft consolidation pressure and hard rejection walls. |
| MemoryCommitInputSchema | Input schema for memory_commit, discriminated by op ('add' | 'update' | 'remove'). |
| MemoryCommitOutputSchema | Output schema for memory_commit. |
| MemoryConfigSchema | Root configuration schema for .agents/memory.config.json (fallback .claude/memory.config.json). |
| MemoryDistillerConfigSchema | Execution runner and model configuration for the Distiller agent invoked by memory_propose. |
| MemoryDrainNotesInputSchema | Input schema for memory_drain_notes. |
| MemoryDrainNotesOutputSchema | Output schema for memory_drain_notes. |
| MemoryErrorCodeSchema | Deterministic machine-readable error codes thrown by MemoryHarnessError. |
| MemoryGitStorageConfigSchema | Git synchronization configuration for .memory branch worktrees or external shared repositories. |
| MemoryInitInputSchema | Input schema for memory_init. |
| MemoryInitOutputSchema | Output schema for memory_init. |
| MemoryLatestRoleStateSchema | Fallback active session role persisted at .memory/.session-state/latest-role.json. |
| MemoryLessonFormatConfigSchema | Deterministic formatting constraints enforced exclusively on type: 'lesson' records. |
| MemoryLessonRecordSchema | Agent-distilled empirical lesson record (L1, L2, ...). |
| MemoryLoadedNoteRecordSchema | Note record returned by read tools, augmented with whether the read triggered final drainage. |
| MemoryLoadScopedInputSchema | Input schema for memory_load_scoped. |
| MemoryLoadScopedOutputSchema | Output schema for memory_load_scoped. |
| MemoryMetaSchema | Persistent monotonic ID high-water-mark metadata stored alongside memory.jsonl. |
| MemoryNoteRecordSchema | Operational or design decision note record (N1, N2, ...) with mandatory lifecycle. |
| MemoryProposalChoiceSchema | Hydrated proposal choice returned to the caller by memory_propose in resolved mode. |
| MemoryProposeInputSchema | Input schema for memory_propose. |
| MemoryProposeOutputSchema | Output schema for memory_propose, discriminated by executionMode. |
| MemoryRecordSchema | Discriminated union of all records stored in memory.jsonl. |
| MemoryRecordTypeSchema | Discriminator for the three record kinds stored in the unified memory ledger. |
| MemoryRuleRecordSchema | Owner-mandated rule record (R1, R2, ...). |
| MemorySessionEpochStateSchema | Per-session deduplication state persisted at .memory/.session-state/<sessionId>.json. |
| MemoryStorageConfigSchema | Ledger file path and optional Git synchronization settings. |
| NoteLifecycleModeSchema | Lifecycle mode names supported on type: 'note' records. |
| NoteLifecycleSchema | Four-variant discriminated union governing when a type: 'note' record is lazily drained. |
| SessionIdSchema | Safe single-segment session identifier schema preventing path traversal and reserved filename collisions. |
Functions
| Function | Description |
|---|---|
| extractTouchedPathsFromHookInput | Extracts and normalizes touched file paths, directory paths, and joined directory+glob patterns from Claude Code (PreToolUse/PostToolUse Read, Edit, MultiEdit, Write, NotebookEdit, Glob, Grep) and Antigravity (read_file, view_file, view_file_outline, view_code_item, edit_file, write_file, write_to_file, replace_file_content, multi_replace_file_content, find_by_name, grep_search) hook or transcript tool-step payloads (§7.1.1–§7.1.2). |
Classes
| Class | Description |
|---|---|
| ClaudeCliDistillerRunner | Built-in MemoryDistillerRunner implementation that spawns the claude CLI in non-interactive print mode (claude -p) with --output-format json and --json-schema enforcement (§6.4 Step 4). |
| MemoryHarness | Stateful coordinator implementing MemoryHarnessContract (getConfig, init, loadScoped, propose, commit, drainNotes, and handleFileInteractionHook) per §9.1. |
| MemoryHarnessError | Structured domain error thrown by @paraharness/memory operations. |
Interfaces
| Interface | Description |
|---|---|
| DistillerProposalRequest | Request payload passed to an injected MemoryDistillerRunner during memory_propose. |
| MemoryDistillerRunner | Port interface for executing the Distiller LLM (claude-cli or in-process orchestrator subagent). |
| MemoryHarnessContract | Public programmatic contract of the Unified Memory Harness (MemoryHarness). |
| MemoryHarnessOptions | Initialization options for MemoryHarness. |
Type Aliases
DistillerChoiceOutput
type DistillerChoiceOutput = z.infer<typeof DistillerChoiceOutputSchema>;Defined in: schemas/memory-tools.schema.ts:197
Inferred Distiller choice output type.
DistillerStructuredOutput
type DistillerStructuredOutput = z.infer<typeof DistillerStructuredOutputSchema>;Defined in: schemas/memory-tools.schema.ts:314
Inferred Distiller structured output type.
DrainNoteModeSelector
type DrainNoteModeSelector = z.infer<typeof DrainNoteModeSelectorSchema>;Defined in: schemas/memory-tools.schema.ts:609
Inferred note lifecycle mode selector type.
FileInteractionHookInput
type FileInteractionHookInput = z.infer<typeof FileInteractionHookInputSchema>;Defined in: schemas/memory-tools.schema.ts:661
Inferred input type for the file-interaction hook handler.
FileInteractionHookOutput
type FileInteractionHookOutput = z.infer<typeof FileInteractionHookOutputSchema>;Defined in: schemas/memory-tools.schema.ts:678
Inferred output type for the file-interaction hook handler.
MemoryBucketStatus
type MemoryBucketStatus = z.infer<typeof MemoryBucketStatusSchema>;Defined in: schemas/memory-tools.schema.ts:78
Inferred capacity bucket status type.
MemoryCapMergeProposal
type MemoryCapMergeProposal = z.infer<typeof MemoryCapMergeProposalSchema>;Defined in: schemas/memory-tools.schema.ts:158
Inferred capacity-merge proposal type.
MemoryCapRule
type MemoryCapRule = z.infer<typeof MemoryCapRuleSchema>;Defined in: schemas/memory-config.schema.ts:68
Inferred capacity rule configuration type.
MemoryCommitInput
type MemoryCommitInput = z.infer<typeof MemoryCommitInputSchema>;Defined in: schemas/memory-tools.schema.ts:574
Inferred input type for memory_commit.
MemoryCommitOutput
type MemoryCommitOutput = z.infer<typeof MemoryCommitOutputSchema>;Defined in: schemas/memory-tools.schema.ts:593
Inferred output type for memory_commit.
MemoryConfig
type MemoryConfig = z.infer<typeof MemoryConfigSchema>;Defined in: schemas/memory-config.schema.ts:333
Inferred root configuration type for the Unified Memory Harness.
MemoryDistillerConfig
type MemoryDistillerConfig = z.infer<typeof MemoryDistillerConfigSchema>;Defined in: schemas/memory-config.schema.ts:107
Inferred Distiller configuration type.
MemoryDrainNotesInput
type MemoryDrainNotesInput = z.infer<typeof MemoryDrainNotesInputSchema>;Defined in: schemas/memory-tools.schema.ts:630
Inferred input type for memory_drain_notes.
MemoryDrainNotesOutput
type MemoryDrainNotesOutput = z.infer<typeof MemoryDrainNotesOutputSchema>;Defined in: schemas/memory-tools.schema.ts:646
Inferred output type for memory_drain_notes.
MemoryErrorCode
type MemoryErrorCode = z.infer<typeof MemoryErrorCodeSchema>;Defined in: schemas/memory-tools.schema.ts:45
Inferred error code union type.
MemoryGitStorageConfig
type MemoryGitStorageConfig = z.infer<typeof MemoryGitStorageConfigSchema>;Defined in: schemas/memory-config.schema.ts:20
Inferred Git storage configuration type.
MemoryInitInput
type MemoryInitInput = z.infer<typeof MemoryInitInputSchema>;Defined in: schemas/memory-tools.schema.ts:91
Inferred input type for memory_init.
MemoryInitOutput
type MemoryInitOutput = z.infer<typeof MemoryInitOutputSchema>;Defined in: schemas/memory-tools.schema.ts:108
Inferred output type for memory_init.
MemoryLatestRoleState
type MemoryLatestRoleState = z.infer<typeof MemoryLatestRoleStateSchema>;Defined in: schemas/memory-tools.schema.ts:691
Inferred fallback latest-role state type.
MemoryLessonFormatConfig
type MemoryLessonFormatConfig = z.infer<typeof MemoryLessonFormatConfigSchema>;Defined in: schemas/memory-config.schema.ts:91
Inferred lesson formatting configuration type.
MemoryLessonRecord
type MemoryLessonRecord = z.infer<typeof MemoryLessonRecordSchema>;Defined in: schemas/memory-record.schema.ts:92
Inferred lesson record type.
MemoryLoadedNoteRecord
type MemoryLoadedNoteRecord = z.infer<typeof MemoryLoadedNoteRecordSchema>;Defined in: schemas/memory-tools.schema.ts:58
Inferred loaded note record type.
MemoryLoadScopedInput
type MemoryLoadScopedInput = z.infer<typeof MemoryLoadScopedInputSchema>;Defined in: schemas/memory-tools.schema.ts:122
Inferred input type for memory_load_scoped.
MemoryLoadScopedOutput
type MemoryLoadScopedOutput = z.infer<typeof MemoryLoadScopedOutputSchema>;Defined in: schemas/memory-tools.schema.ts:138
Inferred output type for memory_load_scoped.
MemoryMeta
type MemoryMeta = z.infer<typeof MemoryMetaSchema>;Defined in: schemas/memory-record.schema.ts:138
Inferred monotonic ID high-water-mark metadata type.
MemoryNoteRecord
type MemoryNoteRecord = z.infer<typeof MemoryNoteRecordSchema>;Defined in: schemas/memory-record.schema.ts:107
Inferred note record type.
MemoryProposalChoice
type MemoryProposalChoice = z.infer<typeof MemoryProposalChoiceSchema>;Defined in: schemas/memory-tools.schema.ts:237
Inferred hydrated proposal choice union type.
MemoryProposeInput
type MemoryProposeInput = z.infer<typeof MemoryProposeInputSchema>;Defined in: schemas/memory-tools.schema.ts:335
Inferred input type for memory_propose.
MemoryProposeOutput
type MemoryProposeOutput = z.infer<typeof MemoryProposeOutputSchema>;Defined in: schemas/memory-tools.schema.ts:452
Inferred output type for memory_propose.
MemoryRecord
type MemoryRecord = z.infer<typeof MemoryRecordSchema>;Defined in: schemas/memory-record.schema.ts:121
Inferred memory record union type.
MemoryRecordType
type MemoryRecordType = z.infer<typeof MemoryRecordTypeSchema>;Defined in: schemas/memory-record.schema.ts:11
Inferred union type for memory record kinds ('rule' | 'lesson' | 'note').
MemoryRuleRecord
type MemoryRuleRecord = z.infer<typeof MemoryRuleRecordSchema>;Defined in: schemas/memory-record.schema.ts:78
Inferred rule record type.
MemorySessionEpochState
type MemorySessionEpochState = z.infer<typeof MemorySessionEpochStateSchema>;Defined in: schemas/memory-tools.schema.ts:709
Inferred per-session compaction-epoch deduplication state type.
MemoryStorageConfig
type MemoryStorageConfig = z.infer<typeof MemoryStorageConfigSchema>;Defined in: schemas/memory-config.schema.ts:40
Inferred storage configuration type.
NoteLifecycle
type NoteLifecycle = z.infer<typeof NoteLifecycleSchema>;Defined in: schemas/memory-record.schema.ts:52
Inferred note lifecycle union type.
NoteLifecycleMode
type NoteLifecycleMode = z.infer<typeof NoteLifecycleModeSchema>;Defined in: schemas/memory-record.schema.ts:26
Inferred note lifecycle mode union type.
SessionId
type SessionId = z.infer<typeof SessionIdSchema>;Defined in: schemas/memory-tools.schema.ts:24
Inferred session identifier type.