reasonix 0.31.0 → 0.32.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.
- package/README.md +3 -7
- package/README.zh-CN.md +2 -6
- package/dashboard/dist/app.js +348 -80
- package/dashboard/dist/app.js.map +1 -1
- package/dist/cli/index.js +2135 -2467
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +37 -95
- package/dist/index.js +80 -676
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -159,65 +159,6 @@ declare class DeepSeekClient {
|
|
|
159
159
|
stream(opts: ChatRequestOptions): AsyncGenerator<StreamChunk>;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
/** Harvest failures return an empty state — main turn must never abort on a hiccup here. */
|
|
163
|
-
|
|
164
|
-
interface TypedPlanState {
|
|
165
|
-
subgoals: string[];
|
|
166
|
-
hypotheses: string[];
|
|
167
|
-
uncertainties: string[];
|
|
168
|
-
rejectedPaths: string[];
|
|
169
|
-
}
|
|
170
|
-
interface HarvestOptions {
|
|
171
|
-
/** Model used for the extraction call. Defaults to the cheap chat model. */
|
|
172
|
-
model?: string;
|
|
173
|
-
/** Cap on how many items land in each array. Default 5. */
|
|
174
|
-
maxItems?: number;
|
|
175
|
-
/** Per-item character cap. Default 80. */
|
|
176
|
-
maxItemLen?: number;
|
|
177
|
-
/** Abort the extraction if R1 reasoning is shorter than this. Default 40. */
|
|
178
|
-
minReasoningLen?: number;
|
|
179
|
-
}
|
|
180
|
-
declare function emptyPlanState(): TypedPlanState;
|
|
181
|
-
declare function isPlanStateEmpty(s: TypedPlanState | null | undefined): boolean;
|
|
182
|
-
declare function harvest(reasoningContent: string | null | undefined, client?: DeepSeekClient, options?: HarvestOptions, signal?: AbortSignal): Promise<TypedPlanState>;
|
|
183
|
-
|
|
184
|
-
/** N parallel samples; selector picks fewest uncertainties with shorter-answer tie-break (Occam prior). */
|
|
185
|
-
|
|
186
|
-
interface BranchSample {
|
|
187
|
-
index: number;
|
|
188
|
-
temperature: number;
|
|
189
|
-
response: ChatResponse;
|
|
190
|
-
planState: TypedPlanState;
|
|
191
|
-
}
|
|
192
|
-
type BranchSelector = (samples: BranchSample[]) => BranchSample;
|
|
193
|
-
interface BranchOptions {
|
|
194
|
-
/** Number of parallel samples. 1 disables branching. Default 1. */
|
|
195
|
-
budget?: number;
|
|
196
|
-
/** Temperatures for each branch. Default spreads across [0, 1]. */
|
|
197
|
-
temperatures?: readonly number[];
|
|
198
|
-
/** Harvest options; the selector needs harvest to score samples. */
|
|
199
|
-
harvestOptions?: HarvestOptions;
|
|
200
|
-
/** Custom selector. Default: min uncertainties, tie-break shortest answer. */
|
|
201
|
-
selector?: BranchSelector;
|
|
202
|
-
/** Not awaited; exceptions swallowed. Fires when sample's main + harvest both complete. */
|
|
203
|
-
onSampleDone?: (sample: BranchSample) => void;
|
|
204
|
-
}
|
|
205
|
-
interface BranchResult {
|
|
206
|
-
chosen: BranchSample;
|
|
207
|
-
samples: BranchSample[];
|
|
208
|
-
}
|
|
209
|
-
/** Default: fewest uncertainties wins, ties broken by shorter answer content. */
|
|
210
|
-
declare const defaultSelector: BranchSelector;
|
|
211
|
-
declare function runBranches(client: DeepSeekClient, request: ChatRequestOptions, opts?: BranchOptions): Promise<BranchResult>;
|
|
212
|
-
/** Sum usage across branch samples for telemetry purposes. */
|
|
213
|
-
declare function aggregateBranchUsage(samples: readonly BranchSample[]): {
|
|
214
|
-
promptTokens: number;
|
|
215
|
-
completionTokens: number;
|
|
216
|
-
totalTokens: number;
|
|
217
|
-
promptCacheHitTokens: number;
|
|
218
|
-
promptCacheMissTokens: number;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
162
|
/** Generic pause gate — bridges tool functions and the App's modals via Promises. */
|
|
222
163
|
type ConfirmationChoice = {
|
|
223
164
|
type: "deny";
|
|
@@ -624,20 +565,7 @@ type EventRole = "assistant_delta" | "assistant_final"
|
|
|
624
565
|
/** Pre-dispatch ping so the TUI can show a spinner during long tool awaits. */
|
|
625
566
|
| "tool_start" | "tool" | "done" | "error" | "warning"
|
|
626
567
|
/** Transient indicator for silent phases; UI clears on next primary event. */
|
|
627
|
-
| "status"
|
|
628
|
-
interface BranchSummary {
|
|
629
|
-
budget: number;
|
|
630
|
-
chosenIndex: number;
|
|
631
|
-
uncertainties: number[];
|
|
632
|
-
temperatures: number[];
|
|
633
|
-
}
|
|
634
|
-
interface BranchProgress {
|
|
635
|
-
completed: number;
|
|
636
|
-
total: number;
|
|
637
|
-
latestIndex: number;
|
|
638
|
-
latestTemperature: number;
|
|
639
|
-
latestUncertainties: number;
|
|
640
|
-
}
|
|
568
|
+
| "status";
|
|
641
569
|
interface LoopEvent {
|
|
642
570
|
turn: number;
|
|
643
571
|
role: EventRole;
|
|
@@ -653,10 +581,7 @@ interface LoopEvent {
|
|
|
653
581
|
/** Count of tool calls whose args have parsed as valid JSON (UI progress, not dispatch gate). */
|
|
654
582
|
toolCallReadyCount?: number;
|
|
655
583
|
stats?: TurnStats;
|
|
656
|
-
planState?: TypedPlanState;
|
|
657
584
|
repair?: RepairReport;
|
|
658
|
-
branch?: BranchSummary;
|
|
659
|
-
branchProgress?: BranchProgress;
|
|
660
585
|
error?: string;
|
|
661
586
|
/** Display-only — code-mode applier MUST skip SEARCH/REPLACE in forced-summary text. */
|
|
662
587
|
forcedSummary?: boolean;
|
|
@@ -774,9 +699,6 @@ interface CacheFirstLoopOptions {
|
|
|
774
699
|
model?: string;
|
|
775
700
|
maxToolIters?: number;
|
|
776
701
|
stream?: boolean;
|
|
777
|
-
harvest?: boolean | HarvestOptions;
|
|
778
|
-
/** Branching disables streaming (need all samples) and force-enables harvest (selector input). */
|
|
779
|
-
branch?: number | BranchOptions;
|
|
780
702
|
reasoningEffort?: "high" | "max";
|
|
781
703
|
autoEscalate?: boolean;
|
|
782
704
|
/** Soft USD cap — warns at 80%, refuses next turn at 100%. Opt-in (default no cap). */
|
|
@@ -791,8 +713,6 @@ interface CacheFirstLoopOptions {
|
|
|
791
713
|
}
|
|
792
714
|
interface ReconfigurableOptions {
|
|
793
715
|
model?: string;
|
|
794
|
-
harvest?: boolean | HarvestOptions;
|
|
795
|
-
branch?: number | BranchOptions;
|
|
796
716
|
stream?: boolean;
|
|
797
717
|
/** V4 thinking mode only; deepseek-chat ignores. */
|
|
798
718
|
reasoningEffort?: "high" | "max";
|
|
@@ -810,10 +730,6 @@ declare class CacheFirstLoop {
|
|
|
810
730
|
readonly repair: ToolCallRepair;
|
|
811
731
|
model: string;
|
|
812
732
|
stream: boolean;
|
|
813
|
-
harvestEnabled: boolean;
|
|
814
|
-
harvestOptions: HarvestOptions;
|
|
815
|
-
branchEnabled: boolean;
|
|
816
|
-
branchOptions: BranchOptions;
|
|
817
733
|
reasoningEffort: "high" | "max";
|
|
818
734
|
autoEscalate: boolean;
|
|
819
735
|
budgetUsd: number | null;
|
|
@@ -883,6 +799,8 @@ declare class CacheFirstLoop {
|
|
|
883
799
|
/** Expand `@path` mentions inline. Paths must resolve inside rootDir; escapes / oversize get a skip note, not content. */
|
|
884
800
|
/** Caps match tool-result dispatch truncation (0.5.2). */
|
|
885
801
|
declare const DEFAULT_AT_MENTION_MAX_BYTES: number;
|
|
802
|
+
/** Cap on entries returned for a `@<dir>` listing. ~200 paths × ~50 chars ≈ 10 KB — fits inside DEFAULT_AT_MENTION_MAX_BYTES with room for the rest of the prompt. */
|
|
803
|
+
declare const DEFAULT_AT_DIR_MAX_ENTRIES = 200;
|
|
886
804
|
/** Universally-uninteresting build / VCS dirs. Framework-specific dirs (Pods, target, …) live in .gitignore. */
|
|
887
805
|
declare const DEFAULT_PICKER_IGNORE_DIRS: readonly string[];
|
|
888
806
|
interface ListFilesOptions {
|
|
@@ -928,17 +846,32 @@ interface AtMentionExpansion {
|
|
|
928
846
|
path: string;
|
|
929
847
|
/** True if the content was inlined. False = skipped (reason in `skip`). */
|
|
930
848
|
ok: boolean;
|
|
931
|
-
/** Bytes read (only for ok=true). */
|
|
849
|
+
/** Bytes read (only for ok=true and isDirectory=false). */
|
|
932
850
|
bytes?: number;
|
|
851
|
+
/** True when the mention resolved to a directory (ok=true). Block uses `<directory>` instead of `<file>`. */
|
|
852
|
+
isDirectory?: boolean;
|
|
853
|
+
/** Number of files listed when isDirectory=true. */
|
|
854
|
+
entries?: number;
|
|
855
|
+
/** True iff the directory listing was clipped at maxDirEntries. */
|
|
856
|
+
truncated?: boolean;
|
|
933
857
|
/** Why the mention was skipped. Set when ok=false. */
|
|
934
858
|
skip?: "missing" | "not-file" | "too-large" | "escape" | "read-error";
|
|
935
859
|
}
|
|
936
860
|
interface AtMentionOptions {
|
|
937
861
|
/** Max file size in bytes before a mention is skipped. */
|
|
938
862
|
maxBytes?: number;
|
|
863
|
+
/** Cap on entries returned for a `@<dir>` listing. Default {@link DEFAULT_AT_DIR_MAX_ENTRIES}. */
|
|
864
|
+
maxDirEntries?: number;
|
|
939
865
|
fs?: {
|
|
940
866
|
exists: (path: string) => boolean;
|
|
941
867
|
isFile: (path: string) => boolean;
|
|
868
|
+
/** Optional — when omitted, directories are skipped as `not-file`. */
|
|
869
|
+
isDir?: (path: string) => boolean;
|
|
870
|
+
/** Optional — receives the directory's absolute path and the project root, returns relative paths and a truncated flag. */
|
|
871
|
+
listDir?: (dirAbs: string, root: string, max: number) => {
|
|
872
|
+
files: string[];
|
|
873
|
+
truncated: boolean;
|
|
874
|
+
};
|
|
942
875
|
size: (path: string) => number;
|
|
943
876
|
read: (path: string) => string;
|
|
944
877
|
};
|
|
@@ -1417,8 +1350,6 @@ interface TranscriptRecord {
|
|
|
1417
1350
|
model?: string;
|
|
1418
1351
|
/** Lets diff attribute cache-hit delta to log stability vs prompt change. */
|
|
1419
1352
|
prefixHash?: string;
|
|
1420
|
-
/** Absent means "no data", not "empty plan". */
|
|
1421
|
-
planState?: TypedPlanState;
|
|
1422
1353
|
/** Optional error message (role === "error"). */
|
|
1423
1354
|
error?: string;
|
|
1424
1355
|
}
|
|
@@ -1468,12 +1399,6 @@ interface ReplayStats extends SessionSummary {
|
|
|
1468
1399
|
userTurns: number;
|
|
1469
1400
|
/** Count of tool-role records (tool calls executed). */
|
|
1470
1401
|
toolCalls: number;
|
|
1471
|
-
/** Count of assistant_final records that carry a non-empty planState (harvest signal). */
|
|
1472
|
-
harvestedTurns: number;
|
|
1473
|
-
/** Sum of uncertainties across all harvested turns — a proxy for "how much did R1 hedge?" */
|
|
1474
|
-
totalUncertainties: number;
|
|
1475
|
-
/** Sum of subgoals across all harvested turns. */
|
|
1476
|
-
totalSubgoals: number;
|
|
1477
1402
|
}
|
|
1478
1403
|
declare function replayFromFile(path: string): {
|
|
1479
1404
|
parsed: ReadTranscriptResult;
|
|
@@ -2038,6 +1963,22 @@ type PresetName = "auto" | "flash" | "pro" | "fast" | "smart" | "max";
|
|
|
2038
1963
|
/** Single trust dial: review queues edits + gates shell; auto applies + gates shell; yolo skips both gates. */
|
|
2039
1964
|
type EditMode = "review" | "auto" | "yolo";
|
|
2040
1965
|
type ReasoningEffort = "high" | "max";
|
|
1966
|
+
type EmbeddingProvider = "ollama" | "openai-compat";
|
|
1967
|
+
interface OllamaEmbeddingUserConfig {
|
|
1968
|
+
baseUrl?: string;
|
|
1969
|
+
model?: string;
|
|
1970
|
+
}
|
|
1971
|
+
interface OpenAICompatEmbeddingUserConfig {
|
|
1972
|
+
baseUrl?: string;
|
|
1973
|
+
apiKey?: string;
|
|
1974
|
+
model?: string;
|
|
1975
|
+
extraBody?: Record<string, unknown>;
|
|
1976
|
+
}
|
|
1977
|
+
interface SemanticEmbeddingUserConfig {
|
|
1978
|
+
provider?: EmbeddingProvider;
|
|
1979
|
+
ollama?: OllamaEmbeddingUserConfig;
|
|
1980
|
+
openaiCompat?: OpenAICompatEmbeddingUserConfig;
|
|
1981
|
+
}
|
|
2041
1982
|
interface ReasonixConfig {
|
|
2042
1983
|
apiKey?: string;
|
|
2043
1984
|
baseUrl?: string;
|
|
@@ -2063,6 +2004,7 @@ interface ReasonixConfig {
|
|
|
2063
2004
|
};
|
|
2064
2005
|
};
|
|
2065
2006
|
index?: IndexUserConfig;
|
|
2007
|
+
semantic?: SemanticEmbeddingUserConfig;
|
|
2066
2008
|
}
|
|
2067
2009
|
declare function defaultConfigPath(): string;
|
|
2068
2010
|
declare function readConfig(path?: string): ReasonixConfig;
|
|
@@ -2213,4 +2155,4 @@ declare function aggregateUsage(records: UsageRecord[], opts?: AggregateOptions)
|
|
|
2213
2155
|
/** File-size helper for the stats header — "1.2 MB" etc. Returns "" if missing. */
|
|
2214
2156
|
declare function formatLogSize(path?: string): string;
|
|
2215
2157
|
|
|
2216
|
-
export { AT_MENTION_PATTERN, AT_PICKER_PREFIX, type AggregateOptions, AppendOnlyLog, type AppendUsageInput, type ApplyResult, type ApplyStatus, type AtMentionExpansion, type AtMentionOptions, type
|
|
2158
|
+
export { AT_MENTION_PATTERN, AT_PICKER_PREFIX, type AggregateOptions, AppendOnlyLog, type AppendUsageInput, type ApplyResult, type ApplyStatus, type AtMentionExpansion, type AtMentionOptions, type BridgeOptions, type BridgeResult, CODE_SYSTEM_PROMPT, CacheFirstLoop, type CacheFirstLoopOptions, type CallToolResult, type ChatMessage, type ChatResponse, type ChoiceOption, ChoiceRequestedError, type ChoiceToolOptions, type CodeSystemPromptOptions, DEFAULT_AT_DIR_MAX_ENTRIES, DEFAULT_AT_MENTION_MAX_BYTES, DEFAULT_MAX_RESULT_CHARS, DEFAULT_MAX_RESULT_TOKENS, DEFAULT_PICKER_IGNORE_DIRS, DeepSeekClient, type DeepSeekClientOptions, type RenderOptions as DiffRenderOptions, type DiffReport, type DiffSide, type EditBlock, type EditSnapshot, type EventRole, type FileWithStats, type FilesystemToolsOptions, type FlattenDecision, type FlattenOptions, type GetLatestVersionOptions, type GetPromptResult, HOOK_EVENTS, HOOK_SETTINGS_DIRNAME, HOOK_SETTINGS_FILENAME, type HookConfig, type HookEvent, type HookOutcome, type HookPayload, type HookReport, type HookScope, type HookSettings, type HookSpawnInput, type HookSpawnResult, type HookSpawner, ImmutablePrefix, type ImmutablePrefixOptions, type InitializeResult, type InspectionReport, type JSONSchema, type JsonRpcMessage, type JsonRpcRequest, type JsonRpcResponse, LATEST_CACHE_TTL_MS, LATEST_FETCH_TIMEOUT_MS, type ListFilesOptions, type ListPromptsResult, type ListResourcesResult, type ListToolsResult, type LoadHookSettingsOptions, 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, type PickerCandidate, PlanProposedError, PlanRevisionProposedError, type PlanStep, type PlanStepRisk, type PlanToolOptions, type ProgressNotificationParams, type ProjectMemory, type RankPickerOptions, type ReadResourceResult, type ReadTranscriptResult, type ReasonixConfig, type ReconfigurableOptions, type RepairReport, type ReplayStats, type ResolvedHook, type RetryInfo, type RetryOptions, type Role, type RunCommandResult, type RunHooksOptions, 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, type StepCompletion, StormBreaker, type StreamChunk, type StreamableHttpMcpSpec, StreamableHttpTransport, type StreamableHttpTransportOptions, type SubagentEvent, type SubagentSink, type SubagentToolOptions, type ToolCall, type ToolCallContext, ToolCallRepair, type ToolCallRepairOptions, type ToolDefinition, type ToolFunctionSpec, ToolRegistry, type ToolSpec, type TranscriptMeta, type TranscriptRecord, type TruncationRepairResult, type TurnPair, type TurnStats, USER_MEMORY_DIR, Usage, type UsageAggregate, type UsageBucket, type UsageRecord, VERSION, VolatileScratch, type WebFetchOptions, type WebSearchOptions, type WebToolsOptions, aggregateUsage, analyzeSchema, appendSessionMessage, appendUsage, applyEditBlock, applyEditBlocks, applyMemoryStack, applyProjectMemory, applyUserMemory, bridgeMcpTools, bucketCacheHitRatio, bucketSavingsFraction, claudeEquivalentCost, codeSystemPrompt, compareVersions, computeReplayStats, costUsd, decideOutcome, defaultConfigPath, defaultUsageLogPath, deleteSession, detectAtPicker, detectShellOperator, diffTranscripts, expandAtMentions, fetchWithRetry, fixToolCallPairing, flattenMcpResult, flattenSchema, forkRegistryExcluding, formatCommandResult, formatHookOutcomeMessage, formatLogSize, formatLoopError, formatSearchResults, getLatestVersion, globalSettingsPath, healLoadedMessages, healLoadedMessagesByTokens, htmlToText, injectPowerShellUtf8, inputCostUsd, inspectMcpServer, isAllowed, isJsonRpcError, isNpxInstall, isPlausibleKey, listFilesSync, listFilesWithStatsAsync, listFilesWithStatsSync, listSessions, loadApiKey, loadDotenv, loadHooks, loadSessionMessages, matchesTool, memoryEnabled, nestArguments, openTranscriptFile, outputCostUsd, parseEditBlocks, parseMcpSpec, parseMojeekResults, parseSearxngHtmlResults, parseTranscript, prepareSpawn, projectHash, projectSettingsPath, quoteForCmdExe, rankPickerCandidates, readConfig, readProjectMemory, readTranscript, readUsageLog, recordFromLoopEvent, redactKey, registerChoiceTool, registerFilesystemTools, registerMemoryTools, registerPlanTool, registerShellTools, registerSubagentTool, registerWebTools, renderMarkdown as renderDiffMarkdown, renderSummaryTable as renderDiffSummary, repairTruncatedJson, replayFromFile, resolveExecutable, restoreSnapshots, runCommand, runHooks, sanitizeMemoryName, sanitizeName as sanitizeSessionName, saveApiKey, scavengeToolCalls, sessionPath, sessionsDir, similarity, snapshotBeforeEdits, stripHallucinatedToolMarkup, tokenizeCommand, truncateForModel, truncateForModelByTokens, webFetch, webSearch, withUtf8Codepage, writeConfig, writeMeta, writeRecord };
|