Skip to content

@paraharness/memory ​

Variables ​

VariableDescription
DistillerChoiceOutputSchemaChoice item produced directly by the Distiller LLM (referencing targetId without echoing full record metadata).
DistillerStructuredOutputSchemaStructured output schema that the Distiller LLM must produce.
DrainNoteModeSelectorSchemaSelector for note lifecycle modes in memory_drain_notes, where '*' selects all modes.
FileInteractionHookInputSchemaNormalized input payload passed to MemoryHarness.handleFileInteractionHook.
FileInteractionHookOutputSchemaOutput payload returned by MemoryHarness.handleFileInteractionHook.
MemoryBucketStatusSchemaCapacity status of the target bucket evaluated during memory_propose and memory_commit.
MemoryCapMergeProposalSchemaConsolidation 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.
MemoryCapRuleSchemaScoped or unscoped capacity rule governing soft consolidation pressure and hard rejection walls.
MemoryCommitInputSchemaInput schema for memory_commit, discriminated by op ('add' | 'update' | 'remove').
MemoryCommitOutputSchemaOutput schema for memory_commit.
MemoryConfigSchemaRoot configuration schema for .agents/memory.config.json (fallback .claude/memory.config.json).
MemoryDistillerConfigSchemaExecution runner and model configuration for the Distiller agent invoked by memory_propose.
MemoryDrainNotesInputSchemaInput schema for memory_drain_notes.
MemoryDrainNotesOutputSchemaOutput schema for memory_drain_notes.
MemoryErrorCodeSchemaDeterministic machine-readable error codes thrown by MemoryHarnessError.
MemoryGitStorageConfigSchemaGit synchronization configuration for .memory branch worktrees or external shared repositories.
MemoryInitInputSchemaInput schema for memory_init.
MemoryInitOutputSchemaOutput schema for memory_init.
MemoryLatestRoleStateSchemaFallback active session role persisted at .memory/.session-state/latest-role.json.
MemoryLessonFormatConfigSchemaDeterministic formatting constraints enforced exclusively on type: 'lesson' records.
MemoryLessonRecordSchemaAgent-distilled empirical lesson record (L1, L2, ...).
MemoryLoadedNoteRecordSchemaNote record returned by read tools, augmented with whether the read triggered final drainage.
MemoryLoadScopedInputSchemaInput schema for memory_load_scoped.
MemoryLoadScopedOutputSchemaOutput schema for memory_load_scoped.
MemoryMetaSchemaPersistent monotonic ID high-water-mark metadata stored alongside memory.jsonl.
MemoryNoteRecordSchemaOperational or design decision note record (N1, N2, ...) with mandatory lifecycle.
MemoryProposalChoiceSchemaHydrated proposal choice returned to the caller by memory_propose in resolved mode.
MemoryProposeInputSchemaInput schema for memory_propose.
MemoryProposeOutputSchemaOutput schema for memory_propose, discriminated by executionMode.
MemoryRecordSchemaDiscriminated union of all records stored in memory.jsonl.
MemoryRecordTypeSchemaDiscriminator for the three record kinds stored in the unified memory ledger.
MemoryRuleRecordSchemaOwner-mandated rule record (R1, R2, ...).
MemorySessionEpochStateSchemaPer-session deduplication state persisted at .memory/.session-state/<sessionId>.json.
MemoryStorageConfigSchemaLedger file path and optional Git synchronization settings.
NoteLifecycleModeSchemaLifecycle mode names supported on type: 'note' records.
NoteLifecycleSchemaFour-variant discriminated union governing when a type: 'note' record is lazily drained.
SessionIdSchemaSafe single-segment session identifier schema preventing path traversal and reserved filename collisions.

Functions ​

FunctionDescription
extractTouchedPathsFromHookInputExtracts 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 ​

ClassDescription
ClaudeCliDistillerRunnerBuilt-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).
MemoryHarnessStateful coordinator implementing MemoryHarnessContract (getConfig, init, loadScoped, propose, commit, drainNotes, and handleFileInteractionHook) per §9.1.
MemoryHarnessErrorStructured domain error thrown by @paraharness/memory operations.

Interfaces ​

InterfaceDescription
DistillerProposalRequestRequest payload passed to an injected MemoryDistillerRunner during memory_propose.
MemoryDistillerRunnerPort interface for executing the Distiller LLM (claude-cli or in-process orchestrator subagent).
MemoryHarnessContractPublic programmatic contract of the Unified Memory Harness (MemoryHarness).
MemoryHarnessOptionsInitialization options for MemoryHarness.

Type Aliases ​

DistillerChoiceOutput ​

ts
type DistillerChoiceOutput = z.infer<typeof DistillerChoiceOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:197

Inferred Distiller choice output type.


DistillerStructuredOutput ​

ts
type DistillerStructuredOutput = z.infer<typeof DistillerStructuredOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:314

Inferred Distiller structured output type.


DrainNoteModeSelector ​

ts
type DrainNoteModeSelector = z.infer<typeof DrainNoteModeSelectorSchema>;

Defined in: schemas/memory-tools.schema.ts:609

Inferred note lifecycle mode selector type.


FileInteractionHookInput ​

ts
type FileInteractionHookInput = z.infer<typeof FileInteractionHookInputSchema>;

Defined in: schemas/memory-tools.schema.ts:661

Inferred input type for the file-interaction hook handler.


FileInteractionHookOutput ​

ts
type FileInteractionHookOutput = z.infer<typeof FileInteractionHookOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:678

Inferred output type for the file-interaction hook handler.


MemoryBucketStatus ​

ts
type MemoryBucketStatus = z.infer<typeof MemoryBucketStatusSchema>;

Defined in: schemas/memory-tools.schema.ts:78

Inferred capacity bucket status type.


MemoryCapMergeProposal ​

ts
type MemoryCapMergeProposal = z.infer<typeof MemoryCapMergeProposalSchema>;

Defined in: schemas/memory-tools.schema.ts:158

Inferred capacity-merge proposal type.


MemoryCapRule ​

ts
type MemoryCapRule = z.infer<typeof MemoryCapRuleSchema>;

Defined in: schemas/memory-config.schema.ts:68

Inferred capacity rule configuration type.


MemoryCommitInput ​

ts
type MemoryCommitInput = z.infer<typeof MemoryCommitInputSchema>;

Defined in: schemas/memory-tools.schema.ts:574

Inferred input type for memory_commit.


MemoryCommitOutput ​

ts
type MemoryCommitOutput = z.infer<typeof MemoryCommitOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:593

Inferred output type for memory_commit.


MemoryConfig ​

ts
type MemoryConfig = z.infer<typeof MemoryConfigSchema>;

Defined in: schemas/memory-config.schema.ts:333

Inferred root configuration type for the Unified Memory Harness.


MemoryDistillerConfig ​

ts
type MemoryDistillerConfig = z.infer<typeof MemoryDistillerConfigSchema>;

Defined in: schemas/memory-config.schema.ts:107

Inferred Distiller configuration type.


MemoryDrainNotesInput ​

ts
type MemoryDrainNotesInput = z.infer<typeof MemoryDrainNotesInputSchema>;

Defined in: schemas/memory-tools.schema.ts:630

Inferred input type for memory_drain_notes.


MemoryDrainNotesOutput ​

ts
type MemoryDrainNotesOutput = z.infer<typeof MemoryDrainNotesOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:646

Inferred output type for memory_drain_notes.


MemoryErrorCode ​

ts
type MemoryErrorCode = z.infer<typeof MemoryErrorCodeSchema>;

Defined in: schemas/memory-tools.schema.ts:45

Inferred error code union type.


MemoryGitStorageConfig ​

ts
type MemoryGitStorageConfig = z.infer<typeof MemoryGitStorageConfigSchema>;

Defined in: schemas/memory-config.schema.ts:20

Inferred Git storage configuration type.


MemoryInitInput ​

ts
type MemoryInitInput = z.infer<typeof MemoryInitInputSchema>;

Defined in: schemas/memory-tools.schema.ts:91

Inferred input type for memory_init.


MemoryInitOutput ​

ts
type MemoryInitOutput = z.infer<typeof MemoryInitOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:108

Inferred output type for memory_init.


MemoryLatestRoleState ​

ts
type MemoryLatestRoleState = z.infer<typeof MemoryLatestRoleStateSchema>;

Defined in: schemas/memory-tools.schema.ts:691

Inferred fallback latest-role state type.


MemoryLessonFormatConfig ​

ts
type MemoryLessonFormatConfig = z.infer<typeof MemoryLessonFormatConfigSchema>;

Defined in: schemas/memory-config.schema.ts:91

Inferred lesson formatting configuration type.


MemoryLessonRecord ​

ts
type MemoryLessonRecord = z.infer<typeof MemoryLessonRecordSchema>;

Defined in: schemas/memory-record.schema.ts:92

Inferred lesson record type.


MemoryLoadedNoteRecord ​

ts
type MemoryLoadedNoteRecord = z.infer<typeof MemoryLoadedNoteRecordSchema>;

Defined in: schemas/memory-tools.schema.ts:58

Inferred loaded note record type.


MemoryLoadScopedInput ​

ts
type MemoryLoadScopedInput = z.infer<typeof MemoryLoadScopedInputSchema>;

Defined in: schemas/memory-tools.schema.ts:122

Inferred input type for memory_load_scoped.


MemoryLoadScopedOutput ​

ts
type MemoryLoadScopedOutput = z.infer<typeof MemoryLoadScopedOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:138

Inferred output type for memory_load_scoped.


MemoryMeta ​

ts
type MemoryMeta = z.infer<typeof MemoryMetaSchema>;

Defined in: schemas/memory-record.schema.ts:138

Inferred monotonic ID high-water-mark metadata type.


MemoryNoteRecord ​

ts
type MemoryNoteRecord = z.infer<typeof MemoryNoteRecordSchema>;

Defined in: schemas/memory-record.schema.ts:107

Inferred note record type.


MemoryProposalChoice ​

ts
type MemoryProposalChoice = z.infer<typeof MemoryProposalChoiceSchema>;

Defined in: schemas/memory-tools.schema.ts:237

Inferred hydrated proposal choice union type.


MemoryProposeInput ​

ts
type MemoryProposeInput = z.infer<typeof MemoryProposeInputSchema>;

Defined in: schemas/memory-tools.schema.ts:335

Inferred input type for memory_propose.


MemoryProposeOutput ​

ts
type MemoryProposeOutput = z.infer<typeof MemoryProposeOutputSchema>;

Defined in: schemas/memory-tools.schema.ts:452

Inferred output type for memory_propose.


MemoryRecord ​

ts
type MemoryRecord = z.infer<typeof MemoryRecordSchema>;

Defined in: schemas/memory-record.schema.ts:121

Inferred memory record union type.


MemoryRecordType ​

ts
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 ​

ts
type MemoryRuleRecord = z.infer<typeof MemoryRuleRecordSchema>;

Defined in: schemas/memory-record.schema.ts:78

Inferred rule record type.


MemorySessionEpochState ​

ts
type MemorySessionEpochState = z.infer<typeof MemorySessionEpochStateSchema>;

Defined in: schemas/memory-tools.schema.ts:709

Inferred per-session compaction-epoch deduplication state type.


MemoryStorageConfig ​

ts
type MemoryStorageConfig = z.infer<typeof MemoryStorageConfigSchema>;

Defined in: schemas/memory-config.schema.ts:40

Inferred storage configuration type.


NoteLifecycle ​

ts
type NoteLifecycle = z.infer<typeof NoteLifecycleSchema>;

Defined in: schemas/memory-record.schema.ts:52

Inferred note lifecycle union type.


NoteLifecycleMode ​

ts
type NoteLifecycleMode = z.infer<typeof NoteLifecycleModeSchema>;

Defined in: schemas/memory-record.schema.ts:26

Inferred note lifecycle mode union type.


SessionId ​

ts
type SessionId = z.infer<typeof SessionIdSchema>;

Defined in: schemas/memory-tools.schema.ts:24

Inferred session identifier type.

Released under the MIT License.