@1sat/cli 0.0.14 → 0.0.15
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/package.json +2 -2
- package/src/commands/mcp-proxy.ts +20 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "CLI for 1Sat Ordinals SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/cli.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"keywords": ["1sat", "bsv", "ordinals", "cli"],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@1sat/actions": "0.0.
|
|
19
|
+
"@1sat/actions": "0.0.64",
|
|
20
20
|
"@1sat/client": "0.0.17",
|
|
21
21
|
"@1sat/types": "0.0.14",
|
|
22
22
|
"@1sat/wallet-node": ">=0.0.13",
|
|
@@ -174,13 +174,28 @@ export async function handleMcpProxyCommand(): Promise<void> {
|
|
|
174
174
|
reqLog.emit()
|
|
175
175
|
|
|
176
176
|
if (contentType.includes('text/event-stream')) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
// Stream SSE events incrementally — res.text() would hang
|
|
178
|
+
// because SSE connections stay open indefinitely
|
|
179
|
+
const sseReader = res.body!.getReader()
|
|
180
|
+
const sseDecoder = new TextDecoder()
|
|
181
|
+
let sseBuf = ''
|
|
182
|
+
while (true) {
|
|
183
|
+
const { done: sseDone, value: sseValue } = await sseReader.read()
|
|
184
|
+
if (sseDone) break
|
|
185
|
+
sseBuf += sseDecoder.decode(sseValue, { stream: true })
|
|
186
|
+
const sseLines = sseBuf.split('\n')
|
|
187
|
+
sseBuf = sseLines.pop()!
|
|
188
|
+
for (const sseLine of sseLines) {
|
|
189
|
+
if (sseLine.startsWith('data: ')) {
|
|
190
|
+
const data = sseLine.slice(6).trim()
|
|
191
|
+
if (data) process.stdout.write(`${data}\n`)
|
|
192
|
+
}
|
|
182
193
|
}
|
|
183
194
|
}
|
|
195
|
+
if (sseBuf.startsWith('data: ')) {
|
|
196
|
+
const data = sseBuf.slice(6).trim()
|
|
197
|
+
if (data) process.stdout.write(`${data}\n`)
|
|
198
|
+
}
|
|
184
199
|
} else {
|
|
185
200
|
const body = await res.text()
|
|
186
201
|
if (body.trim()) process.stdout.write(`${body.trim()}\n`)
|