claude-code-rust 0.14.4 → 0.14.5

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 CHANGED
@@ -8,7 +8,7 @@ A native Rust terminal interface for Claude Code. Drop-in replacement for Anthro
8
8
  [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](https://www.apache.org/licenses/LICENSE-2.0)
9
9
 
10
10
  <p align="center">
11
- <img src="assets/banner.png" alt="Claude Code Rust running a Read tool call with syntax-highlighted output" width="900">
11
+ <img src="assets/demo.gif" alt="Claude Code Rust explaining the terminal problems its native Rust interface solves" width="900">
12
12
  </p>
13
13
 
14
14
  ## About
@@ -39,6 +39,7 @@ export function classifyTurnErrorKind(subtype, errors, assistantError) {
39
39
  return "plan_limit";
40
40
  case "authentication_failed":
41
41
  return "auth_required";
42
+ case "account_on_hold":
42
43
  case "oauth_org_not_allowed":
43
44
  return "account_access";
44
45
  case "model_not_found":
@@ -81,6 +81,7 @@ function taskSystemMetadata(msg, patch) {
81
81
  for (const key of [
82
82
  "error",
83
83
  "is_backgrounded",
84
+ "spawn_depth",
84
85
  "request_id",
85
86
  "subagent_type",
86
87
  "task_description",
@@ -64,6 +64,11 @@ function sdkTaskMetadata(msg) {
64
64
  const summary = status && typeof msg.summary === "string" && msg.summary.length > 0
65
65
  ? msg.summary
66
66
  : undefined;
67
+ const spawnDepth = typeof msg.spawn_depth === "number" &&
68
+ Number.isSafeInteger(msg.spawn_depth) &&
69
+ msg.spawn_depth > 0
70
+ ? msg.spawn_depth
71
+ : undefined;
67
72
  const taskMetadata = {
68
73
  ...(metadata.requestId ? { request_id: metadata.requestId } : {}),
69
74
  ...(metadata.subagentType ? { subagent_type: metadata.subagentType } : {}),
@@ -80,6 +85,10 @@ function sdkTaskMetadata(msg) {
80
85
  ...(summary ? { summary } : {}),
81
86
  ...(status ? { terminal_status: status } : {}),
82
87
  ...(typeof msg.blocked === "boolean" ? { blocked: msg.blocked } : {}),
88
+ ...(typeof msg.is_backgrounded === "boolean"
89
+ ? { is_backgrounded: msg.is_backgrounded }
90
+ : {}),
91
+ ...(spawnDepth !== undefined ? { spawn_depth: spawnDepth } : {}),
83
92
  };
84
93
  return Object.keys(taskMetadata).length > 0 ? taskMetadata : undefined;
85
94
  }
@@ -140,6 +149,9 @@ function externalMessageUpdateFromSdkUser(msg) {
140
149
  origin.verifiedPeerPid >= 0
141
150
  ? { verified_peer_pid: origin.verifiedPeerPid }
142
151
  : {}),
152
+ ...(origin.fromMode === "bypass" || origin.fromMode === "prompting"
153
+ ? { from_mode: origin.fromMode }
154
+ : {}),
143
155
  },
144
156
  };
145
157
  }
@@ -168,6 +180,9 @@ function logSdkMessageOrigin(session, msg) {
168
180
  origin_verified_peer_pid: typeof origin?.verifiedPeerPid === "number"
169
181
  ? origin.verifiedPeerPid
170
182
  : undefined,
183
+ origin_from_mode: origin?.fromMode === "bypass" || origin?.fromMode === "prompting"
184
+ ? origin.fromMode
185
+ : undefined,
171
186
  },
172
187
  });
173
188
  }
@@ -850,6 +865,27 @@ export function handleAssistantMessage(session, message) {
850
865
  const content = Array.isArray(messageObject.content)
851
866
  ? messageObject.content
852
867
  : [];
868
+ if (asRecordOrNull(message.context_usage)) {
869
+ const markdown = content
870
+ .flatMap((block) => {
871
+ const record = asRecordOrNull(block);
872
+ return record?.type === "text" &&
873
+ typeof record.text === "string" &&
874
+ record.text.trim().length > 0
875
+ ? [record.text]
876
+ : [];
877
+ })
878
+ .join("\n\n");
879
+ if (markdown.length > 0) {
880
+ emitSessionUpdate(session.sessionId, {
881
+ type: "agent_message_chunk",
882
+ content: { type: "text", text: markdown },
883
+ ...(assistantMessageUuid
884
+ ? { source_message_uuid: assistantMessageUuid }
885
+ : {}),
886
+ });
887
+ }
888
+ }
853
889
  for (const block of content) {
854
890
  if (!block || typeof block !== "object") {
855
891
  continue;
@@ -802,11 +802,15 @@ export function buildQueryOptions(params) {
802
802
  },
803
803
  spawnClaudeCodeProcess: (options) => {
804
804
  const command = resolveClaudeCodeSpawnCommand(options.command);
805
- const spawnOptions = { ...options, command };
805
+ const env = { ...options.env };
806
+ if (env.CLAUDE_CODE_ENABLE_TODO_TOOLS === undefined) {
807
+ env.CLAUDE_CODE_ENABLE_TODO_TOOLS = "1";
808
+ }
809
+ const spawnOptions = { ...options, command, env };
806
810
  logSdkProcessSpawnStarted(spawnOptions, params.enableSpawnDebug);
807
811
  const child = spawnChild(command, options.args, {
808
812
  cwd: options.cwd,
809
- env: options.env,
813
+ env,
810
814
  signal: options.signal,
811
815
  stdio: ["pipe", "pipe", "pipe"],
812
816
  windowsHide: true,
@@ -945,8 +949,7 @@ export function buildQueryOptions(params) {
945
949
  // the CLI emits `request_user_dialog` and the host renders the chooser below.
946
950
  supportedDialogKinds: [REFUSAL_FALLBACK_DIALOG_KIND],
947
951
  // Host policy for `request_user_dialog` control requests. Unknown kinds are
948
- // logged and answered `{ behavior: "cancelled" }` (the spec-required answer
949
- // for unrecognized kinds). For `refusal_fallback_prompt`, we surface an
952
+ // logged and left unsettled by returning `null`. For `refusal_fallback_prompt`, we surface an
950
953
  // interactive chooser in the TUI and route the user's decision back to the
951
954
  // CLI as `{ behavior: "completed", result: <choice> }` (or cancelled on
952
955
  // decline/abort/teardown).
@@ -955,15 +958,15 @@ export function buildQueryOptions(params) {
955
958
  bridgeLogger.warn({
956
959
  target: LOG_TARGETS.APP_SESSION,
957
960
  eventName: "user_dialog_received",
958
- message: "request_user_dialog received for unknown kind; cancelled",
959
- outcome: "cancelled",
961
+ message: "request_user_dialog received for unknown kind; unsupported",
962
+ outcome: "unsupported",
960
963
  sessionId: params.sessionIdForLogs(),
961
964
  ...(typeof request.toolUseID === "string"
962
965
  ? { toolCallId: request.toolUseID }
963
966
  : {}),
964
967
  fields: { dialog_kind: request.dialogKind },
965
968
  });
966
- return { behavior: "cancelled" };
969
+ return null;
967
970
  }
968
971
  const payload = normalizeRefusalFallbackPayload(request.payload);
969
972
  const requestId = options.requestId;
@@ -77,6 +77,7 @@ export function parseRuntimeSessionState(value) {
77
77
  export function parseApiRetryError(value) {
78
78
  switch (value) {
79
79
  case "authentication_failed":
80
+ case "account_on_hold":
80
81
  case "oauth_org_not_allowed":
81
82
  case "billing_error":
82
83
  case "rate_limit":
@@ -831,6 +831,7 @@ function lifecycleMetadata(msg) {
831
831
  for (const key of [
832
832
  "error",
833
833
  "is_backgrounded",
834
+ "spawn_depth",
834
835
  "request_id",
835
836
  "subagent_type",
836
837
  "task_description",
@@ -627,9 +627,14 @@ function extractToolOutputMetadata(toolName, rawResult, rawContent) {
627
627
  const artifactRead = asRecordOrNull(candidate.artifactRead);
628
628
  const slug = nonEmptyString(artifactRead?.slug);
629
629
  const ver = nonEmptyString(artifactRead?.ver);
630
- if (slug && ver) {
630
+ const seeded = artifactRead?.seeded === false ? false : undefined;
631
+ if (slug) {
631
632
  const webFetchMetadata = {
632
- artifact_read: { slug, ver },
633
+ artifact_read: {
634
+ slug,
635
+ ...(ver ? { ver } : {}),
636
+ ...(seeded === false ? { seeded } : {}),
637
+ },
633
638
  };
634
639
  metadata.web_fetch = webFetchMetadata;
635
640
  break;
@@ -194,7 +194,7 @@ export function emitAgentConfigOptionUpdate(sessionId, agent) {
194
194
  value: agent,
195
195
  });
196
196
  }
197
- const EXPECTED_AGENT_SDK_VERSION = "0.3.227";
197
+ const EXPECTED_AGENT_SDK_VERSION = "0.3.239";
198
198
  const require = createRequire(import.meta.url);
199
199
  export function resolveInstalledAgentSdkVersion() {
200
200
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-rust",
3
- "version": "0.14.4",
3
+ "version": "0.14.5",
4
4
  "description": "Claude Code Rust - native Rust terminal interface for Claude Code",
5
5
  "keywords": [
6
6
  "cli",
@@ -33,15 +33,15 @@
33
33
  "LICENSE"
34
34
  ],
35
35
  "dependencies": {
36
- "@anthropic-ai/claude-agent-sdk": "0.3.227"
36
+ "@anthropic-ai/claude-agent-sdk": "0.3.239"
37
37
  },
38
38
  "optionalDependencies": {
39
- "@srothgan/claude-code-rust-darwin-arm64": "0.14.4",
40
- "@srothgan/claude-code-rust-darwin-x64": "0.14.4",
41
- "@srothgan/claude-code-rust-linux-x64-gnu": "0.14.4",
42
- "@srothgan/claude-code-rust-linux-arm64-gnu": "0.14.4",
43
- "@srothgan/claude-code-rust-win32-x64-msvc": "0.14.4",
44
- "@srothgan/claude-code-rust-win32-arm64-msvc": "0.14.4"
39
+ "@srothgan/claude-code-rust-darwin-arm64": "0.14.5",
40
+ "@srothgan/claude-code-rust-darwin-x64": "0.14.5",
41
+ "@srothgan/claude-code-rust-linux-x64-gnu": "0.14.5",
42
+ "@srothgan/claude-code-rust-linux-arm64-gnu": "0.14.5",
43
+ "@srothgan/claude-code-rust-win32-x64-msvc": "0.14.5",
44
+ "@srothgan/claude-code-rust-win32-arm64-msvc": "0.14.5"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=24"