@sema-agent/core 5.36.0 → 5.37.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.
@@ -2713,6 +2713,79 @@ export interface RemoteEnvFailureNote {
2713
2713
  message: string;
2714
2714
  }
2715
2715
  /** Result returned when a task finishes or gets stuck. Designed to be machine-readable for an external AI. */
2716
+ /**
2717
+ * design/178 v2 §2.3 (件①) — the value of {@link TaskResult.effectiveMemoryScopes}: the memory
2718
+ * visibility face a leg ACTUALLY ran under, as a DISCRIMINATED three-state union (deliberately no
2719
+ * `"partial"` state — the engine session is built only after every plane materialized, so a
2720
+ * half-mounted scene is a fail-open `memoryless` with residue, never a served half-face):
2721
+ *
2722
+ * - `"mounted"` — the memory engine session mounted. `scopes` is the EFFECTIVE VISIBILITY set in
2723
+ * the effective serving order, both exactly as the engine mounted them: per plane, the
2724
+ * admission-projected read layering PLUS a distinct write-only scope where one exists (the
2725
+ * engine registers the write scope's dir and its entries ride the injected index — a write-only
2726
+ * scope IS visible; the common writeScope∈scopes form dedups to the plain layering), project
2727
+ * plane first on a dual root. Each row carries its admission ORIGIN (`"deployment"` = the
2728
+ * operator's own declared set; `"request"` = the caller's spec — the two trust planes of the
2729
+ * org admission door). `writeScope` is the effective write face as granted (an org writeScope
2730
+ * not explicitly granted reads `null` here, exactly as it ran). `contract` names the
2731
+ * scope-identity contract in force (`"v2"` typed keys / `"legacy"` opaque strings).
2732
+ * SCOPE OF THE CLAIM (stated precisely): the rows are the MEMORY-ENGINE scope set this leg
2733
+ * mounted — the dirs the engine registered and indexed. They deliberately do NOT cover the
2734
+ * separate memory-adjacent faces (the shared-memory store pair, the project-context memory
2735
+ * layer — each its own surface with its own disclosure), and two REGISTERED engine-plane
2736
+ * channels can carry another scope's bytes without a row here: a root-owning scope's non-empty
2737
+ * on-disk index is served verbatim to a later mount of that root ("live file wins"),
2738
+ * and control-plane announcements carry no producing scope and drain plane-wide. Both are
2739
+ * engine mount semantics under their own tickets, disclosed here so this face is never read as
2740
+ * a complete cross-face visibility proof.
2741
+ * - `"memoryless"` — memory was configured but did not mount. `reason: "mount-failed"` = the
2742
+ * fail-open mount arm caught a fault anywhere in the mount phase (directory resolution through
2743
+ * materialize — named for the whole captured span, not one step); `reason: "no-backend"` = the
2744
+ * spec enables memory but no `RunnerDeps.memoryBackend` is configured. `materializedResidue`
2745
+ * (mount-failed only) lists plane scopes whose PHYSICAL materialize had already completed when
2746
+ * the fault hit — a LOWER bound (a plane that threw mid-materialize is not listed; on-disk
2747
+ * residue is ≥ this list), and explicitly NOT a visibility face: an auditor must never read
2748
+ * residue as mounted scopes, which is why it is a separate seat from the always-empty `scopes`.
2749
+ * - `"none"` — memory was not in play at all: `"no-spec"` = the task carries no usable memory
2750
+ * spec; `"disabled"` = a spec is present with `enabled: false`.
2751
+ *
2752
+ * Deliberate-refusal configurations (`config.memory_*` codes) fail the whole prepare and produce
2753
+ * NO observation — this union never dresses a refusal as a state. Honesty note (design r7): the
2754
+ * `?: never` members forbid non-`undefined` values at the type level; the repo does not compile
2755
+ * with `exactOptionalPropertyTypes`, so explicit-`undefined` presence is a wire-validator concern,
2756
+ * not a type-level one.
2757
+ */
2758
+ export type EffectiveMemoryScopes = {
2759
+ state: "mounted";
2760
+ reason?: never;
2761
+ contract: "v2" | "legacy";
2762
+ scopes: Array<{
2763
+ scope: string;
2764
+ origin: "deployment" | "request";
2765
+ }>;
2766
+ writeScope: string | null;
2767
+ materializedResidue?: never;
2768
+ } | {
2769
+ state: "memoryless";
2770
+ reason: "mount-failed";
2771
+ contract?: "v2" | "legacy";
2772
+ scopes: [];
2773
+ writeScope: null;
2774
+ materializedResidue?: string[];
2775
+ } | {
2776
+ state: "memoryless";
2777
+ reason: "no-backend";
2778
+ contract?: "v2" | "legacy";
2779
+ scopes: [];
2780
+ writeScope: null;
2781
+ } | {
2782
+ state: "none";
2783
+ reason: "no-spec" | "disabled";
2784
+ contract?: never;
2785
+ scopes: [];
2786
+ writeScope: null;
2787
+ materializedResidue?: never;
2788
+ };
2716
2789
  export interface TaskResult {
2717
2790
  taskId: string;
2718
2791
  /** Use this to continue the same conversation on the next call. */
@@ -2972,6 +3045,28 @@ export interface TaskResult {
2972
3045
  * governing the WORK, never the contents of any checkpoint row.
2973
3046
  */
2974
3047
  effectiveReadDenyPatterns?: readonly import("../tools/fs/read-deny.js").NormalizedReadDenyEntry[];
3048
+ /**
3049
+ * design/178 v2 §2.3 (件①) — the memory VISIBILITY face this leg actually ran under, as an
3050
+ * engine-filled OBSERVATION (never a knob: writing it on a spec does nothing). This is the
3051
+ * EFFECTIVE face, not the requested one: a refused request never reaches a terminal at all (the
3052
+ * whole prepare fails with its governance code), so what this seat answers is "what was actually
3053
+ * given" — the delta against the request is directly readable (an org writeScope not explicitly
3054
+ * granted collapses to `null` here as it did in the run; a fail-open mount failure reads
3055
+ * `memoryless`, never a dressed-up mount).
3056
+ *
3057
+ * **In-presence condition** (same law as {@link effectiveReadFace}): present on every terminal of
3058
+ * a leg that COMPLETED prepare — the memory-less states are answered as their own values
3059
+ * (`none` / `memoryless`), so consumers must never read ABSENCE as "no memory"; absence means
3060
+ * only "prepare never completed". Delegated children mint their own on their own legs (their
3061
+ * request plane can only narrow the parent's frozen org verdict); a resume leg's value is the
3062
+ * re-adjudication at resume time (admission runs in every prepare — the current-policy reading,
3063
+ * same axis as the read-face seats).
3064
+ *
3065
+ * Minted AFTER the materialize outcome, not after the admission verdict — the fail-open mount
3066
+ * arm sits between the two, and stamping earlier would report a mount that never happened.
3067
+ * See {@link EffectiveMemoryScopes} for the per-state field law.
3068
+ */
3069
+ effectiveMemoryScopes?: EffectiveMemoryScopes;
2975
3070
  /**
2976
3071
  * `turns`/`tokens`/`costMicroUsd` are this task's OWN model usage. `nested` is the summed usage of any
2977
3072
  * delegated sub-runs (sub-agents) it spawned — present only when it delegated. The true total
package/dist/index.d.ts CHANGED
@@ -164,7 +164,7 @@ export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootA
164
164
  export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, type AdoptionStatus, type AdoptLocalDataRootOptions, type AdoptLocalDataRootResult, type AdoptionCarriageLeg, type AdoptionCarriageLegContext, type AdoptionConfigWitnessReceipt, } from "./stores/file/adoption/adopt.js";
165
165
  export { formatHookFeedback, runToolGate, createHookEnvCapabilities, createPreToolUseConstraintPolicy, type PersistedRuleHit, type PersistedRuleUnreadable, type PersistedRuleAnswer, normalizePersistedRuleHit, type Hooks, type HookToolContext, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type StopFailureContext, type PermissionDeniedPayload, type PermissionDeniedSource, } from "./core/hooks.js";
166
166
  export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, type Embedder, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, type UtilityGate, type MemoryStore, type MemoryVectorMode, type ScoredMemory, type MemoryNoteHeader, type MemoryNoteRecord, type MemoryNoteType, type StructuredNoteInput, } from "./core/memory.js";
167
- export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, buildMemoryInstruction, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type MemoryGetDetails, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type MemoryBackend, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, } from "./core/memory-engine/index.js";
167
+ export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, buildMemoryInstruction, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type MemoryGetDetails, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, type MemoryBackend, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, } from "./core/memory-engine/index.js";
168
168
  export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemoryStoreError, type SharedMemoryStoreProvider, type SharedMemoryStoreReader, type SharedMemoryPagedList, type SharedMemoryStoreInfo, type SharedMemoryDocumentEntry, type SharedMemorySnapshot, type SharedMemoryRequestContext, type MemoryListDetails, type MemoryReadDetails, } from "./core/shared-memory/types.js";
169
169
  export { sharedMemoryStoreContract, type SharedMemoryFixture, type SharedMemoryStoreContractHooks, } from "./core/shared-memory/contract.js";
170
170
  export { termSet, jaccardDistance, cosineDistance } from "./core/memory-vector.js";
@@ -254,7 +254,7 @@ export { retryBackoffMs, parseRetryAfter } from "./brain/retry.js";
254
254
  export { type BrainTimeoutConfig } from "./brain/timeout.js";
255
255
  export { createAssistantMessageEventStream } from "./internal/llm.js";
256
256
  export type { AssistantMessage, AssistantMessageEvent, CompleteSimpleFn, Context, DocumentContent, ImageContent, Message, StopReason, StreamFn, TextContent, ThinkingContent, ToolCall, ToolResultMessage, Usage, UserMessage, } from "./internal/llm.js";
257
- export type { AgentDefinition, BeforeWriteHook, BeforeWriteRequest, BeforeWriteResult, HandsBandOptions, Brain, BrainStatus, BrainStatusPhase, BrainRetryErrClass, ImageInput, McpElicitRequest, McpElicitResponse, McpServerSpec, A2aServerSpec, OnElicit, Model, ModelRef, ProjectMemoryLoad, RunnerDeps, EngineNotice, RuntimeCaps, BackgroundChildEvent, SkillManifest, SkillSpec, TaskEvent, TaskEventIdentity, ToolActivity, TaskLimits, StaleToolResultOffloadOptions, TaskResult, RemoteEnvFailureNote, TaskSpec, TaskStatus, TaskStream, CompactOutcome, ThinkingLevel, ToolExecuteContext, ToolReturn, ToolSpec, ReversibilityVerdict, ToolEffect, ToolContentOrigin, WorkflowGovernanceBaseline, DelegationTaskType, } from "./core/types.js";
257
+ export type { AgentDefinition, BeforeWriteHook, BeforeWriteRequest, BeforeWriteResult, HandsBandOptions, Brain, BrainStatus, BrainStatusPhase, BrainRetryErrClass, ImageInput, McpElicitRequest, McpElicitResponse, McpServerSpec, A2aServerSpec, OnElicit, Model, ModelRef, ProjectMemoryLoad, RunnerDeps, EngineNotice, RuntimeCaps, BackgroundChildEvent, SkillManifest, SkillSpec, TaskEvent, TaskEventIdentity, ToolActivity, TaskLimits, StaleToolResultOffloadOptions, TaskResult, EffectiveMemoryScopes, RemoteEnvFailureNote, TaskSpec, TaskStatus, TaskStream, CompactOutcome, ThinkingLevel, ToolExecuteContext, ToolReturn, ToolSpec, ReversibilityVerdict, ToolEffect, ToolContentOrigin, WorkflowGovernanceBaseline, DelegationTaskType, } from "./core/types.js";
258
258
  export { Type } from "typebox";
259
259
  export type { TSchema, Static } from "typebox";
260
260
  export { explainPromptAssembly, describeDefaultPack, type DefaultPackDescription, type ExplainInput } from "./prompt-assembly/explain.js";
package/dist/index.js CHANGED
@@ -126,7 +126,7 @@ export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootA
126
126
  export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, } from "./stores/file/adoption/adopt.js";
127
127
  export { formatHookFeedback, runToolGate, createHookEnvCapabilities, createPreToolUseConstraintPolicy, normalizePersistedRuleHit, } from "./core/hooks.js";
128
128
  export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, } from "./core/memory.js";
129
- export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, buildMemoryInstruction, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, readV2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, migrateScope, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, syncMemoryScope, } from "./core/memory-engine/index.js";
129
+ export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, buildMemoryInstruction, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, readV2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, erasureSelectHash, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, migrateScope, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, syncMemoryScope, } from "./core/memory-engine/index.js";
130
130
  export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemoryStoreError, } from "./core/shared-memory/types.js";
131
131
  export { sharedMemoryStoreContract, } from "./core/shared-memory/contract.js";
132
132
  export { termSet, jaccardDistance, cosineDistance } from "./core/memory-vector.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "5.36.0",
3
+ "version": "5.37.0",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_comment": "design/87 L3 — frozen public export surface of src/index.ts (name -> kind). DO NOT edit by hand to silence a red test. A removed/changed entry = a SemVer-BREAKING change; bump MAJOR and update this fixture in the SAME commit (design/87 §4.2 / §5.2). Regenerate via REGEN in test/export-surface.test.ts.",
3
- "count": 1562,
3
+ "count": 1574,
4
4
  "exports": {
5
5
  "A2ATaskState": "type",
6
6
  "A2ATaskStateReversal": "type",
@@ -171,6 +171,9 @@
171
171
  "CircuitBreakerOptions": "interface",
172
172
  "CodeReviewMode": "type",
173
173
  "CodeToolsConfig": "interface",
174
+ "CommittedBinding": "type",
175
+ "CommittedEntrySnapshot": "type",
176
+ "CommittedScopeSnapshots": "type",
174
177
  "CompactOutcome": "type",
175
178
  "CompactionWindowSafetyInfo": "interface",
176
179
  "CompiledEventPrompt": "interface",
@@ -243,10 +246,16 @@
243
246
  "EXPLORE_WHEN_TO_USE": "variable",
244
247
  "EXPLORE_WHEN_TO_USE_LEAN": "variable",
245
248
  "EffectiveConfigField": "interface",
249
+ "EffectiveMemoryScopes": "type",
246
250
  "EffectivePermissionRule": "interface",
247
251
  "Embedder": "interface",
248
252
  "EngineNotice": "interface",
253
+ "EntryCustodyReport": "interface",
254
+ "EntryProvenanceAccount": "interface",
249
255
  "EnvironmentFacts": "interface",
256
+ "EraseMemoryEntriesInput": "interface",
257
+ "ErasedBinding": "type",
258
+ "ErasureSelect": "type",
250
259
  "EscalationRecord": "interface",
251
260
  "EscalationTrigger": "type",
252
261
  "EventDedupe": "type",
@@ -456,6 +465,7 @@
456
465
  "MemoryEntry": "interface",
457
466
  "MemoryEntryFrontmatter": "interface",
458
467
  "MemoryEntryHeader": "interface",
468
+ "MemoryErasureAttestation": "interface",
459
469
  "MemoryGateError": "class",
460
470
  "MemoryGetDetails": "interface",
461
471
  "MemoryInjection": "interface",
@@ -968,6 +978,7 @@
968
978
  "ToolSpec": "interface",
969
979
  "TraceEvent": "type",
970
980
  "TracerHook": "type",
981
+ "TransferEvidence": "interface",
971
982
  "TransportLspSession": "class",
972
983
  "TripwireResult": "interface",
973
984
  "TtlSessionStore": "class",
@@ -1256,6 +1267,7 @@
1256
1267
  "enqueueMemoryAnnouncement": "function",
1257
1268
  "ensureDir": "function",
1258
1269
  "entryFromFile": "function",
1270
+ "erasureSelectHash": "function",
1259
1271
  "err": "function",
1260
1272
  "errorClassOf": "function",
1261
1273
  "eventDefaultOn": "function",