Skip to content

Commit f0ae805

Browse files
committed
Bump version to 0.2.22-fork in package.json. Enhance logging in the Conversation class by including userMessage content in debug output. Refactor SubprocessCLITransport to directly use userMessage content for both streaming and non-streaming modes, improving code clarity and consistency in message handling.
1 parent 79cb710 commit f0ae805

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@botanicastudios/claude-code-sdk-ts",
3-
"version": "0.2.21-fork",
3+
"version": "0.2.22-fork",
44
"description": "Unofficial TypeScript port of the official Python Claude Code SDK",
55
"type": "module",
66
"main": "dist/index.cjs",

src/_internal/transport/subprocess-cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,13 @@ export class SubprocessCLITransport {
9393

9494
if (this.process && this.process.stdin) {
9595
try {
96-
const content = userMessage.content as string;
9796
if (this.streamingMode) {
9897
// For streaming mode, wrap message in JSONL format
9998
const jsonlMessage = {
10099
type: 'user',
101100
message: {
102101
role: 'user',
103-
content: [{ type: 'text', text: content }]
102+
content: userMessage.content
104103
}
105104
};
106105

@@ -119,6 +118,7 @@ export class SubprocessCLITransport {
119118

120119
this.debugLog('DEBUG: [Transport] Successfully wrote JSONL to stdin');
121120
} else {
121+
const content = userMessage.content as string;
122122
// For non-streaming mode, write as-is (though this shouldn't happen)
123123
this.debugLog(
124124
'DEBUG: [Transport] Writing raw data to stdin:',

0 commit comments

Comments
 (0)