reasonix 0.4.19 → 0.4.21

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.
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  CODE_SYSTEM_PROMPT,
4
4
  codeSystemPrompt
5
- } from "./chunk-HNEWBEWZ.js";
5
+ } from "./chunk-K6MR4SWS.js";
6
6
  export {
7
7
  CODE_SYSTEM_PROMPT,
8
8
  codeSystemPrompt
9
9
  };
10
- //# sourceMappingURL=prompt-JNNNJLYF.js.map
10
+ //# sourceMappingURL=prompt-VDN5U3YE.js.map
package/dist/index.d.ts CHANGED
@@ -813,6 +813,120 @@ declare function memoryEnabled(): boolean;
813
813
  */
814
814
  declare function applyProjectMemory(basePrompt: string, rootDir: string): string;
815
815
 
816
+ /**
817
+ * User memory — `~/.reasonix/memory/` markdown notes pinned into the
818
+ * immutable-prefix system prompt across sessions.
819
+ *
820
+ * Two scopes:
821
+ * - `global` → `~/.reasonix/memory/global/` (cross-project)
822
+ * - `project` → `~/.reasonix/memory/<hash>/` (per sandbox root)
823
+ *
824
+ * Each scope has an always-loaded `MEMORY.md` index plus zero-or-more
825
+ * `<name>.md` detail files loaded on demand via `recall_memory`.
826
+ *
827
+ * Distinct from `src/project-memory.ts` (REASONIX.md) in purpose:
828
+ * REASONIX.md is committable, team-shared project memory.
829
+ * ~/.reasonix/memory is user-private memory, never committed.
830
+ */
831
+ declare const USER_MEMORY_DIR = "memory";
832
+ declare const MEMORY_INDEX_FILE = "MEMORY.md";
833
+ /** Cap on the index file content loaded into the prefix, per scope. */
834
+ declare const MEMORY_INDEX_MAX_CHARS = 4000;
835
+ type MemoryType = "user" | "feedback" | "project" | "reference";
836
+ type MemoryScope = "global" | "project";
837
+ interface MemoryEntry {
838
+ name: string;
839
+ type: MemoryType;
840
+ scope: MemoryScope;
841
+ description: string;
842
+ body: string;
843
+ /** ISO date string (YYYY-MM-DD). */
844
+ createdAt: string;
845
+ }
846
+ interface MemoryStoreOptions {
847
+ /** Override `~/.reasonix` — tests set this to a tmpdir. */
848
+ homeDir?: string;
849
+ /** Absolute sandbox root. Required to use `scope: "project"`. */
850
+ projectRoot?: string;
851
+ }
852
+ interface WriteInput {
853
+ name: string;
854
+ type: MemoryType;
855
+ scope: MemoryScope;
856
+ description: string;
857
+ body: string;
858
+ }
859
+ /**
860
+ * Throws on filename injection attempts (`../foo`, `foo/bar`, leading
861
+ * dots, etc.). Allowed: 3-40 chars, alnum + `_` + `-` + interior `.`.
862
+ */
863
+ declare function sanitizeMemoryName(raw: string): string;
864
+ /** Stable 16-hex-char hash of an absolute sandbox root path. */
865
+ declare function projectHash(rootDir: string): string;
866
+ declare class MemoryStore {
867
+ private readonly homeDir;
868
+ private readonly projectRoot;
869
+ constructor(opts?: MemoryStoreOptions);
870
+ /** Directory this store writes `scope` files into, creating it if needed. */
871
+ dir(scope: MemoryScope): string;
872
+ /** Absolute path to a memory file (no existence check). */
873
+ pathFor(scope: MemoryScope, name: string): string;
874
+ /** True iff this store is configured with a project scope available. */
875
+ hasProjectScope(): boolean;
876
+ /**
877
+ * Read the `MEMORY.md` index for a scope. Returns post-cap content
878
+ * (with a truncation marker if clipped), or `null` when absent / empty.
879
+ */
880
+ loadIndex(scope: MemoryScope): {
881
+ content: string;
882
+ originalChars: number;
883
+ truncated: boolean;
884
+ } | null;
885
+ /** Read one memory file's body (frontmatter stripped). Throws if missing. */
886
+ read(scope: MemoryScope, name: string): MemoryEntry;
887
+ /**
888
+ * List every memory in this store. Scans both scopes (skips project
889
+ * scope if unconfigured). Silently skips malformed files; the index
890
+ * must stay queryable even if one file is hand-edited into nonsense.
891
+ */
892
+ list(): MemoryEntry[];
893
+ /**
894
+ * Write a new memory (or overwrite existing). Creates the scope dir,
895
+ * writes the `.md` file, and regenerates `MEMORY.md`. Returns the
896
+ * absolute path written to.
897
+ */
898
+ write(input: WriteInput): string;
899
+ /** Delete one memory + its index line. No-op if the file is already gone. */
900
+ delete(scope: MemoryScope, rawName: string): boolean;
901
+ /**
902
+ * Rebuild `MEMORY.md` from the `.md` files currently in the scope dir.
903
+ * Called after every write/delete. Sorted by name for stable prefix
904
+ * hashing — two stores with the same set of files produce byte-identical
905
+ * MEMORY.md content, keeping the cache prefix reproducible.
906
+ */
907
+ private regenerateIndex;
908
+ }
909
+ /**
910
+ * Append `MEMORY_GLOBAL` and (optionally) `MEMORY_PROJECT` blocks to
911
+ * `basePrompt`. Omits a block entirely when its index is absent — an
912
+ * empty tag would add bytes to the prefix hash without content.
913
+ * Respects `REASONIX_MEMORY=off` via `memoryEnabled()` from
914
+ * `project-memory.ts`.
915
+ */
916
+ declare function applyUserMemory(basePrompt: string, opts?: {
917
+ homeDir?: string;
918
+ projectRoot?: string;
919
+ }): string;
920
+ /**
921
+ * Compose every lazy-loaded prefix block in one call: REASONIX.md,
922
+ * user memory (global + project), and the skills index. Drop-in
923
+ * replacement for `applyProjectMemory` at CLI entry points. Stacking
924
+ * order is stable — the prefix hash only changes when block *content*
925
+ * changes, not when this helper is called a second time with the same
926
+ * filesystem state.
927
+ */
928
+ declare function applyMemoryStack(basePrompt: string, rootDir: string): string;
929
+
816
930
  /**
817
931
  * Built-in filesystem tools for `reasonix code`.
818
932
  *
@@ -857,6 +971,30 @@ interface FilesystemToolsOptions {
857
971
  }
858
972
  declare function registerFilesystemTools(registry: ToolRegistry, opts: FilesystemToolsOptions): ToolRegistry;
859
973
 
974
+ /**
975
+ * `remember` / `forget` / `recall_memory` — tools that let the model
976
+ * read and write the user-memory store across sessions.
977
+ *
978
+ * Scope rules:
979
+ * - `global` — always available (no sandbox needed).
980
+ * - `project` — requires a `projectRoot` on MemoryStore. In chat mode
981
+ * (no sandbox), the tools still register but a `scope=project` call
982
+ * returns a structured refusal so the model can try `global` instead.
983
+ *
984
+ * Memory changes are written eagerly but NOT re-loaded into the prefix
985
+ * mid-session (cache invariant). The user notices at `/new` or the next
986
+ * launch — or they can read fresh content via `recall_memory` which
987
+ * always hits disk.
988
+ */
989
+
990
+ interface MemoryToolsOptions {
991
+ /** Sandbox root for the `project` scope. Omit for chat mode. */
992
+ projectRoot?: string;
993
+ /** Override `~/.reasonix` (tests). */
994
+ homeDir?: string;
995
+ }
996
+ declare function registerMemoryTools(registry: ToolRegistry, opts?: MemoryToolsOptions): ToolRegistry;
997
+
860
998
  /**
861
999
  * Plan Mode — read-only exploration phase for `reasonix code`.
862
1000
  *
@@ -957,8 +1095,14 @@ interface ShellToolsOptions {
957
1095
  /**
958
1096
  * Extra command-name prefixes the user explicitly trusts. Added on
959
1097
  * top of the built-in allowlist. Examples: `["my-ci-script", "lint"]`.
1098
+ *
1099
+ * Accepts either a fixed array (captured once at registration) or a
1100
+ * getter called on every dispatch. The getter form is load-bearing:
1101
+ * when the TUI's `ShellConfirm` writes a new prefix to config mid-
1102
+ * session, the running `run_command` must pick it up immediately —
1103
+ * otherwise the same command gets re-prompted until the next launch.
960
1104
  */
961
- extraAllowed?: string[];
1105
+ extraAllowed?: readonly string[] | (() => readonly string[]);
962
1106
  /**
963
1107
  * When true, skip the allowlist entirely and auto-run every command.
964
1108
  * Off by default — this is an escape hatch for non-interactive use
@@ -2084,7 +2228,7 @@ declare function restoreSnapshots(snapshots: EditSnapshot[], rootDir: string): A
2084
2228
  * the Cache-First Loop is trying to conserve. The SEARCH/REPLACE spec
2085
2229
  * is the one unavoidable bloat; we trim everything else.
2086
2230
  */
2087
- declare const CODE_SYSTEM_PROMPT = "You are Reasonix Code, a coding assistant. You have filesystem tools (read_file, write_file, list_directory, search_files, etc.) rooted at the user's working directory.\n\n# When to propose a plan (submit_plan)\n\nYou have a `submit_plan` tool that shows the user a markdown plan and lets them Approve / Refine / Cancel before you execute. Use it proactively when the task is large enough to deserve a review gate:\n\n- Multi-file refactors or renames.\n- Architecture changes (moving modules, splitting / merging files, new abstractions).\n- Anything where \"undo\" after the fact would be expensive \u2014 migrations, destructive cleanups, API shape changes.\n- When the user's request is ambiguous and multiple reasonable interpretations exist \u2014 propose your reading as a plan and let them confirm.\n\nSkip submit_plan for small, obvious changes: one-line typo, clear bug with a clear fix, adding a missing import, renaming a local variable. Just do those.\n\nPlan body: one-sentence summary, then a file-by-file breakdown of what you'll change and why, and any risks or open questions. If some decisions are genuinely up to the user (naming, tradeoffs, out-of-scope possibilities), list them in an \"Open questions\" or \"\u5F85\u786E\u8BA4\" section \u2014 the user sees the plan in a picker and has a text input to answer your questions before approving. Don't pretend certainty you don't have; flagged questions are how the user tells you what they care about. After calling submit_plan, STOP \u2014 don't call any more tools, wait for the user's verdict.\n\n# Plan mode (/plan)\n\nThe user can ALSO enter \"plan mode\" via /plan, which is a stronger, explicit constraint:\n- Write tools (edit_file, write_file, create_directory, move_file) and non-allowlisted run_command calls are BOUNCED at dispatch \u2014 you'll get a tool result like \"unavailable in plan mode\". Don't retry them.\n- Read tools (read_file, list_directory, search_files, directory_tree, get_file_info) and allowlisted shell (git status/log/diff, ls, cat, grep, cargo check, npm test) still work \u2014 use them to investigate.\n- You MUST call submit_plan before anything will execute. Approve exits plan mode; Refine stays in; Cancel exits without implementing.\n\n\n# When to edit vs. when to explore\n\nOnly propose edits when the user explicitly asks you to change, fix, add, remove, refactor, or write something. Do NOT propose edits when the user asks you to:\n- analyze, read, explore, describe, or summarize a project\n- explain how something works\n- answer a question about the code\n\nIn those cases, use tools to gather what you need, then reply in prose. No SEARCH/REPLACE blocks, no file changes. If you're unsure what the user wants, ask.\n\nWhen you do propose edits, the user will review them and decide whether to `/apply` or `/discard`. Don't assume they'll accept \u2014 write as if each edit will be audited, because it will.\n\n# Editing files\n\nWhen you've been asked to change a file, output one or more SEARCH/REPLACE blocks in this exact format:\n\npath/to/file.ext\n<<<<<<< SEARCH\nexact existing lines from the file, including whitespace\n=======\nthe new lines\n>>>>>>> REPLACE\n\nRules:\n- Always read_file first so your SEARCH matches byte-for-byte. If it doesn't match, the edit is rejected and you'll have to retry with the exact current content.\n- One edit per block. Multiple blocks in one response are fine.\n- To create a new file, leave SEARCH empty:\n path/to/new.ts\n <<<<<<< SEARCH\n =======\n (whole file content here)\n >>>>>>> REPLACE\n- Do NOT use write_file to change existing files \u2014 the user reviews your edits as SEARCH/REPLACE. write_file is only for files you explicitly want to overwrite wholesale (rare).\n- Paths are relative to the working directory. Don't use absolute paths.\n\n# Exploration\n\n- Avoid listing or reading inside these common dependency / build directories unless the user explicitly asks about them: node_modules, dist, build, out, .next, .nuxt, .svelte-kit, .git, .venv, venv, __pycache__, target, coverage, .turbo, .cache. They're expensive and usually irrelevant.\n- Prefer search_files / grep over list_directory when you know roughly what you're looking for \u2014 it saves context and avoids enumerating huge trees.\n\n# Style\n\n- Show edits; don't narrate them in prose. \"Here's the fix:\" is enough.\n- One short paragraph explaining *why*, then the blocks.\n- If you need to explore first (list / grep / read), do it with tool calls before writing any prose \u2014 silence while exploring is fine.\n";
2231
+ declare const CODE_SYSTEM_PROMPT = "You are Reasonix Code, a coding assistant. You have filesystem tools (read_file, write_file, list_directory, search_files, etc.) rooted at the user's working directory.\n\n# When to propose a plan (submit_plan)\n\nYou have a `submit_plan` tool that shows the user a markdown plan and lets them Approve / Refine / Cancel before you execute. Use it proactively when the task is large enough to deserve a review gate:\n\n- Multi-file refactors or renames.\n- Architecture changes (moving modules, splitting / merging files, new abstractions).\n- Anything where \"undo\" after the fact would be expensive \u2014 migrations, destructive cleanups, API shape changes.\n- When the user's request is ambiguous and multiple reasonable interpretations exist \u2014 propose your reading as a plan and let them confirm.\n\nSkip submit_plan for small, obvious changes: one-line typo, clear bug with a clear fix, adding a missing import, renaming a local variable. Just do those.\n\nPlan body: one-sentence summary, then a file-by-file breakdown of what you'll change and why, and any risks or open questions. If some decisions are genuinely up to the user (naming, tradeoffs, out-of-scope possibilities), list them in an \"Open questions\" section \u2014 the user sees the plan in a picker and has a text input to answer your questions before approving. Don't pretend certainty you don't have; flagged questions are how the user tells you what they care about. After calling submit_plan, STOP \u2014 don't call any more tools, wait for the user's verdict.\n\n# Plan mode (/plan)\n\nThe user can ALSO enter \"plan mode\" via /plan, which is a stronger, explicit constraint:\n- Write tools (edit_file, write_file, create_directory, move_file) and non-allowlisted run_command calls are BOUNCED at dispatch \u2014 you'll get a tool result like \"unavailable in plan mode\". Don't retry them.\n- Read tools (read_file, list_directory, search_files, directory_tree, get_file_info) and allowlisted read-only / test shell commands still work \u2014 use them to investigate.\n- You MUST call submit_plan before anything will execute. Approve exits plan mode; Refine stays in; Cancel exits without implementing.\n\n\n# When to edit vs. when to explore\n\nOnly propose edits when the user explicitly asks you to change, fix, add, remove, refactor, or write something. Do NOT propose edits when the user asks you to:\n- analyze, read, explore, describe, or summarize a project\n- explain how something works\n- answer a question about the code\n\nIn those cases, use tools to gather what you need, then reply in prose. No SEARCH/REPLACE blocks, no file changes. If you're unsure what the user wants, ask.\n\nWhen you do propose edits, the user will review them and decide whether to `/apply` or `/discard`. Don't assume they'll accept \u2014 write as if each edit will be audited, because it will.\n\n# Editing files\n\nWhen you've been asked to change a file, output one or more SEARCH/REPLACE blocks in this exact format:\n\npath/to/file.ext\n<<<<<<< SEARCH\nexact existing lines from the file, including whitespace\n=======\nthe new lines\n>>>>>>> REPLACE\n\nRules:\n- Always read_file first so your SEARCH matches byte-for-byte. If it doesn't match, the edit is rejected and you'll have to retry with the exact current content.\n- One edit per block. Multiple blocks in one response are fine.\n- To create a new file, leave SEARCH empty:\n path/to/new.ts\n <<<<<<< SEARCH\n =======\n (whole file content here)\n >>>>>>> REPLACE\n- Do NOT use write_file to change existing files \u2014 the user reviews your edits as SEARCH/REPLACE. write_file is only for files you explicitly want to overwrite wholesale (rare).\n- Paths are relative to the working directory. Don't use absolute paths.\n\n# Trust what you already know\n\nBefore exploring the filesystem to answer a factual question, check whether the answer is already in context: the user's current message, earlier turns in this conversation (including prior tool results from `remember`), and the pinned memory blocks at the top of this prompt. When the user has stated a fact or you have remembered one, it outranks what the files say \u2014 don't re-derive from code what the user already told you. Explore when you genuinely don't know.\n\n# Exploration\n\n- Skip dependency, build, and VCS directories unless the user explicitly asks. The pinned .gitignore block (if any, below) is your authoritative denylist.\n- Prefer search_files / grep over list_directory when you know roughly what you're looking for \u2014 it saves context and avoids enumerating huge trees.\n\n# Style\n\n- Show edits; don't narrate them in prose. \"Here's the fix:\" is enough.\n- One short paragraph explaining *why*, then the blocks.\n- If you need to explore first (list / grep / read), do it with tool calls before writing any prose \u2014 silence while exploring is fine.\n";
2088
2232
  /**
2089
2233
  * Inject the project's `.gitignore` content into the system prompt as a
2090
2234
  * "respect this on top of the built-in denylist" hint. We don't parse
@@ -2092,7 +2236,7 @@ declare const CODE_SYSTEM_PROMPT = "You are Reasonix Code, a coding assistant. Y
2092
2236
  * don't eat context budget on huge generated ignore lists.
2093
2237
  *
2094
2238
  * Stacking order (stable for cache prefix):
2095
- * base prompt → project memory (REASONIX.md) → .gitignore block
2239
+ * base prompt → REASONIX.md global MEMORY.md → project MEMORY.md → .gitignore
2096
2240
  */
2097
2241
  declare function codeSystemPrompt(rootDir: string): string;
2098
2242
 
@@ -2166,6 +2310,6 @@ declare function redactKey(key: string): string;
2166
2310
 
2167
2311
  /** Reasonix — DeepSeek-native agent framework. Library entry point. */
2168
2312
 
2169
- declare const VERSION = "0.4.19";
2313
+ declare const VERSION = "0.4.20";
2170
2314
 
2171
- export { AppendOnlyLog, type ApplyResult, type ApplyStatus, type BranchOptions, type BranchProgress, type BranchResult, type BranchSample, type BranchSelector, type BranchSummary, type BridgeOptions, type BridgeResult, CODE_SYSTEM_PROMPT, CacheFirstLoop, type CacheFirstLoopOptions, type CallToolResult, type ChatMessage, type ChatResponse, DEFAULT_MAX_RESULT_CHARS, DeepSeekClient, type DeepSeekClientOptions, type RenderOptions as DiffRenderOptions, type DiffReport, type DiffSide, type EditBlock, type EditSnapshot, type EventRole, type FilesystemToolsOptions, type FlattenDecision, type FlattenOptions, type GetPromptResult, type HarvestOptions, ImmutablePrefix, type ImmutablePrefixOptions, type InitializeResult, type InspectionReport, type JSONSchema, type JsonRpcMessage, type JsonRpcRequest, type JsonRpcResponse, type ListPromptsResult, type ListResourcesResult, type ListToolsResult, type LoopEvent, MCP_PROTOCOL_VERSION, McpClient, type McpClientOptions, type McpContentBlock, type McpProgressHandler, type McpProgressInfo, type McpPrompt, type McpPromptArgument, type McpPromptMessage, type McpPromptResourceBlock, type McpResource, type McpResourceContents, type McpResourceContentsBlob, type McpResourceContentsText, type McpSpec, type McpTool, type McpToolSchema, type McpTransport, NeedsConfirmationError, PROJECT_MEMORY_FILE, PROJECT_MEMORY_MAX_CHARS, type PageContent, PlanProposedError, type PlanToolOptions, type ProgressNotificationParams, type ProjectMemory, type ReadResourceResult, type ReadTranscriptResult, type ReasonixConfig, type ReconfigurableOptions, type RepairReport, type ReplayStats, type RetryInfo, type RetryOptions, type Role, type RunCommandResult, type ScavengeOptions, type ScavengeResult, type SearchResult, type SectionResult, type SessionInfo, SessionStats, type SessionSummary, type ShellToolsOptions, type SseMcpSpec, SseTransport, type SseTransportOptions, type StdioMcpSpec, StdioTransport, type StdioTransportOptions, StormBreaker, type StreamChunk, type ToolCall, type ToolCallContext, ToolCallRepair, type ToolCallRepairOptions, type ToolDefinition, type ToolFunctionSpec, ToolRegistry, type ToolSpec, type TranscriptMeta, type TranscriptRecord, type TruncationRepairResult, type TurnPair, type TurnStats, type TypedPlanState, Usage, VERSION, VolatileScratch, type WebFetchOptions, type WebSearchOptions, type WebToolsOptions, aggregateBranchUsage, analyzeSchema, appendSessionMessage, applyEditBlock, applyEditBlocks, applyProjectMemory, bridgeMcpTools, claudeEquivalentCost, codeSystemPrompt, computeReplayStats, costUsd, defaultConfigPath, defaultSelector, deleteSession, diffTranscripts, emptyPlanState, fetchWithRetry, flattenMcpResult, flattenSchema, formatCommandResult, formatLoopError, formatSearchResults, harvest, healLoadedMessages, htmlToText, inputCostUsd, inspectMcpServer, isAllowed, isJsonRpcError, isPlanStateEmpty, isPlausibleKey, listSessions, loadApiKey, loadDotenv, loadSessionMessages, memoryEnabled, nestArguments, openTranscriptFile, outputCostUsd, parseEditBlocks, parseMcpSpec, parseMojeekResults, parseTranscript, prepareSpawn, quoteForCmdExe, readConfig, readProjectMemory, readTranscript, recordFromLoopEvent, redactKey, registerFilesystemTools, registerPlanTool, registerShellTools, registerWebTools, renderMarkdown as renderDiffMarkdown, renderSummaryTable as renderDiffSummary, repairTruncatedJson, replayFromFile, resolveExecutable, restoreSnapshots, runBranches, runCommand, sanitizeName as sanitizeSessionName, saveApiKey, scavengeToolCalls, sessionPath, sessionsDir, similarity, snapshotBeforeEdits, stripHallucinatedToolMarkup, tokenizeCommand, truncateForModel, webFetch, webSearch, writeConfig, writeMeta, writeRecord };
2315
+ export { AppendOnlyLog, type ApplyResult, type ApplyStatus, type BranchOptions, type BranchProgress, type BranchResult, type BranchSample, type BranchSelector, type BranchSummary, type BridgeOptions, type BridgeResult, CODE_SYSTEM_PROMPT, CacheFirstLoop, type CacheFirstLoopOptions, type CallToolResult, type ChatMessage, type ChatResponse, DEFAULT_MAX_RESULT_CHARS, DeepSeekClient, type DeepSeekClientOptions, type RenderOptions as DiffRenderOptions, type DiffReport, type DiffSide, type EditBlock, type EditSnapshot, type EventRole, type FilesystemToolsOptions, type FlattenDecision, type FlattenOptions, type GetPromptResult, type HarvestOptions, ImmutablePrefix, type ImmutablePrefixOptions, type InitializeResult, type InspectionReport, type JSONSchema, type JsonRpcMessage, type JsonRpcRequest, type JsonRpcResponse, type ListPromptsResult, type ListResourcesResult, type ListToolsResult, type LoopEvent, MCP_PROTOCOL_VERSION, MEMORY_INDEX_FILE, MEMORY_INDEX_MAX_CHARS, McpClient, type McpClientOptions, type McpContentBlock, type McpProgressHandler, type McpProgressInfo, type McpPrompt, type McpPromptArgument, type McpPromptMessage, type McpPromptResourceBlock, type McpResource, type McpResourceContents, type McpResourceContentsBlob, type McpResourceContentsText, type McpSpec, type McpTool, type McpToolSchema, type McpTransport, type MemoryEntry, type MemoryScope, MemoryStore, type MemoryStoreOptions, type MemoryToolsOptions, type MemoryType, type WriteInput as MemoryWriteInput, NeedsConfirmationError, PROJECT_MEMORY_FILE, PROJECT_MEMORY_MAX_CHARS, type PageContent, PlanProposedError, type PlanToolOptions, type ProgressNotificationParams, type ProjectMemory, type ReadResourceResult, type ReadTranscriptResult, type ReasonixConfig, type ReconfigurableOptions, type RepairReport, type ReplayStats, type RetryInfo, type RetryOptions, type Role, type RunCommandResult, type ScavengeOptions, type ScavengeResult, type SearchResult, type SectionResult, type SessionInfo, SessionStats, type SessionSummary, type ShellToolsOptions, type SseMcpSpec, SseTransport, type SseTransportOptions, type StdioMcpSpec, StdioTransport, type StdioTransportOptions, StormBreaker, type StreamChunk, type ToolCall, type ToolCallContext, ToolCallRepair, type ToolCallRepairOptions, type ToolDefinition, type ToolFunctionSpec, ToolRegistry, type ToolSpec, type TranscriptMeta, type TranscriptRecord, type TruncationRepairResult, type TurnPair, type TurnStats, type TypedPlanState, USER_MEMORY_DIR, Usage, VERSION, VolatileScratch, type WebFetchOptions, type WebSearchOptions, type WebToolsOptions, aggregateBranchUsage, analyzeSchema, appendSessionMessage, applyEditBlock, applyEditBlocks, applyMemoryStack, applyProjectMemory, applyUserMemory, bridgeMcpTools, claudeEquivalentCost, codeSystemPrompt, computeReplayStats, costUsd, defaultConfigPath, defaultSelector, deleteSession, diffTranscripts, emptyPlanState, fetchWithRetry, flattenMcpResult, flattenSchema, formatCommandResult, formatLoopError, formatSearchResults, harvest, healLoadedMessages, htmlToText, inputCostUsd, inspectMcpServer, isAllowed, isJsonRpcError, isPlanStateEmpty, isPlausibleKey, listSessions, loadApiKey, loadDotenv, loadSessionMessages, memoryEnabled, nestArguments, openTranscriptFile, outputCostUsd, parseEditBlocks, parseMcpSpec, parseMojeekResults, parseTranscript, prepareSpawn, projectHash, quoteForCmdExe, readConfig, readProjectMemory, readTranscript, recordFromLoopEvent, redactKey, registerFilesystemTools, registerMemoryTools, registerPlanTool, registerShellTools, registerWebTools, renderMarkdown as renderDiffMarkdown, renderSummaryTable as renderDiffSummary, repairTruncatedJson, replayFromFile, resolveExecutable, restoreSnapshots, runBranches, runCommand, sanitizeMemoryName, sanitizeName as sanitizeSessionName, saveApiKey, scavengeToolCalls, sessionPath, sessionsDir, similarity, snapshotBeforeEdits, stripHallucinatedToolMarkup, tokenizeCommand, truncateForModel, webFetch, webSearch, writeConfig, writeMeta, writeRecord };