@autohq/cli 0.1.527 → 0.1.528

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.
@@ -30866,7 +30866,7 @@ Object.assign(lookup, {
30866
30866
  // package.json
30867
30867
  var package_default = {
30868
30868
  name: "@autohq/cli",
30869
- version: "0.1.527",
30869
+ version: "0.1.528",
30870
30870
  license: "SEE LICENSE IN README.md",
30871
30871
  publishConfig: {
30872
30872
  access: "public"
@@ -62425,11 +62425,37 @@ async function createClaudeAutoMcpServer(input) {
62425
62425
  async function forwardJsonRpc(input) {
62426
62426
  const response = await forwardRequest(
62427
62427
  input.upstream,
62428
- {},
62428
+ {
62429
+ accept: "application/json, text/event-stream",
62430
+ "content-type": "application/json"
62431
+ },
62429
62432
  JSON.stringify(input.message),
62430
62433
  input.commandId
62431
62434
  );
62432
- return JSON.parse(response.body);
62435
+ return parseJsonRpcResponseBody(response.body);
62436
+ }
62437
+ function parseJsonRpcResponseBody(body) {
62438
+ const trimmed = body.trimStart();
62439
+ if (!trimmed.startsWith("event:") && !trimmed.startsWith("data:")) {
62440
+ return JSON.parse(body);
62441
+ }
62442
+ let parsed;
62443
+ for (const line of body.split("\n")) {
62444
+ if (!line.startsWith("data:")) {
62445
+ continue;
62446
+ }
62447
+ try {
62448
+ const candidate = JSON.parse(line.slice("data:".length).trim());
62449
+ if (isRecord(candidate)) {
62450
+ parsed = candidate;
62451
+ }
62452
+ } catch {
62453
+ }
62454
+ }
62455
+ if (!parsed) {
62456
+ throw new Error("Auto MCP server returned an unparseable SSE response");
62457
+ }
62458
+ return parsed;
62433
62459
  }
62434
62460
  function asCallToolResult(value2) {
62435
62461
  if (isRecord(value2) && Array.isArray(value2.content)) {
package/dist/index.js CHANGED
@@ -78587,7 +78587,7 @@ var init_package = __esm({
78587
78587
  "package.json"() {
78588
78588
  package_default = {
78589
78589
  name: "@autohq/cli",
78590
- version: "0.1.527",
78590
+ version: "0.1.528",
78591
78591
  license: "SEE LICENSE IN README.md",
78592
78592
  publishConfig: {
78593
78593
  access: "public"
@@ -90676,11 +90676,37 @@ async function createClaudeAutoMcpServer(input) {
90676
90676
  async function forwardJsonRpc(input) {
90677
90677
  const response = await forwardRequest(
90678
90678
  input.upstream,
90679
- {},
90679
+ {
90680
+ accept: "application/json, text/event-stream",
90681
+ "content-type": "application/json"
90682
+ },
90680
90683
  JSON.stringify(input.message),
90681
90684
  input.commandId
90682
90685
  );
90683
- return JSON.parse(response.body);
90686
+ return parseJsonRpcResponseBody(response.body);
90687
+ }
90688
+ function parseJsonRpcResponseBody(body) {
90689
+ const trimmed = body.trimStart();
90690
+ if (!trimmed.startsWith("event:") && !trimmed.startsWith("data:")) {
90691
+ return JSON.parse(body);
90692
+ }
90693
+ let parsed;
90694
+ for (const line of body.split("\n")) {
90695
+ if (!line.startsWith("data:")) {
90696
+ continue;
90697
+ }
90698
+ try {
90699
+ const candidate = JSON.parse(line.slice("data:".length).trim());
90700
+ if (isRecord2(candidate)) {
90701
+ parsed = candidate;
90702
+ }
90703
+ } catch {
90704
+ }
90705
+ }
90706
+ if (!parsed) {
90707
+ throw new Error("Auto MCP server returned an unparseable SSE response");
90708
+ }
90709
+ return parsed;
90684
90710
  }
90685
90711
  function asCallToolResult(value) {
90686
90712
  if (isRecord2(value) && Array.isArray(value.content)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.527",
3
+ "version": "0.1.528",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"