@sema-agent/core 7.64.0 → 7.66.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.
Files changed (192) hide show
  1. package/CHANGELOG.md +571 -0
  2. package/dist/agents/delegation-registry-seat.d.ts +15 -0
  3. package/dist/agents/delegation-registry-seat.js +13 -0
  4. package/dist/agents/org-delivery-gate.d.ts +8 -1
  5. package/dist/agents/org-delivery-gate.js +9 -3
  6. package/dist/agents/peer-held-queue.js +1 -1
  7. package/dist/agents/peer-idle.js +1 -1
  8. package/dist/agents/peer-session-drain.d.ts +51 -12
  9. package/dist/agents/peer-session-drain.js +47 -34
  10. package/dist/agents/read-inbox-tool.d.ts +6 -2
  11. package/dist/agents/read-inbox-tool.js +18 -5
  12. package/dist/agents/subagent.d.ts +3 -1
  13. package/dist/agents/subagent.js +84 -77
  14. package/dist/brain/reasoning.d.ts +2 -0
  15. package/dist/brain/reasoning.js +1 -0
  16. package/dist/core/allow-entry.d.ts +9 -0
  17. package/dist/core/allow-entry.js +7 -1
  18. package/dist/core/ask-origin.d.ts +23 -3
  19. package/dist/core/ask-origin.js +11 -1
  20. package/dist/core/auto-promote.d.ts +3 -2
  21. package/dist/core/background-agent-store.d.ts +7 -0
  22. package/dist/core/checkpoint-store.d.ts +2 -3
  23. package/dist/core/context-settings.d.ts +1 -2
  24. package/dist/core/context-settings.js +1 -1
  25. package/dist/core/engine-attestation.d.ts +2 -2
  26. package/dist/core/engine-notice.d.ts +13 -1
  27. package/dist/core/engine-notice.js +3 -1
  28. package/dist/core/file-history-store.d.ts +2 -2
  29. package/dist/core/file-history-store.js +0 -4
  30. package/dist/core/gate-fold.js +3 -1
  31. package/dist/core/governance-codes.d.ts +6 -4
  32. package/dist/core/governance-codes.js +5 -3
  33. package/dist/core/human-input-projection.d.ts +9 -0
  34. package/dist/core/human-input-projection.js +13 -0
  35. package/dist/core/input-author.d.ts +66 -6
  36. package/dist/core/input-author.js +21 -3
  37. package/dist/core/leg-identity.d.ts +18 -2
  38. package/dist/core/leg-identity.js +5 -7
  39. package/dist/core/mailbox-store.d.ts +1 -1
  40. package/dist/core/memory-engine/consolidation.d.ts +30 -10
  41. package/dist/core/memory-engine/consolidation.js +41 -6
  42. package/dist/core/memory-engine/control-objects.d.ts +36 -3
  43. package/dist/core/memory-engine/control-objects.js +134 -12
  44. package/dist/core/memory-engine/control-plane-adoption.d.ts +13 -9
  45. package/dist/core/memory-engine/control-plane-adoption.js +58 -31
  46. package/dist/core/memory-engine/delegation-settlement.d.ts +75 -52
  47. package/dist/core/memory-engine/delegation-settlement.js +211 -228
  48. package/dist/core/memory-engine/dual-root.d.ts +3 -2
  49. package/dist/core/memory-engine/dual-root.js +5 -1
  50. package/dist/core/memory-engine/engine.d.ts +33 -16
  51. package/dist/core/memory-engine/engine.js +213 -177
  52. package/dist/core/memory-engine/file-backend.d.ts +21 -12
  53. package/dist/core/memory-engine/file-backend.js +58 -104
  54. package/dist/core/memory-engine/index.d.ts +2 -2
  55. package/dist/core/memory-engine/index.js +2 -2
  56. package/dist/core/memory-engine/layout.d.ts +184 -83
  57. package/dist/core/memory-engine/layout.js +267 -172
  58. package/dist/core/memory-engine/memory-age.d.ts +12 -0
  59. package/dist/core/memory-engine/memory-age.js +17 -0
  60. package/dist/core/memory-engine/memory-backend-contract.js +12 -11
  61. package/dist/core/memory-engine/memory-deployment.d.ts +4 -3
  62. package/dist/core/memory-engine/memory-deployment.js +6 -3
  63. package/dist/core/memory-engine/origin-clearance.d.ts +43 -15
  64. package/dist/core/memory-engine/origin-clearance.js +142 -58
  65. package/dist/core/memory-engine/tools.d.ts +2 -2
  66. package/dist/core/memory-engine/tools.js +7 -7
  67. package/dist/core/memory-engine/types.d.ts +16 -10
  68. package/dist/core/memory-vector.d.ts +6 -14
  69. package/dist/core/memory.d.ts +0 -462
  70. package/dist/core/memory.js +0 -333
  71. package/dist/core/model-receipt.d.ts +2 -1
  72. package/dist/core/model-receipt.js +5 -0
  73. package/dist/core/mods/dollar.d.ts +12 -0
  74. package/dist/core/mods/kernel/dispatch.d.ts +3 -1
  75. package/dist/core/mods/kernel/dispatch.js +5 -2
  76. package/dist/core/mods/kernel/events.d.ts +3 -1
  77. package/dist/core/mods/kernel/events.js +2 -2
  78. package/dist/core/mods/prompt-submit.d.ts +4 -0
  79. package/dist/core/mods/prompt-submit.js +24 -0
  80. package/dist/core/mods/stations.d.ts +23 -4
  81. package/dist/core/mods/stations.js +14 -7
  82. package/dist/core/permission-rule-consent.d.ts +49 -18
  83. package/dist/core/permission-rule-consent.js +59 -38
  84. package/dist/core/permission-rule-store.d.ts +24 -14
  85. package/dist/core/retention.d.ts +2 -7
  86. package/dist/core/retention.js +0 -1
  87. package/dist/core/retired-host-table-account.d.ts +19 -0
  88. package/dist/core/retired-host-table-account.js +28 -0
  89. package/dist/core/retired-tool-name-account.d.ts +60 -0
  90. package/dist/core/retired-tool-name-account.js +32 -0
  91. package/dist/core/roles.d.ts +3 -1
  92. package/dist/core/roles.js +5 -2
  93. package/dist/core/runner/classifier-ladder.d.ts +3 -1
  94. package/dist/core/runner/classifier-ladder.js +2 -2
  95. package/dist/core/runner/compact-session.js +2 -1
  96. package/dist/core/runner/contracts.d.ts +9 -9
  97. package/dist/core/runner/delegation-owner.d.ts +0 -8
  98. package/dist/core/runner/delegation-owner.js +1 -3
  99. package/dist/core/runner/gate-exit.js +9 -2
  100. package/dist/core/runner/memory-consolidation-driver.js +2 -2
  101. package/dist/core/runner/prepare-config-doors.js +1 -1
  102. package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
  103. package/dist/core/runner/prepare-delegation-surface.js +5 -3
  104. package/dist/core/runner/prepare-gate-stations.d.ts +8 -5
  105. package/dist/core/runner/prepare-gate-stations.js +13 -5
  106. package/dist/core/runner/prepare-inherited-gate.js +2 -0
  107. package/dist/core/runner/prepare-memory-engine-session.js +1 -1
  108. package/dist/core/runner/prepare-memory.js +35 -14
  109. package/dist/core/runner/prepare-policy-chain.js +12 -3
  110. package/dist/core/runner/prepare-project-context.js +2 -2
  111. package/dist/core/runner/prepare-task.d.ts +9 -1
  112. package/dist/core/runner/prepare-task.js +6 -5
  113. package/dist/core/runner/prepare-wiring-manifest.js +5 -4
  114. package/dist/core/runner/prompt-suggestions.js +1 -1
  115. package/dist/core/runner/run-identity-wiring.js +2 -2
  116. package/dist/core/runner/run-leg.js +3 -3
  117. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  118. package/dist/core/runner/run-notification-lane.js +2 -2
  119. package/dist/core/runner/runtask.js +6 -3
  120. package/dist/core/runner/steer-admission.d.ts +11 -2
  121. package/dist/core/runner/stream-steer-verb.d.ts +5 -2
  122. package/dist/core/runner/stream-steer-verb.js +67 -14
  123. package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -8
  124. package/dist/core/runner/sub-agent-deny-lists.js +22 -8
  125. package/dist/core/runner-deps.d.ts +4 -4
  126. package/dist/core/secret-env.d.ts +2 -2
  127. package/dist/core/secret-env.js +6 -20
  128. package/dist/core/session-store.d.ts +6 -6
  129. package/dist/core/session-store.js +3 -3
  130. package/dist/core/shell-run-candidates.js +3 -3
  131. package/dist/core/side-query.js +1 -1
  132. package/dist/core/skill-grant.d.ts +7 -0
  133. package/dist/core/skill-grant.js +14 -5
  134. package/dist/core/store-contracts/background-agent-store-contract.js +13 -0
  135. package/dist/core/task-event.d.ts +14 -0
  136. package/dist/core/task-notification.d.ts +35 -8
  137. package/dist/core/task-notification.js +31 -13
  138. package/dist/core/task-registry-agent.js +1 -0
  139. package/dist/core/task-registry-shared.d.ts +4 -0
  140. package/dist/core/tool-errors.d.ts +3 -3
  141. package/dist/core/tool-policy.js +2 -3
  142. package/dist/core/tool-spec.d.ts +20 -10
  143. package/dist/core/user-attachment.d.ts +5 -1
  144. package/dist/core/user-attachment.js +11 -5
  145. package/dist/core/write-protect.d.ts +16 -0
  146. package/dist/core/write-protect.js +10 -0
  147. package/dist/engine/harness/agent-harness.d.ts +19 -11
  148. package/dist/engine/harness/agent-harness.js +7 -4
  149. package/dist/engine/llm/types.d.ts +22 -10
  150. package/dist/engine/session/repo-utils.d.ts +14 -4
  151. package/dist/engine/session/repo-utils.js +5 -4
  152. package/dist/index.d.ts +10 -8
  153. package/dist/index.js +9 -7
  154. package/dist/prompts/default.d.ts +1 -2
  155. package/dist/scenarios/full-body.d.ts +1 -1
  156. package/dist/shell/lex.d.ts +50 -15
  157. package/dist/shell/lex.js +43 -9
  158. package/dist/stores/file/adoption/adopt.d.ts +1 -1
  159. package/dist/stores/file/index.d.ts +1 -15
  160. package/dist/stores/file/index.js +1 -15
  161. package/dist/stores/file/permission-rule-store.d.ts +12 -1
  162. package/dist/stores/file/permission-rule-store.js +31 -4
  163. package/dist/stores/file/session-store.js +1 -1
  164. package/dist/tools/fs/fs-bash.js +3 -3
  165. package/dist/tools/fs/removal-targets.d.ts +8 -2
  166. package/dist/tools/fs/removal-targets.js +31 -4
  167. package/dist/tools/fs/shell-read-argv.js +7 -1
  168. package/dist/tools/fs/shell-read-bindings.d.ts +21 -5
  169. package/dist/tools/fs/shell-read-bindings.js +130 -44
  170. package/dist/tools/fs/shell-read-plan.js +95 -29
  171. package/dist/tools/fs/shell-read-sourced.d.ts +25 -0
  172. package/dist/tools/fs/shell-read-sourced.js +119 -0
  173. package/dist/tools/fs/shell-read-word.d.ts +2 -2
  174. package/dist/tools/fs/shell-read-word.js +4 -5
  175. package/dist/tools/fs/shell-read-workdir.d.ts +19 -3
  176. package/dist/tools/fs/shell-read-workdir.js +60 -15
  177. package/dist/tools/fs/shell-reentry-text.d.ts +10 -2
  178. package/dist/tools/fs/shell-reentry-text.js +11 -4
  179. package/package.json +2 -2
  180. package/test/export-surface.snapshot.json +21 -79
  181. package/wire-changes/core-stores-sql@7.65.0.json +30 -0
  182. package/wire-changes/core-stores-sql@7.66.0.json +30 -0
  183. package/wire-changes/core@7.65.0.json +1650 -0
  184. package/wire-changes/core@7.66.0.json +1218 -0
  185. package/wire-changes/mods-kernel@7.65.0.json +30 -0
  186. package/wire-changes/mods-kernel@7.66.0.json +65 -0
  187. package/wire-changes/primitives@7.65.0.json +337 -0
  188. package/wire-changes/primitives@7.66.0.json +30 -0
  189. package/dist/core/memory-recall.d.ts +0 -208
  190. package/dist/core/memory-recall.js +0 -136
  191. package/dist/stores/file/memory-store.d.ts +0 -124
  192. package/dist/stores/file/memory-store.js +0 -353
package/dist/index.d.ts CHANGED
@@ -25,6 +25,7 @@ export { formatToolError, formatZodValidationError, formatValidationPath, trunca
25
25
  export type { WorkerErrorClass } from "./core/tool-errors.js";
26
26
  export { webFetchToolSpec, htmlToText, type WebFetchConfig, createWebSearchTool, type WebSearchConfig, createSearxngSearchBackend, probeSearchBackend, type SearxngBackendOptions, createWebFetchSummarizer, WEBFETCH_SUMMARY_MAX_CONTENT, WEBFETCH_SUMMARY_GUIDELINES, } from "./tools/web.js";
27
27
  export { compileHostFloor, type HostFloor, type HostFloorDeclaration, type HostFloorPosture, type HostFloorReach } from "./core/host-floor.js";
28
+ export { hostOfUrl, HOST_UNREADABLE_SENTENCE, type HostReading, type HostUnreadableReason } from "./core/host-target.js";
28
29
  export { createTodoWriteTool } from "./tools/todo.js";
29
30
  export { ARTIFACT_ACTIONS, ARTIFACT_PLANES, ARTIFACT_COMMIT_CERTAINTIES, ARTIFACT_COMMIT_THROW_OUTCOME, ARTIFACT_PUBLISH_CONTEXTS, ARTIFACT_LIST_SCOPES, ARTIFACT_PLANE_CONTENT_ORIGIN, ARTIFACT_ACTION_HOST_METHOD, ARTIFACT_ACTION_CONCURRENCY_SAFE, ARTIFACT_HOST_FAILURE_CODES, ARTIFACT_FAILURE_RESULT_CODE, ARTIFACT_HOST_ERROR_CODE, readArtifactHostCapabilities, type ArtifactAction, type ArtifactPlane, type ArtifactCommitCertainty, type ArtifactPublishContext, type ArtifactListScope, type ArtifactHostFailureCode, type ArtifactResultCode, type ArtifactHost, type ArtifactHostCapabilities, type ArtifactHostCapabilitiesVerdict, type ArtifactCallContext, type ArtifactFileContent, type ArtifactPublishRequest, type ArtifactPublishOutcome, type ArtifactConflictSnapshot, type ArtifactListOutcome, type ArtifactReadOutcome, type ArtifactFilesOutcome, type ArtifactFileOutcome, type ArtifactRef, type ArtifactListRow, } from "./core/artifact-host.js";
30
31
  export { createArtifactTool, artifactAttemptId, normalizePublishedPath, mediaTypeOf, type ArtifactToolOptions, type ArtifactLocalRead } from "./tools/artifact/artifact-tool.js";
@@ -164,7 +165,7 @@ export type { FileHistoryStore, FileHistoryResult, FileHistoryTrackResult, FileH
164
165
  export type { InMemoryFileHistoryStoreOptions } from "./core/file-history-store.js";
165
166
  export { DEFAULT_FILE_HISTORY_BOUNDARY_KEEP, resolveFileHistoryRetention, fileHistoryBoundariesToKeep } from "./core/file-history-retention.js";
166
167
  export type { FileHistoryRetentionPolicy } from "./core/file-history-retention.js";
167
- export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileMemoryStore, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, type FileStoreLockErrorCode, processFingerprint, isProcessLive, type ProcessFingerprint, type FileStorageBackendOptions, type FileStorageCorruptReadInfo, type FileFileHistoryStoreOptions, type FileSessionRepoOptions, type FileCheckpointStoreOptions, type CheckpointLedgerEventKind, type CheckpointLedgerReading, type ReadCheckpointLedgerOptions, } from "./stores/file/index.js";
168
+ export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, type FileStoreLockErrorCode, processFingerprint, isProcessLive, type ProcessFingerprint, type FileStorageBackendOptions, type FileStorageCorruptReadInfo, type FileFileHistoryStoreOptions, type FileSessionRepoOptions, type FileCheckpointStoreOptions, type CheckpointLedgerEventKind, type CheckpointLedgerReading, type ReadCheckpointLedgerOptions, } from "./stores/file/index.js";
168
169
  export { CacheBreakDetector, type CacheBreakFinding, type ToolFingerprintInput } from "./core/cache-break-detector.js";
169
170
  export { maybeCompact, type MaybeCompactOptions, type CompactionPassStart, type CompactionWindowSafetyInfo, type CompactionRestoreAsk } from "./core/auto-compaction.js";
170
171
  export type { MintedAttachmentFrame } from "./core/user-attachment.js";
@@ -174,11 +175,12 @@ export { createSensitivePathPolicy, RECOMMENDED_SENSITIVE_PATTERNS } from "./cor
174
175
  export { createFsWriteGatePolicy, WRITE_EXEMPT_DIR_COVERS_ROOT_CODE, type FsWriteGatePolicyOptions } from "./core/fs-write-gate-policy.js";
175
176
  export { RETIRED_TOOL_NAMES } from "./core/tool-name-aliases.js";
176
177
  export { judgeRuleToolName, RULE_TOOL_NAME_VERDICTS, type RuleToolNameVerdict } from "./core/tool-name-aliases.js";
178
+ export { retiredToolNameAccount } from "./core/retired-host-table-account.js";
177
179
  export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
178
180
  export { renderTaskNotificationXml, RESUPPLIED_FRAME_PREAMBLE, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, TASK_NOTIFICATION_TERMINAL_STATUSES, // the terminal words that predicate reads, as a value: a host's own terminal check reads these, never a second list
179
181
  type TaskNotificationTerminalStatus, SystemInjectionQueue, type TaskNotificationPayload, type TaskNotificationStatus, type ExternalNotificationInput, type SystemInjection, type SystemInjectionPriority, type NotificationInjectionOutcome, // the injector's outcome words (`parked_durably` = the session's durable box took the frame)
180
182
  NOTIFICATION_INJECTION_OUTCOMES, // …and their value half + guard, so a host wiring its own uplink validates a reported outcome without duplicating the vocabulary
181
- isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, steerPriorityOf, injectionLaneOf, type UserInputLane, AGENT_MESSAGE_TAG, renderAgentMessageFrame, type SemaProvenance, HANDBACK_STATES, type HandbackState, COMPACTION_KINDS, type CompactionKind, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
183
+ isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, steerPriorityOf, injectionLaneOf, type UserInputLane, AGENT_MESSAGE_TAG, renderAgentMessageFrame, type SemaProvenance, HANDBACK_STATES, type HandbackState, COMPACTION_KINDS, type CompactionKind, DISCARDED_DELIVERY_PATHS, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
182
184
  export { TOOL_FAMILIES, TOOL_MOUNT_TAGS, TOOL_APPROVAL_CARDS, TOOL_PATH_ACCESSES, TOOL_PATH_BASES, TOOL_PATH_ABSENCES, TOOL_WIRE_NAME_MAX_CHARS, TOOL_CONTRACT_MAX_CHARS, TOOL_CARD_ID_MAX_CHARS, TOOL_KEY_MAX_CHARS, TOOL_KEYS_MAX, RENDER_HINT_MAX_CHARS, RENDER_HINT_ACTIVITY_MAX_CHARS, RENDER_HINT_MAX_LIST, type ToolFamily, type ToolMountTag, type ToolApprovalCard, type ToolPathAccess, type ToolPathBase, type ToolPathAbsence, type ToolPathTarget, type ToolCallPathTarget, type ToolRosterPathTarget, pathTargetSlotOnly, type ToolHostTarget, type ToolRuleFace, type ToolRenderHints, type ToolFaceDeclaration, type ToolCatalogEntry, } from "./core/tool-face.js";
183
185
  export { describeToolCatalog, catalogEntriesNamed, catalogToolNames, catalogRuleFaceOf, pathTargetOf, pathTargetValue, protectivePathTargetOf, declaredPathTargetOf, BARE_REQUEST_CODE, isProtectedWrite, isDeclaredWrite, fileOpAccessOf, type ToolCallLike, pathConfinableWriteToolNames, persistenceCapableToolNames, persistenceCandidateToolNames, rosterCanPersistMemory, type PersistenceProbeTool, type PersistenceFacts, pathTargetingToolNames, compactableToolNames, budgetExemptToolNames, handBandEffects, engineCardTypes, predictMountedToolNames, HANDS_BAND_TAGS, MOUNT_TAG_IN_HANDS_BAND, } from "./core/tool-registry.js";
184
186
  export { ToolRosterEntry, ToolRoster, ToolRosterDelta, ToolRosterRenderHints, ROSTER_SOURCES, type RosterSource, type ToolIdentity, toolIdentityOf, ROSTER_APPROVAL_BINDING, type RosterApprovalBinding, toolDeclarationDigestOf, mintCapabilityId, diffToolRoster, ruleFacesFromRoster, toolCallFaceOf, rosterToolName, ruleNamesOf, inputKeysOf, ruleFaceOfInstance, rosterMemberBoundProblem, type RosterBoundMembers, type RosterBoundCode, ToolRosterDeltaSeat, } from "./core/tool-roster.js";
@@ -209,7 +211,7 @@ export { projectHumanInput, buildHumanInputEvent, type HumanInputSource, type Hu
209
211
  export { USER_ATTACHMENT_SEAT, USER_ATTACHMENT_KINDS, USER_ATTACHMENT_SUPPLIES, USER_ATTACHMENT_OUTCOMES, USER_ATTACHMENTS_MAX, USER_ATTACHMENT_LABEL_MAX, type UserAttachmentDeclaration, } from "./core/user-attachment.js";
210
212
  export type { HumanInputAttachment } from "./core/types.js";
211
213
  export { TaskRegistry, defaultTaskRegistry, createTaskStopTool, type SemaTaskType, type SemaTaskStatus, type SemaTaskHandle, type ParkedClaimTicket, type TaskAccess, type TaskListRow, type UnifiedTaskOutput, type TaskRetrievalStatus, type StopSource, type RegisterMonitorInput, type MonitorTimers, MONITOR_BATCH_WINDOW_MS, MONITOR_DEFAULT_TIMEOUT_MS, MONITOR_MAX_TIMEOUT_MS, MONITOR_MAX_BATCHES_PER_MINUTE, canAccessWorkflowRun, DURABLE_AGENT_HANDLE_RE, engineAgentName, chosenAgentName, type BackgroundShellHardKillReceipt, } from "./core/task-registry.js";
212
- export { InMemoryMailboxStore, type MailboxStore, type MailboxMessage, type MailboxLease, MailboxStoreError, type MailboxStoreErrorCode, MAILBOX_TOMBSTONED_RECIPIENT_CODE, type MailboxAppendMessage, type MailboxPeerMeta, type MailboxPeerFromMode, type MailboxPeerRecordKind, type MailboxPeerNoticeMeta, type MailboxPeerNoticeState, MAILBOX_PEER_NOTICE_STATES, MAILBOX_PEER_FROM_MODES, MAILBOX_PEER_RECORD_KINDS, MAILBOX_INVALID_PEER_META_CODE, MAILBOX_CROSS_PROCESS_UNSAFE_CODE, readMailboxPeerMeta, mailboxCrossProcessMountVerdict, type MailboxCrossProcessVerdict, mailboxRecipientLifecycleOf, type MailboxRecipientTombstone, MAILBOX_INVALID_RECORD_ID_CODE, MAILBOX_DUPLICATE_RECORD_ID_CODE, MAILBOX_RECORD_ID_MAX_CHARS, MAILBOX_REPLAY_FACETS, type MailboxReplayFacet, readMailboxRecordId, readMailboxAppend, judgeMailboxAppendById, MAILBOX_CONSUMED_ID_WINDOW, type MailboxConsumedRecord, mailboxReplayDigests, type MailboxAckResult, type MailboxDecision, type MailboxDecisionOutcome, MAILBOX_DECISIONS, MAILBOX_INVALID_DECISION_MOVE_CODE, isMailboxDecision, isMailboxDecisionFinal, isMailboxDecisionDeliverable, mailboxDecisionEdgeAllowed, assertMailboxDecisionMove, moveMailboxDecision, readStoredMailboxDecision, } from "./core/mailbox-store.js";
214
+ export { InMemoryMailboxStore, type MailboxStore, type MailboxMessage, type MailboxLease, MailboxStoreError, type MailboxStoreErrorCode, MAILBOX_TOMBSTONED_RECIPIENT_CODE, type MailboxAppendMessage, type MailboxPeerMeta, type MailboxPeerFromMode, type MailboxPeerRecordKind, type MailboxPeerNoticeMeta, type MailboxPeerNoticeState, MAILBOX_PEER_NOTICE_STATES, MAILBOX_PEER_FROM_MODES, MAILBOX_PEER_RECORD_KINDS, MAILBOX_INVALID_PEER_META_CODE, MAILBOX_CROSS_PROCESS_UNSAFE_CODE, readMailboxPeerMeta, mailboxCrossProcessMountVerdict, sessionBoxMountVerdict, type MailboxCrossProcessVerdict, mailboxRecipientLifecycleOf, type MailboxRecipientTombstone, MAILBOX_INVALID_RECORD_ID_CODE, MAILBOX_DUPLICATE_RECORD_ID_CODE, MAILBOX_RECORD_ID_MAX_CHARS, MAILBOX_REPLAY_FACETS, type MailboxReplayFacet, readMailboxRecordId, readMailboxAppend, judgeMailboxAppendById, MAILBOX_CONSUMED_ID_WINDOW, type MailboxConsumedRecord, mailboxReplayDigests, type MailboxAckResult, type MailboxDecision, type MailboxDecisionOutcome, MAILBOX_DECISIONS, MAILBOX_INVALID_DECISION_MOVE_CODE, isMailboxDecision, isMailboxDecisionFinal, isMailboxDecisionDeliverable, mailboxDecisionEdgeAllowed, assertMailboxDecisionMove, moveMailboxDecision, readStoredMailboxDecision, } from "./core/mailbox-store.js";
213
215
  export { FileMailboxStore, type FileMailboxStoreOptions } from "./stores/file/mailbox-store.js";
214
216
  export { createFileTaskListStore } from "./stores/file/task-list-store.js";
215
217
  export { createMonitorTool, type MonitorToolOptions } from "./tools/monitor.js";
@@ -297,7 +299,7 @@ export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdopt
297
299
  export { formatHookFeedback, runToolGate, createHookEnvCapabilities, type PersistedRuleHit, type PersistedRuleHitRule, type PersistedRuleUnreadable, type PersistedRuleCoverage, type PersistedRuleAnswer, normalizePersistedRuleHit, type HookInvocationIdentity, type ClassicEventBase, type PreToolUseEvent, type PostToolUseEvent, type PostToolUseFailureEvent, type PostToolBatchEvent, type UserPromptSubmitEvent, type SubagentStartEvent, type StopEvent, type StopFailureEvent, type SessionStartEvent, type SessionEndEvent, type PreCompactEvent, type PostCompactEvent, type StopHookResult, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type SubagentStartResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type PermissionDeniedPayload, } from "./core/hooks.js";
298
300
  export type { ClassicEventMap, ClassicEventName, ObservedAnswer, EngineModRegistration } from "./core/mods/classic-events.js";
299
301
  export { KERNEL_CONTRACT_VERSION, MOD_TIERS, MOD_SEATS, MOD_EVENT_SIDES, MOD_EVENT_TABLE, MODS_INVALID_CODE, MODS_REGISTRATION_REFUSED_CODE, type ModTier, type ModRegistrationTier, type ModSeat, type ModEventSide, type ModEventName, type ModEventRow, type ModStation, type ModRegistration, type ModUses, type On, type ModHandler, type ModHandlerOptions, type ModNext, type ModOrigin, type ModTraceEntry, type ModCaughtError, type ModDollarBase, type ModEventPayload, type ModMatcher, type ModAdmissionRecord, } from "./core/mods/kernel/index.js";
300
- export type { AgentSpawnAnswer, EngineDollar, ModelCompleteBlock, SessionAppendAnswer, SessionCompactAnswer, SessionSendAnswer, SessionUsage, SessionVersion, ToolCallAnswer } from "./core/mods/dollar.js";
302
+ export type { AgentSpawnAnswer, EngineDollar, ModelCompleteBlock, PromptSubmitAnswer, SessionAppendAnswer, SessionCompactAnswer, SessionSendAnswer, SessionUsage, SessionVersion, ToolCallAnswer } from "./core/mods/dollar.js";
301
303
  export type { ContextOccupancy } from "./core/mods/lifecycle-stations.js";
302
304
  export { admitModChain, promptScreenDeclaredBy } from "./core/mods/stations.js";
303
305
  export { SESSION_APPEND_DOORS, SESSION_APPEND_ORIGIN_KINDS, type SessionAppendDoor, type SessionAppendOrigin } from "./core/mods/session-append.js";
@@ -305,10 +307,10 @@ export { SESSION_RECEIVE_ORIGIN_KINDS, type SessionReceiveOrigin } from "./core/
305
307
  export { SESSION_SEND_ORIGIN_KINDS, type SessionSendOrigin } from "./core/mods/session-send.js";
306
308
  export { loadModPackage, type ModPackageHost, type ModPackageRegistration } from "./core/mods/package.js";
307
309
  export { CREDENTIAL_REF_KINDS, CREDENTIAL_REF_TRUST, CREDENTIAL_REF_TEXT_MAX, CREDENTIAL_REF_MAP_MAX, CREDENTIAL_REF_PROBLEM_REASONS, readCredentialRef, type CredentialRef, type CredentialRefKind, type CredentialRefRequestAdmission, type CredentialRefProblem, type CredentialRefProblemReason, type CredentialRefReading, } from "@sema-agent/primitives";
308
- export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, type Embedder, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, MemoryProjectionError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, type UtilityGate, type MemoryVectorMode, type ScoredMemory, type MemoryNoteHeader, type MemoryNoteRecord, type MemoryNoteType, type StructuredNoteInput, MEMORY_PROJECT_KEY_ABSENT_REASONS, type MemoryProjectKeyAbsentReason, type MemoryProjectKey, } from "./core/memory.js";
309
- export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, memoryGovernanceStoreContract, type MemoryGovernanceStoreContractHooks, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, type MemoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type ConsolidationWriteGate, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, type SessionMemoryStatus, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type ConsolidationWriteJudge, type ConsolidationWriteTarget, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, 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_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, 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 ErasureCarrierAnswer, type ErasureCarrierClass, type ErasureCountAnswer, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryGovernanceStore, MEMORY_GOVERNANCE_DOC_NAMES, type MemoryGovernanceDocName, MEMORY_CONTROL_OBJECT_KINDS, type MemoryControlObjectKind, adoptReplicaControlPlane, replicaControlPlaneStrays, type ControlPlaneAdoptionReport, type ReplicaControlPlaneStrays, type MemoryGovernanceDocs, type ConsolidationTx, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, 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, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, 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, memorySyncStoreOf, carriesCredential, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, memorySyncReportOf, memoryTravelGapOf, type MemorySyncLayerReport, type MemorySyncRoundReport, } from "./core/memory-engine/index.js";
310
+ export { composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, firstSentence, detectSecret, MEMORY_PROJECT_KEY_ABSENT_REASONS, type MemoryProjectKeyAbsentReason, type MemoryProjectKey, } from "./core/memory.js";
311
+ export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, memoryGovernanceStoreContract, type MemoryGovernanceStoreContractHooks, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, type MemoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type ConsolidationWriteGate, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, type SessionMemoryStatus, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type ConsolidationWriteJudge, type ConsolidationWriteTarget, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, 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_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, 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 ErasureCarrierAnswer, type ErasureCarrierClass, type ErasureCountAnswer, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryGovernanceStore, MEMORY_GOVERNANCE_DOC_NAMES, type MemoryGovernanceDocName, MEMORY_CONTROL_OBJECT_KINDS, type MemoryControlObjectKind, adoptReplicaControlPlane, replicaControlPlaneStrays, type ControlPlaneAdoptionReport, type ReplicaControlPlaneStrays, type MemoryGovernanceDocs, type ConsolidationTx, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, 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, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, 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, memorySyncStoreOf, carriesCredential, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, memorySyncReportOf, memoryTravelGapOf, type MemorySyncLayerReport, type MemorySyncRoundReport, } from "./core/memory-engine/index.js";
310
312
  export { createConsolidationWriteJudge, deliverWriteRefusal, type ConsolidationWriteJudgeInput } from "./core/runner/memory-consolidation-write-judge.js";
311
- export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, SCOPE_HOME_FORMS, type StoreFormRefusalCode, type StoreFormRefusalDetail, type StoreFormRefusal, type ScopeHomeForm } from "./core/memory-engine/layout.js";
313
+ export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, CONTROL_PLANE_LINKS_UNSUPPORTED, SCOPE_HOME_FORMS, type StoreFormRefusalCode, type StoreFormRefusalDetail, type StoreFormRefusal, type ScopeHomeForm } from "./core/memory-engine/layout.js";
312
314
  export { resolveMemoryScopeStore, type MemoryScopeStore, type MemoryScopeStoreInput } from "./core/memory-engine/dual-root.js";
313
315
  export { classifyScopePlanes, memoryScopePlaneOf, scopePlanesOf, type ScopePlanes } from "./core/memory-engine/dual-root.js";
314
316
  export { createMemoryDeployment, type MemoryDeployment, type MemoryDeploymentInput, type MemoryDeploymentStore, type DeploymentSessionMemoryStatus, } from "./core/memory-engine/memory-deployment.js";
@@ -319,7 +321,7 @@ export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemor
319
321
  export { isSharedMemoryDocumentPath, isSharedMemoryStoreId } from "./core/shared-memory/normalize.js";
320
322
  export { sharedMemoryStoreContract, type SharedMemoryFixture, type SharedMemoryStoreContractHooks, } from "./core/shared-memory/contract.js";
321
323
  export { termSet, jaccardDistance, cosineDistance } from "./core/memory-vector.js";
322
- export { encodeSurfacedKey, buildManifestText, validateSelectedIds, composeSelectiveBody, formatMemoryAge, resolveLinkedIds, RECALL_CAVEAT, DEFAULT_MAX_SELECTED, DEFAULT_MAX_LINKED, type MemorySelector, type MemorySelectRequest, type SelectiveRecallOptions, type SelectiveRecallResult, type LayeredRecallOptions, type LayeredRecallResult, } from "./core/memory-recall.js";
324
+ export { formatMemoryAge } from "./core/memory-engine/memory-age.js";
323
325
  export { resolveMemoryConsolidationDriver, autoRunOnRecommendationEffective, // the ONE arming reading (`memory.auto_consolidation.arming_has_one_resolver`) — the seat's absence is not "off"
324
326
  type MemoryConsolidationDriverDeps, } from "./core/runner/memory-consolidation-driver.js";
325
327
  export { ROLE_RESOLUTION_TABLE, modelFaceResolvable, type ModelFace, type ModelFaceOptions, type ModelFaceTask, type ModelFaceVerdict, type RoleResolutionAbsence, type RoleResolutionRow, type RoleResolutionWhen, } from "./core/runner/role-resolution-table.js";
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ export { REPORT_FINDINGS_TOOL_NAME } from "./core/runner/synthetic-tools.js";
11
11
  export { formatToolError, formatZodValidationError, formatValidationPath, truncateError, errorClassOf } from "./core/tool-errors.js";
12
12
  export { webFetchToolSpec, htmlToText, createWebSearchTool, createSearxngSearchBackend, probeSearchBackend, createWebFetchSummarizer, WEBFETCH_SUMMARY_MAX_CONTENT, WEBFETCH_SUMMARY_GUIDELINES, } from "./tools/web.js";
13
13
  export { compileHostFloor } from "./core/host-floor.js";
14
+ export { hostOfUrl, HOST_UNREADABLE_SENTENCE } from "./core/host-target.js";
14
15
  export { createTodoWriteTool } from "./tools/todo.js";
15
16
  export { ARTIFACT_ACTIONS, ARTIFACT_PLANES, ARTIFACT_COMMIT_CERTAINTIES, ARTIFACT_COMMIT_THROW_OUTCOME, ARTIFACT_PUBLISH_CONTEXTS, ARTIFACT_LIST_SCOPES, ARTIFACT_PLANE_CONTENT_ORIGIN, ARTIFACT_ACTION_HOST_METHOD, ARTIFACT_ACTION_CONCURRENCY_SAFE, ARTIFACT_HOST_FAILURE_CODES, ARTIFACT_FAILURE_RESULT_CODE, ARTIFACT_HOST_ERROR_CODE, readArtifactHostCapabilities, } from "./core/artifact-host.js";
16
17
  export { createArtifactTool, artifactAttemptId, normalizePublishedPath, mediaTypeOf } from "./tools/artifact/artifact-tool.js";
@@ -130,7 +131,7 @@ export { trackKeyOf as fileHistoryTrackKeyOf, resolveTrackKey as fileHistoryReso
130
131
  export { describeTrackKey as fileHistoryDescribeTrackKey, fileHistoryExportDigest, validateFileHistoryExport } from "./core/file-history-store.js";
131
132
  export { fileHistoryBlobExchangeOf } from "./core/file-history-store.js";
132
133
  export { DEFAULT_FILE_HISTORY_BOUNDARY_KEEP, resolveFileHistoryRetention, fileHistoryBoundariesToKeep } from "./core/file-history-retention.js";
133
- export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileMemoryStore, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, processFingerprint, isProcessLive, } from "./stores/file/index.js";
134
+ export { FileStorageBackend, FileSessionRepo, FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, FileToolResultStore, FileSessionPolicyStore, FileFileHistoryStore, FileWorkflowJournalStore, MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult, resolveDataRoot, sanitizeScope, sanitizePathComponent, atomicWriteFile, writeThenLink, ensureDir, readJsonlRecords, AppendLog, FileStoreLockError, processFingerprint, isProcessLive, } from "./stores/file/index.js";
134
135
  export { CacheBreakDetector } from "./core/cache-break-detector.js";
135
136
  export { maybeCompact } from "./core/auto-compaction.js";
136
137
  export { brainToRuntime } from "./core/runtime.js";
@@ -138,8 +139,9 @@ export { createSensitivePathPolicy, RECOMMENDED_SENSITIVE_PATTERNS } from "./cor
138
139
  export { createFsWriteGatePolicy, WRITE_EXEMPT_DIR_COVERS_ROOT_CODE } from "./core/fs-write-gate-policy.js";
139
140
  export { RETIRED_TOOL_NAMES } from "./core/tool-name-aliases.js";
140
141
  export { judgeRuleToolName, RULE_TOOL_NAME_VERDICTS } from "./core/tool-name-aliases.js";
142
+ export { retiredToolNameAccount } from "./core/retired-host-table-account.js";
141
143
  export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
142
- export { renderTaskNotificationXml, RESUPPLIED_FRAME_PREAMBLE, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, TASK_NOTIFICATION_TERMINAL_STATUSES, SystemInjectionQueue, NOTIFICATION_INJECTION_OUTCOMES, isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, steerPriorityOf, injectionLaneOf, AGENT_MESSAGE_TAG, renderAgentMessageFrame, HANDBACK_STATES, COMPACTION_KINDS, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
144
+ export { renderTaskNotificationXml, RESUPPLIED_FRAME_PREAMBLE, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, TASK_NOTIFICATION_TERMINAL_STATUSES, SystemInjectionQueue, NOTIFICATION_INJECTION_OUTCOMES, isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, steerPriorityOf, injectionLaneOf, AGENT_MESSAGE_TAG, renderAgentMessageFrame, HANDBACK_STATES, COMPACTION_KINDS, DISCARDED_DELIVERY_PATHS, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
143
145
  export { TOOL_FAMILIES, TOOL_MOUNT_TAGS, TOOL_APPROVAL_CARDS, TOOL_PATH_ACCESSES, TOOL_PATH_BASES, TOOL_PATH_ABSENCES, TOOL_WIRE_NAME_MAX_CHARS, TOOL_CONTRACT_MAX_CHARS, TOOL_CARD_ID_MAX_CHARS, TOOL_KEY_MAX_CHARS, TOOL_KEYS_MAX, RENDER_HINT_MAX_CHARS, RENDER_HINT_ACTIVITY_MAX_CHARS, RENDER_HINT_MAX_LIST, pathTargetSlotOnly, } from "./core/tool-face.js";
144
146
  export { describeToolCatalog, catalogEntriesNamed, catalogToolNames, catalogRuleFaceOf, pathTargetOf, pathTargetValue, protectivePathTargetOf, declaredPathTargetOf, BARE_REQUEST_CODE, isProtectedWrite, isDeclaredWrite, fileOpAccessOf, pathConfinableWriteToolNames, persistenceCapableToolNames, persistenceCandidateToolNames, rosterCanPersistMemory, pathTargetingToolNames, compactableToolNames, budgetExemptToolNames, handBandEffects, engineCardTypes, predictMountedToolNames, HANDS_BAND_TAGS, MOUNT_TAG_IN_HANDS_BAND, } from "./core/tool-registry.js";
145
147
  export { ToolRosterEntry, ToolRoster, ToolRosterDelta, ToolRosterRenderHints, ROSTER_SOURCES, toolIdentityOf, ROSTER_APPROVAL_BINDING, toolDeclarationDigestOf, mintCapabilityId, diffToolRoster, ruleFacesFromRoster, toolCallFaceOf, rosterToolName, ruleNamesOf, inputKeysOf, ruleFaceOfInstance, rosterMemberBoundProblem, ToolRosterDeltaSeat, } from "./core/tool-roster.js";
@@ -168,7 +170,7 @@ export {} from "./core/checkpoint-store.js";
168
170
  export { projectHumanInput, buildHumanInputEvent, } from "./core/human-input-projection.js";
169
171
  export { USER_ATTACHMENT_SEAT, USER_ATTACHMENT_KINDS, USER_ATTACHMENT_SUPPLIES, USER_ATTACHMENT_OUTCOMES, USER_ATTACHMENTS_MAX, USER_ATTACHMENT_LABEL_MAX, } from "./core/user-attachment.js";
170
172
  export { TaskRegistry, defaultTaskRegistry, createTaskStopTool, MONITOR_BATCH_WINDOW_MS, MONITOR_DEFAULT_TIMEOUT_MS, MONITOR_MAX_TIMEOUT_MS, MONITOR_MAX_BATCHES_PER_MINUTE, canAccessWorkflowRun, DURABLE_AGENT_HANDLE_RE, engineAgentName, chosenAgentName, } from "./core/task-registry.js";
171
- export { InMemoryMailboxStore, MailboxStoreError, MAILBOX_TOMBSTONED_RECIPIENT_CODE, MAILBOX_PEER_NOTICE_STATES, MAILBOX_PEER_FROM_MODES, MAILBOX_PEER_RECORD_KINDS, MAILBOX_INVALID_PEER_META_CODE, MAILBOX_CROSS_PROCESS_UNSAFE_CODE, readMailboxPeerMeta, mailboxCrossProcessMountVerdict, mailboxRecipientLifecycleOf, MAILBOX_INVALID_RECORD_ID_CODE, MAILBOX_DUPLICATE_RECORD_ID_CODE, MAILBOX_RECORD_ID_MAX_CHARS, MAILBOX_REPLAY_FACETS, readMailboxRecordId, readMailboxAppend, judgeMailboxAppendById, MAILBOX_CONSUMED_ID_WINDOW, mailboxReplayDigests, MAILBOX_DECISIONS, MAILBOX_INVALID_DECISION_MOVE_CODE, isMailboxDecision, isMailboxDecisionFinal, isMailboxDecisionDeliverable, mailboxDecisionEdgeAllowed, assertMailboxDecisionMove, moveMailboxDecision, readStoredMailboxDecision, } from "./core/mailbox-store.js";
173
+ export { InMemoryMailboxStore, MailboxStoreError, MAILBOX_TOMBSTONED_RECIPIENT_CODE, MAILBOX_PEER_NOTICE_STATES, MAILBOX_PEER_FROM_MODES, MAILBOX_PEER_RECORD_KINDS, MAILBOX_INVALID_PEER_META_CODE, MAILBOX_CROSS_PROCESS_UNSAFE_CODE, readMailboxPeerMeta, mailboxCrossProcessMountVerdict, sessionBoxMountVerdict, mailboxRecipientLifecycleOf, MAILBOX_INVALID_RECORD_ID_CODE, MAILBOX_DUPLICATE_RECORD_ID_CODE, MAILBOX_RECORD_ID_MAX_CHARS, MAILBOX_REPLAY_FACETS, readMailboxRecordId, readMailboxAppend, judgeMailboxAppendById, MAILBOX_CONSUMED_ID_WINDOW, mailboxReplayDigests, MAILBOX_DECISIONS, MAILBOX_INVALID_DECISION_MOVE_CODE, isMailboxDecision, isMailboxDecisionFinal, isMailboxDecisionDeliverable, mailboxDecisionEdgeAllowed, assertMailboxDecisionMove, moveMailboxDecision, readStoredMailboxDecision, } from "./core/mailbox-store.js";
172
174
  export { FileMailboxStore } from "./stores/file/mailbox-store.js";
173
175
  export { createFileTaskListStore } from "./stores/file/task-list-store.js";
174
176
  export { createMonitorTool } from "./tools/monitor.js";
@@ -233,10 +235,10 @@ export { SESSION_RECEIVE_ORIGIN_KINDS } from "./core/mods/session-receive.js";
233
235
  export { SESSION_SEND_ORIGIN_KINDS } from "./core/mods/session-send.js";
234
236
  export { loadModPackage } from "./core/mods/package.js";
235
237
  export { CREDENTIAL_REF_KINDS, CREDENTIAL_REF_TRUST, CREDENTIAL_REF_TEXT_MAX, CREDENTIAL_REF_MAP_MAX, CREDENTIAL_REF_PROBLEM_REASONS, readCredentialRef, } from "@sema-agent/primitives";
236
- export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, MemoryProjectionError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, MEMORY_PROJECT_KEY_ABSENT_REASONS, } from "./core/memory.js";
237
- export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, memoryGovernanceStoreContract, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, committedDistilledOf, distilledEquals, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, isInstructionEntry, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, 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_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, 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, computeMemoryBundleHash, MEMORY_GOVERNANCE_DOC_NAMES, MEMORY_CONTROL_OBJECT_KINDS, adoptReplicaControlPlane, replicaControlPlaneStrays, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, 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, memorySyncStoreOf, carriesCredential, memorySyncReportOf, memoryTravelGapOf, } from "./core/memory-engine/index.js";
238
+ export { composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, firstSentence, detectSecret, MEMORY_PROJECT_KEY_ABSENT_REASONS, } from "./core/memory.js";
239
+ export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, memoryGovernanceStoreContract, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, committedDistilledOf, distilledEquals, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, isInstructionEntry, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, fileSessionCaptureRecordStore, 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_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, 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, computeMemoryBundleHash, MEMORY_GOVERNANCE_DOC_NAMES, MEMORY_CONTROL_OBJECT_KINDS, adoptReplicaControlPlane, replicaControlPlaneStrays, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, 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, memorySyncStoreOf, carriesCredential, memorySyncReportOf, memoryTravelGapOf, } from "./core/memory-engine/index.js";
238
240
  export { createConsolidationWriteJudge, deliverWriteRefusal } from "./core/runner/memory-consolidation-write-judge.js";
239
- export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, SCOPE_HOME_FORMS } from "./core/memory-engine/layout.js";
241
+ export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, CONTROL_PLANE_LINKS_UNSUPPORTED, SCOPE_HOME_FORMS } from "./core/memory-engine/layout.js";
240
242
  export { resolveMemoryScopeStore } from "./core/memory-engine/dual-root.js";
241
243
  export { classifyScopePlanes, memoryScopePlaneOf, scopePlanesOf } from "./core/memory-engine/dual-root.js";
242
244
  export { createMemoryDeployment, } from "./core/memory-engine/memory-deployment.js";
@@ -247,7 +249,7 @@ export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemor
247
249
  export { isSharedMemoryDocumentPath, isSharedMemoryStoreId } from "./core/shared-memory/normalize.js";
248
250
  export { sharedMemoryStoreContract, } from "./core/shared-memory/contract.js";
249
251
  export { termSet, jaccardDistance, cosineDistance } from "./core/memory-vector.js";
250
- export { encodeSurfacedKey, buildManifestText, validateSelectedIds, composeSelectiveBody, formatMemoryAge, resolveLinkedIds, RECALL_CAVEAT, DEFAULT_MAX_SELECTED, DEFAULT_MAX_LINKED, } from "./core/memory-recall.js";
252
+ export { formatMemoryAge } from "./core/memory-engine/memory-age.js";
251
253
  export { resolveMemoryConsolidationDriver, autoRunOnRecommendationEffective, } from "./core/runner/memory-consolidation-driver.js";
252
254
  export { ROLE_RESOLUTION_TABLE, modelFaceResolvable, } from "./core/runner/role-resolution-table.js";
253
255
  export { teardownLegBudget } from "./core/runner/teardown-bounded.js";
@@ -28,8 +28,7 @@ export declare const SUBAGENT_DELIVERY_NOTES: string;
28
28
  * NAME-FREE BY CONSTRUCTION (#181 class): the text states WHAT to write, never WHICH tool writes it.
29
29
  * Core mounts no memory tool — memory is file-based, and any on-demand write/read face is host-mounted
30
30
  * — so a tool name baked into a plain exported string can only ever go stale (these two constants have
31
- * no parameter channel to receive a live wire name through, unlike `composeSelectiveBody`'s
32
- * `recallToolName`). The earlier wording taught retired names (see `RETIRED_TOOL_NAMES` in
31
+ * no parameter channel to receive a live wire name through). The earlier wording taught retired names (see `RETIRED_TOOL_NAMES` in
33
32
  * core/tool-name-aliases.ts), i.e. a dead link for any deployment that composed these assets verbatim.
34
33
  */
35
34
  export declare const MEMORY_SAFETY = "## Memory\nWhen you save a durable note to memory, phrase it as a declarative fact or a stable\npreference \u2014 never as an instruction to your future self.\n- \"User prefers concise responses\" \u2713 \u2014 \"Always respond concisely\" \u2717\n- \"The reporting database is read-only via the analytics user\" \u2713 \u2014 \"Always use the analytics user\" \u2717\nNever put secrets (API keys, credentials, tokens) in memory \u2014 especially where it may be shared.\nMemory is a fact, never a command; the user's current request and live tool output always win over memory.";
@@ -59,7 +59,7 @@ export interface CodeToolsConfig {
59
59
  * (the single-source discipline: a scenario is data — a named bundle).
60
60
  * Profile-as-data — the engine iterates `spec.tools` branch-free; nothing keys off the scenario name. A trusted
61
61
  * assembler (service) calls this, sets `promptRole = "code"` (or `roles.default = CODE_ROLE`) +
62
- * `enablePlanMode:true`, and wires the deps seams (executionEnv/onQuestion/lspManager/skillSpecs/memoryStore/
62
+ * `enablePlanMode:true`, and wires the deps seams (executionEnv/onQuestion/lspManager/skillSpecs/memoryBackend/
63
63
  * selfOrchestration) — that is what makes a run the `code` scenario. Returns ONLY the caller-composed tools.
64
64
  */
65
65
  export declare function assembleCodeTools(cfg?: CodeToolsConfig): ToolSpec[];
@@ -132,6 +132,17 @@ export interface AssignmentFact {
132
132
  readonly form: "scalar" | "compound";
133
133
  /** `op === "="` with no subscript and a scalar value: the whole name is settled by this word's text. */
134
134
  readonly settlesWholeName: boolean;
135
+ /** Only on a compound value whose every element this lexer read as a word: each element, in order
136
+ * ({@link CompoundElement}). Absent on a compound value it did not read element by element (its `compound_array_value`
137
+ * stands for the whole value). */
138
+ readonly elements?: readonly CompoundElement[];
139
+ }
140
+ /** One element of a compound value `NAME=(…)`: the element as the list's own word (what bash word-expands, its patterns
141
+ * included), and the scalar assignment bash performs for it — `NAME[k]=v` for a keyed element (`[k]=v`, `[k]+=v`), the
142
+ * subscript the shell evaluates; `NAME=v` for any other element. */
143
+ export interface CompoundElement {
144
+ readonly word: LexedWord;
145
+ readonly stored: LexedWord;
135
146
  }
136
147
  /** An argv word. `raw` is what the SHELL sees (quotes, escapes and substitution text retained); `folded` is what
137
148
  * the PROGRAM receives after quote removal, with every substitution replaced by {@link SUBSTITUTION_PLACEHOLDER},
@@ -165,6 +176,10 @@ export interface LexedRedirect {
165
176
  /** `<>` opens its target for reading AND writing (creating it), on descriptor 0 unless one is written. */
166
177
  readonly op: "<" | ">" | ">>" | "<<<" | "<>" | "&>" | "&>>" | ">&" | "<&";
167
178
  readonly fd?: number;
179
+ /** The word right before the operator is a bare `{NAME}` (`{fd}>file`, `{fd}<<EOF`): bash ≥ 4.1 opens a descriptor it picks
180
+ * (never 0) and stores its number in NAME — no argument; bash 3.2 reads `{NAME}` as an argument and the redirection on its
181
+ * default descriptor. The word stays a word token; every reader takes both readings ({@link namesRedirectDescriptor}). */
182
+ readonly allocated?: true;
168
183
  readonly target?: LexedWord;
169
184
  readonly dup?: string;
170
185
  }
@@ -175,6 +190,10 @@ export interface LexedHeredoc {
175
190
  readonly delimiter: string;
176
191
  readonly quoted: boolean;
177
192
  readonly body: string;
193
+ /** The descriptor the body is opened on when the operator carried one (`3<<EOF`); absent = standard input. */
194
+ readonly fd?: number;
195
+ /** `{NAME}<<EOF`: a descriptor bash ≥ 4.1 allocates, standard input to bash 3.2 ({@link LexedRedirect.allocated}). */
196
+ readonly allocated?: true;
178
197
  }
179
198
  /** A subshell parenthesis, standing alone: structure, not a word. */
180
199
  export interface LexedGroup {
@@ -204,6 +223,14 @@ export interface LexedSegment {
204
223
  /** The bodies among {@link substitutions} of a function or value substitution (`${ list; }`, `${| list; }`): their list
205
224
  * runs in the CURRENT shell, so what it assigns or where it moves outlives the word. Absent when there is none. */
206
225
  readonly currentShell?: readonly string[];
226
+ /** The segment stands where a `source` of a file this text wrote stood (#3400): it is the written literal's text, not
227
+ * the text as the shell will read it — whether it runs is not proven (the write may have failed or gone to a device,
228
+ * the printer may be shadowed), so what it binds or where it moves is one more candidate, never a certainty (#3557). */
229
+ readonly spliced?: true;
230
+ /** The `source` segment itself, kept after the segments its written literal was spliced into (#3557): never spliced
231
+ * again. The inserted segments are only {@link spliced} — a `source` among them of a file the inserted text itself
232
+ * wrote splices on the next pass (a guard on `spliced` would hide `. ./inner.sh` inside the spliced text). */
233
+ readonly sourced?: true;
207
234
  }
208
235
  export interface LexedCommand {
209
236
  readonly segments: readonly LexedSegment[];
@@ -293,18 +320,14 @@ export declare function parameterArithmeticTexts(body: string): {
293
320
  * its text (`${x:-${a[i]}}`); a parameter, brace or glob text carrying a substitution opener runs what it opens.
294
321
  */
295
322
  export declare function expansionHidesRun(e: WordExpansion): boolean;
296
- /** Can a compound assignment's value `(…)` run what its text does not show? The lexer keeps the value one opaque piece
297
- * (its elements unread), so any `$` or backquote in it may (`(${P@P})`, `(${!N})`, `(${x:-$(…)})`), and so may a `[…]`
298
- * subscript the evaluator reads — one naming a variable (`([x]=1)`), or carrying a `$` or backquote, an ANSI-C `$'…'`
299
- * among them (`([$'\170']=1)`: bash decodes `\170` to the name `x` and evaluates it). A `$'…'` is not counted OUTSIDE a
300
- * `[…]` — a standalone element opens an ANSI-C string and runs nothing (`($'\t' x)`) — but inside a subscript it is (the
301
- * `[…]` arm's char class holds `$`). (An integer array's ANSI-C ELEMENT, `declare -ai A=($'\170')`, decodes and
302
- * evaluates too, but needs the `-i` attribute the value text does not carry — not caught here, see KNOWN-LIMITS.) Its
303
- * command substitutions are the segment's already. The one reading the deny lanes, the read station and
304
- * auto-background share until the value is read element by element. */
305
- export declare function compoundValueHidesRun(w: {
306
- readonly assignment?: AssignmentFact;
307
- }): boolean;
323
+ /**
324
+ * The words an assignment word stores, each the ONE assignment bash performs: the word itself, or — a compound value
325
+ * `NAME=(…)` the lexer read element by element — each element's scalar assignment ({@link CompoundElement.stored}:
326
+ * `NAME[k]=v` / `NAME=v`); a compound value it did not read that way is the word itself, its `compound_array_value`
327
+ * standing. Every reader of what a word's value runs or cannot be read reads these, so an element is judged exactly as
328
+ * the scalar assignment of the same text (`A=(${P@P})` as `A=${P@P}`, `A=([x]=1)` as `A[x]=1`, `A=("$@")` as `A="$@"`).
329
+ */
330
+ export declare function assignedWords(w: LexedWord): readonly LexedWord[];
308
331
  /** Does the parameter body (`P@P`, `a[i]@P`) carry a transformation that EVALUATES the value — `${P@P}` expands P's value
309
332
  * as a prompt string, its parameter, command and arithmetic expansions run (measured on 5.3) — rather than respelling it? */
310
333
  export declare function transformEvaluates(body: string): boolean;
@@ -319,9 +342,21 @@ export declare function parameterRereadsValue(body: string): boolean;
319
342
  /** Is the arithmetic text (an arithmetic command's interior) provably free of a variable — the same reading
320
343
  * {@link expansionHidesRun} gives an arithmetic expansion? */
321
344
  export declare function arithmeticTextIsPlain(text: string): boolean;
322
- /** Does `word`, standing right before the redirection `next`, name the descriptor that redirection opens (`{fd}>file`):
323
- * a bare `{NAME}` that belongs to the operator rather than to the argv? */
324
- export declare function namesRedirectDescriptor(word: LexedWord, next: LexedToken | undefined): boolean;
345
+ /** Does an assignment word's subscript (`A[x]=v`, an element `[x]=v` read as {@link assignedWords} does) hide a run? An
346
+ * indexed array's subscript is arithmetic bash evaluates as the assignment runs: anything but digits and operators may
347
+ * evaluate a value the text does not show (`x='b[$(…)0]'; A[x]=1`). The deny lanes and auto-background ask it alike. */
348
+ export declare function subscriptHidesRun(w: LexedWord): boolean;
349
+ /** Does a word run a program its text does not show — an expansion that may ({@link expansionHidesRun}: a substitution, a
350
+ * parameter whose evaluation may), an assignment subscript ({@link subscriptHidesRun}) — read on the words an assignment
351
+ * stores ({@link assignedWords}); a compound value the lexer did not read element by element may run anything. The deny
352
+ * lanes' one reading of a word. */
353
+ export declare function wordHidesRun(w: LexedWord): boolean;
354
+ /** Does the word standing right before the token `next` name the descriptor `next` opens (`{fd}>file`, `{fd}<<EOF`) — to bash
355
+ * ≥ 4.1, which allocates it; to bash 3.2 the word is an argument ({@link LexedRedirect.allocated}, the lexer's one reading). */
356
+ export declare function namesRedirectDescriptor(next: LexedToken | undefined): boolean;
357
+ /** The words of a segment that name the descriptor of the redirection after them ({@link namesRedirectDescriptor}): what bash
358
+ * ≥ 4.1's reading of the argv drops (bash 3.2 keeps them as arguments). */
359
+ export declare function descriptorNameWords(segment: LexedSegment): ReadonlySet<LexedWord>;
325
360
  /** The text a word's pieces hand the program when every piece is literal; `undefined` when one is an expansion or
326
361
  * unresolved. */
327
362
  export declare function literalTextOf(pieces: readonly WordPiece[]): string | undefined;
package/dist/shell/lex.js CHANGED
@@ -750,8 +750,27 @@ export function expansionHidesRun(e) {
750
750
  return !PLAIN_ARITHMETIC.test(body);
751
751
  return SUBSTITUTION_OPENER.test(body) || (e.kind === "parameter" && (bodyEvaluatesText(body) || parameterRereadsValue(body))) || nestedBodyEvaluatesText(body);
752
752
  }
753
- export function compoundValueHidesRun(w) {
754
- return w.assignment?.form === "compound" && /\$(?!')|`|\[[^\]]*[$`A-Za-z_]/.test(w.assignment.value.raw);
753
+ export function assignedWords(w) {
754
+ const elements = w.assignment?.form === "compound" ? w.assignment.elements : undefined;
755
+ return elements !== undefined ? elements.map((e) => e.stored) : [w];
756
+ }
757
+ function compoundElementsOf(name, words) {
758
+ if (words.some((w) => w.assignment?.form === "compound"))
759
+ return undefined;
760
+ const out = [];
761
+ for (const word of words) {
762
+ const keyed = word.raw.startsWith("[") ? scalarAssignmentOf(`${name}${word.raw}`) : undefined;
763
+ const stored = keyed?.assignment?.subscript !== undefined ? keyed : scalarAssignmentOf(`${name}=${word.raw}`);
764
+ if (stored === undefined || (stored !== keyed && stored.assignment?.subscript !== undefined))
765
+ return undefined;
766
+ out.push({ word, stored });
767
+ }
768
+ return out;
769
+ }
770
+ function scalarAssignmentOf(text) {
771
+ const lexed = lexShell(text);
772
+ const argv = "parseFailure" in lexed || lexed.segments.length !== 1 ? undefined : argvOf(lexed.segments[0]);
773
+ return argv?.length === 1 && argv[0].assignment?.form === "scalar" ? argv[0] : undefined;
755
774
  }
756
775
  export function transformEvaluates(body) {
757
776
  const transform = TRANSFORM_FORM.exec(body)?.[1];
@@ -764,8 +783,17 @@ export function parameterRereadsValue(body) {
764
783
  export function arithmeticTextIsPlain(text) {
765
784
  return PLAIN_ARITHMETIC.test(text.replace(/\\\n/g, ""));
766
785
  }
767
- export function namesRedirectDescriptor(word, next) {
768
- return next?.kind === "redirect" && word.expansions.length === 0 && word.quotedSpans.length === 0 && /^\{[A-Za-z_][A-Za-z0-9_]*\}$/.test(word.raw);
786
+ export function subscriptHidesRun(w) {
787
+ return w.assignment?.subscript !== undefined && !arithmeticTextIsPlain(w.assignment.subscript.raw);
788
+ }
789
+ export function wordHidesRun(w) {
790
+ return assignedWords(w).some((e) => e.assignment?.form === "compound" || e.expansions.some((p) => p.expansion !== undefined && expansionHidesRun(p.expansion)) || subscriptHidesRun(e));
791
+ }
792
+ export function namesRedirectDescriptor(next) {
793
+ return (next?.kind === "redirect" || next?.kind === "heredoc") && next.allocated === true;
794
+ }
795
+ export function descriptorNameWords(segment) {
796
+ return new Set(segment.tokens.flatMap((t, i) => (t.kind === "word" && namesRedirectDescriptor(segment.tokens[i + 1]) ? [t] : [])));
769
797
  }
770
798
  export function literalTextOf(pieces) {
771
799
  return pieces.every((q) => q.literal !== undefined) ? pieces.map((q) => q.literal).join("") : undefined;
@@ -805,6 +833,7 @@ class WordBuilder {
805
833
  marks = [];
806
834
  subscript;
807
835
  compound = false;
836
+ elementWords;
808
837
  widenedClasses = [];
809
838
  begin(src) { if (!this.started)
810
839
  this.at = src; }
@@ -1127,6 +1156,7 @@ class WordBuilder {
1127
1156
  expansions: valuePieces.filter((p) => p.expansion !== undefined),
1128
1157
  ...(this.compound ? { unresolved: "compound_array_value" } : {}),
1129
1158
  };
1159
+ const elements = this.compound && this.elementWords !== undefined ? compoundElementsOf(name, this.elementWords) : undefined;
1130
1160
  let subscript;
1131
1161
  if (sub !== undefined) {
1132
1162
  const rawFrom = this.rawOfFolded[sub.from] + 1;
@@ -1142,6 +1172,7 @@ class WordBuilder {
1142
1172
  bare,
1143
1173
  form: this.compound ? "compound" : "scalar",
1144
1174
  settlesWholeName: !appends && sub === undefined && !this.compound,
1175
+ ...(elements !== undefined ? { elements } : {}),
1145
1176
  };
1146
1177
  }
1147
1178
  isAssignmentHead() {
@@ -1247,10 +1278,11 @@ function scanText(source, connectorsAreText, segments, level, list) {
1247
1278
  w = new WordBuilder();
1248
1279
  if (pendingHeredoc !== undefined) {
1249
1280
  const header = heredocHeaderOf(word, pendingHeredoc.dash);
1281
+ const { fd: heredocFd, allocated } = pendingHeredoc;
1250
1282
  pendingHeredoc = undefined;
1251
1283
  if (header === undefined)
1252
1284
  return fail("heredoc_delimiter_expands", at);
1253
- const token = { kind: "heredoc", delimiter: header.delimiter, quoted: header.quoted, body: "" };
1285
+ const token = { kind: "heredoc", delimiter: header.delimiter, quoted: header.quoted, body: "", ...(heredocFd !== undefined ? { fd: heredocFd } : {}), ...(allocated === true ? { allocated } : {}) };
1254
1286
  current().tokens.push(token);
1255
1287
  pendingHeredocs.push({ ...header, token });
1256
1288
  if (acceptable) {
@@ -1262,10 +1294,10 @@ function scanText(source, connectorsAreText, segments, level, list) {
1262
1294
  return undefined;
1263
1295
  }
1264
1296
  if (pendingRedirect !== undefined) {
1265
- const { op, fd } = pendingRedirect;
1297
+ const { op, fd, allocated } = pendingRedirect;
1266
1298
  pendingRedirect = undefined;
1267
1299
  const target = { ...word, atCommandPosition: false };
1268
- const written = fd !== undefined ? { fd } : {};
1300
+ const written = fd !== undefined ? { fd } : allocated === true ? { allocated } : {};
1269
1301
  if ((op === ">&" || op === "<&") && word.raw === word.folded && /^(?:\d+-?|-)$/.test(word.folded))
1270
1302
  current().tokens.push({ kind: "redirect", op, ...written, dup: word.folded });
1271
1303
  else
@@ -1552,6 +1584,7 @@ function scanText(source, connectorsAreText, segments, level, list) {
1552
1584
  w.mark("compound_array_value", w.raw.length);
1553
1585
  w.opaque(text, text, undefined, i, end, undefined);
1554
1586
  w.compound = true;
1587
+ w.elementWords = inner.command.segments.every((sg) => sg.tokens.every((t) => t.kind === "word")) ? inner.command.segments.flatMap(argvOf) : undefined;
1555
1588
  current().substitutions.push(...inner.command.substitutions);
1556
1589
  const runsHere = inner.command.segments.flatMap((s) => s.currentShell ?? []);
1557
1590
  if (runsHere.length > 0)
@@ -1605,6 +1638,7 @@ function scanText(source, connectorsAreText, segments, level, list) {
1605
1638
  }
1606
1639
  if (arithParens === 0 && (ch === "<" || ch === ">" || (ch === "&" && source[n1] === ">"))) {
1607
1640
  let fd;
1641
+ const allocated = ch !== "&" && w.started && w.raw === w.folded && /^\{[A-Za-z_][A-Za-z0-9_]*\}$/.test(w.raw);
1608
1642
  if (ch !== "&" && w.started && w.raw === w.folded && /^\d+$/.test(w.raw)) {
1609
1643
  fd = Number(w.raw);
1610
1644
  w = new WordBuilder();
@@ -1614,7 +1648,7 @@ function scanText(source, connectorsAreText, segments, level, list) {
1614
1648
  if (r !== undefined)
1615
1649
  return r;
1616
1650
  }
1617
- const written = fd !== undefined ? { fd } : {};
1651
+ const written = fd !== undefined ? { fd } : allocated ? { allocated: true } : {};
1618
1652
  const n2 = next(n1);
1619
1653
  if (ch === "&") {
1620
1654
  if (source[n2] === ">") {
@@ -1634,7 +1668,7 @@ function scanText(source, connectorsAreText, segments, level, list) {
1634
1668
  continue;
1635
1669
  }
1636
1670
  const dash = source[n2] === "-";
1637
- pendingHeredoc = { dash };
1671
+ pendingHeredoc = { dash, ...written };
1638
1672
  i = dash ? n2 : n1;
1639
1673
  continue;
1640
1674
  }
@@ -35,7 +35,7 @@
35
35
  * crash, when no lock survives.
36
36
  * What NEITHER covers, enumerated rather than implied:
37
37
  * · an ALREADY-constructed instance over this root through a path that does not hold `LOCK` (the
38
- * independent store faces — `new FileMemoryStore(root)`, the mailbox family). It keeps its open
38
+ * independent store faces — the mailbox family). It keeps its open
39
39
  * handles, and I6 is a construction-time gate, not a write-time one;
40
40
  * · a NEW construction whose anchor is not the data root. Two faces take a directory that need not
41
41
  * BE the data root — `FileDurableRulePartitionProvider` (the rule bucket) and
@@ -1,4 +1,3 @@
1
- import { type MemoryStore, type UtilityGate } from "../../core/memory.js";
2
1
  import type { CheckpointStore } from "../../core/checkpoint-store.js";
3
2
  import type { ToolResultStore } from "../../core/tool-result-store.js";
4
3
  import { type EvictPolicy } from "../../core/session-store.js";
@@ -17,7 +16,6 @@ import type { UsageWindowStore } from "../../core/usage-window-store.js";
17
16
  import type { EngineStorageBackend } from "../../core/engine-storage-backend.js";
18
17
  import { type RetentionDeclaration } from "../../core/retention.js";
19
18
  export { FileCheckpointStore, CHECKPOINT_LEDGER_EVENT_KINDS, readCheckpointLedger, type CheckpointLedgerEventKind, type CheckpointLedgerReading, type FileCheckpointStoreOptions, type ReadCheckpointLedgerOptions, } from "./checkpoint-store.js";
20
- export { FileMemoryStore } from "./memory-store.js";
21
19
  export { FileSessionRepo, type FileSessionRepoOptions } from "./session-store.js";
22
20
  export { FileToolResultStore } from "./tool-result-store.js";
23
21
  export { FileSessionPolicyStore, type FileSessionPolicyStoreOptions, type SessionPolicyCorruptReadInfo } from "./session-policy-store.js";
@@ -35,7 +33,7 @@ export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdopt
35
33
  * design/80 — the file-backed {@link EngineStorageBackend} for the local (TOC) single-user binary, selected
36
34
  * purely by what the embedder injects into `RunnerDeps` (no engine change). Construct one over a single data
37
35
  * root and pass its members into the `RunnerDeps` seats of the same names (every member of the contract is
38
- * one; the class's extra members — `root`, `memoryStore` — are not seats):
36
+ * one; the class's extra member `root` is not a seat):
39
37
  *
40
38
  * ```ts
41
39
  * const backend = new FileStorageBackend(); // ~/.ai-agent (or $AGENT_DATA_DIR)
@@ -63,8 +61,6 @@ export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdopt
63
61
  export interface FileStorageBackendOptions {
64
62
  /** Data root. Default `$AGENT_DATA_DIR ?? ~/.ai-agent`, NFC-normalized + realpath-canonicalized. */
65
63
  root?: string;
66
- /** Profile-injected promotable-write gate (design/77 §2). Threaded into `guardedMemoryStore`. */
67
- utilityGate?: UtilityGate;
68
64
  /** `TtlSessionStore` idle-eviction policy. Default `"forget"` (§7 decision 5 — durable history is never
69
65
  * deleted by an idle timer). */
70
66
  evict?: EvictPolicy;
@@ -92,12 +88,6 @@ export interface FileStorageBackendOptions {
92
88
  * (`mountedToolNames`, the roster its write and loosening checks judge rule names against). The corrupt-read sink is
93
89
  * wired from {@link FileStorageBackendOptions.onCorruptRead}, as for {@link fileHistory}. */
94
90
  sessionPolicy?: Omit<FileSessionPolicyStoreOptions, "onCorruptRead">;
95
- /** design/81 Slice 5 — an optional {@link import("../../core/memory.js").Embedder}. Injected ⇒ the memory
96
- * store does portable (in-process) vector recall over a rebuildable sidecar index (`vectorMode:"portable"`);
97
- * absent ⇒ the lexical floor, byte-identical to before. Config-driven (the deployment injects it); OFF by
98
- * default. 🔴 the consolidation band `{0.05,0.3}` is tuned for the lexical distance — a real embedding model
99
- * needs it re-tuned + a no-mis-merge live check BEFORE production-enable (design/81 Slice 5 release gate). */
100
- embedder?: import("../../core/memory.js").Embedder;
101
91
  /**
102
92
  * Disclosure sink for a durable read this backend's stores treat as ABSENT because the bytes were
103
93
  * corrupt or unreadable (never fires on plain ENOENT — real absence).
@@ -145,9 +135,6 @@ export declare class FileStorageBackend implements EngineStorageBackend {
145
135
  readonly root: string;
146
136
  readonly sessionStore: SessionStore;
147
137
  readonly checkpointStore: CheckpointStore;
148
- /** Wrapped in `guardedMemoryStore` (Gate-2 chokepoint). design/81: implements the id-addressable trio on
149
- * a lexical cosine-distance → `supportsConsolidation` is true → end-of-task consolidation lights up. */
150
- readonly memoryStore: MemoryStore;
151
138
  readonly toolResultStore: ToolResultStore;
152
139
  /** design/99 §E6 — file-backed per-session permission rules (E6). Wire into `RunnerDeps.sessionPolicyStore`
153
140
  * for a local deployment that needs session rules to survive a restart. */
@@ -184,7 +171,6 @@ export declare class FileStorageBackend implements EngineStorageBackend {
184
171
  private readonly fileAgentRows;
185
172
  private readonly fileMailbox;
186
173
  private readonly fileCheckpoints;
187
- private readonly fileMemory;
188
174
  private readonly ttl;
189
175
  /** RB-437 — kept so {@link dispose} can release the shared per-session authorities (and their append
190
176
  * descriptors) this backend joined; `TtlSessionStore.dispose()` only clears the sweep timer. */