reasonix 0.3.0-alpha.1 → 0.3.0-alpha.2

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/dist/index.d.ts CHANGED
@@ -923,6 +923,13 @@ interface StdioTransportOptions {
923
923
  replaceEnv?: boolean;
924
924
  /** CWD for the child. Default: process.cwd(). */
925
925
  cwd?: string;
926
+ /**
927
+ * Spawn through a shell. Default: true on win32 (needed to resolve
928
+ * `.cmd` wrappers like `npx.cmd`, `pnpm.cmd`), false elsewhere.
929
+ * Explicitly pass `false` to opt out on Windows; pass `true` to force
930
+ * it on POSIX (rarely needed).
931
+ */
932
+ shell?: boolean;
926
933
  }
927
934
  /**
928
935
  * Spawn `command args...` as a child process and use its stdin/stdout as
@@ -1065,6 +1072,6 @@ declare function redactKey(key: string): string;
1065
1072
 
1066
1073
  /** Reasonix — DeepSeek-native agent framework. Library entry point. */
1067
1074
 
1068
- declare const VERSION = "0.3.0-alpha.1";
1075
+ declare const VERSION = "0.3.0-alpha.2";
1069
1076
 
1070
1077
  export { AppendOnlyLog, type BranchOptions, type BranchProgress, type BranchResult, type BranchSample, type BranchSelector, type BranchSummary, type BridgeOptions, type BridgeResult, CacheFirstLoop, type CacheFirstLoopOptions, type CallToolResult, type ChatMessage, type ChatResponse, DeepSeekClient, type DeepSeekClientOptions, type RenderOptions as DiffRenderOptions, type DiffReport, type DiffSide, type EventRole, type FlattenDecision, type HarvestOptions, ImmutablePrefix, type ImmutablePrefixOptions, type InitializeResult, type JSONSchema, type JsonRpcMessage, type JsonRpcRequest, type JsonRpcResponse, type ListToolsResult, type LoopEvent, MCP_PROTOCOL_VERSION, McpClient, type McpClientOptions, type McpContentBlock, type McpTool, type McpToolSchema, type McpTransport, type ReadTranscriptResult, type ReasonixConfig, type ReconfigurableOptions, type RepairReport, type ReplayStats, type RetryInfo, type RetryOptions, type Role, type ScavengeOptions, type ScavengeResult, type SessionInfo, SessionStats, type SessionSummary, StdioTransport, type StdioTransportOptions, StormBreaker, type StreamChunk, type ToolCall, 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, aggregateBranchUsage, analyzeSchema, appendSessionMessage, bridgeMcpTools, claudeEquivalentCost, computeReplayStats, costUsd, defaultConfigPath, defaultSelector, deleteSession, diffTranscripts, emptyPlanState, fetchWithRetry, flattenMcpResult, flattenSchema, harvest, isJsonRpcError, isPlanStateEmpty, isPlausibleKey, listSessions, loadApiKey, loadDotenv, loadSessionMessages, nestArguments, openTranscriptFile, parseTranscript, readConfig, readTranscript, recordFromLoopEvent, redactKey, renderMarkdown as renderDiffMarkdown, renderSummaryTable as renderDiffSummary, repairTruncatedJson, replayFromFile, runBranches, sanitizeName as sanitizeSessionName, saveApiKey, scavengeToolCalls, sessionPath, sessionsDir, similarity, writeConfig, writeMeta, writeRecord };
package/dist/index.js CHANGED
@@ -1968,11 +1968,25 @@ var StdioTransport = class {
1968
1968
  stdoutBuffer = "";
1969
1969
  constructor(opts) {
1970
1970
  const env = opts.replaceEnv ? { ...opts.env ?? {} } : { ...process.env, ...opts.env ?? {} };
1971
- this.child = spawn(opts.command, opts.args ?? [], {
1972
- env,
1973
- cwd: opts.cwd,
1974
- stdio: ["pipe", "pipe", "inherit"]
1975
- });
1971
+ const shell = opts.shell ?? process.platform === "win32";
1972
+ if (shell) {
1973
+ const line = [
1974
+ opts.command,
1975
+ ...(opts.args ?? []).map((a) => quoteArg(a, process.platform === "win32"))
1976
+ ].join(" ");
1977
+ this.child = spawn(line, [], {
1978
+ env,
1979
+ cwd: opts.cwd,
1980
+ stdio: ["pipe", "pipe", "inherit"],
1981
+ shell: true
1982
+ });
1983
+ } else {
1984
+ this.child = spawn(opts.command, opts.args ?? [], {
1985
+ env,
1986
+ cwd: opts.cwd,
1987
+ stdio: ["pipe", "pipe", "inherit"]
1988
+ });
1989
+ }
1976
1990
  this.child.stdout.setEncoding("utf8");
1977
1991
  this.child.stdout.on("data", (chunk) => this.onStdout(chunk));
1978
1992
  this.child.on("close", () => this.onClose());
@@ -2046,6 +2060,12 @@ var StdioTransport = class {
2046
2060
  else this.queue.push(msg);
2047
2061
  }
2048
2062
  };
2063
+ function quoteArg(s, windows) {
2064
+ if (!windows) {
2065
+ return `'${s.replace(/'/g, "'\\''")}'`;
2066
+ }
2067
+ return `"${s.replace(/"/g, '""')}"`;
2068
+ }
2049
2069
 
2050
2070
  // src/mcp/registry.ts
2051
2071
  async function bridgeMcpTools(client, opts = {}) {
@@ -2130,7 +2150,7 @@ function redactKey(key) {
2130
2150
  }
2131
2151
 
2132
2152
  // src/index.ts
2133
- var VERSION = "0.3.0-alpha.1";
2153
+ var VERSION = "0.3.0-alpha.2";
2134
2154
  export {
2135
2155
  AppendOnlyLog,
2136
2156
  CacheFirstLoop,