@react-grab/opencode 0.1.0-beta.10 → 0.1.0-beta.11

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/cli.cjs CHANGED
@@ -5787,8 +5787,13 @@ ${context.content.join("\n\n")}`;
5787
5787
  signal
5788
5788
  })) {
5789
5789
  if (signal.aborted) break;
5790
+ const getBrowserMessageType = (messageType) => {
5791
+ if (messageType === "status") return "agent-status";
5792
+ if (messageType === "error") return "agent-error";
5793
+ return "agent-done";
5794
+ };
5790
5795
  sendToBrowser(browserSocket, {
5791
- type: message.type === "status" ? "agent-status" : message.type === "error" ? "agent-error" : "agent-done",
5796
+ type: getBrowserMessageType(message.type),
5792
5797
  agentId: handler.agentId,
5793
5798
  sessionId,
5794
5799
  content: message.content
@@ -5991,9 +5996,13 @@ ${context.content.join("\n\n")}`;
5991
5996
  } else if (message.type === "agent-status" || message.type === "agent-done" || message.type === "agent-error") {
5992
5997
  const messageQueue = sessionMessageQueues.get(message.sessionId);
5993
5998
  if (messageQueue) {
5994
- const mappedType = message.type === "agent-status" ? "status" : message.type === "agent-done" ? "done" : "error";
5999
+ const getQueueMessageType = (handlerMessageType) => {
6000
+ if (handlerMessageType === "agent-status") return "status";
6001
+ if (handlerMessageType === "agent-done") return "done";
6002
+ return "error";
6003
+ };
5995
6004
  messageQueue.push({
5996
- type: mappedType,
6005
+ type: getQueueMessageType(message.type),
5997
6006
  content: message.content ?? ""
5998
6007
  });
5999
6008
  if (message.type === "agent-done" || message.type === "agent-error") {
@@ -8691,7 +8700,7 @@ async function fkill(inputs, options = {}) {
8691
8700
  }
8692
8701
  }
8693
8702
  var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
8694
- var VERSION = "0.1.0-beta.9";
8703
+ var VERSION = "0.1.0-beta.10";
8695
8704
  var checkIfRelayServerIsRunning = async (port, token) => {
8696
8705
  try {
8697
8706
  const healthUrl = token ? `http://localhost:${port}/health?${RELAY_TOKEN_PARAM}=${encodeURIComponent(token)}` : `http://localhost:${port}/health`;
package/dist/cli.js CHANGED
@@ -5777,8 +5777,13 @@ ${context.content.join("\n\n")}`;
5777
5777
  signal
5778
5778
  })) {
5779
5779
  if (signal.aborted) break;
5780
+ const getBrowserMessageType = (messageType) => {
5781
+ if (messageType === "status") return "agent-status";
5782
+ if (messageType === "error") return "agent-error";
5783
+ return "agent-done";
5784
+ };
5780
5785
  sendToBrowser(browserSocket, {
5781
- type: message.type === "status" ? "agent-status" : message.type === "error" ? "agent-error" : "agent-done",
5786
+ type: getBrowserMessageType(message.type),
5782
5787
  agentId: handler.agentId,
5783
5788
  sessionId,
5784
5789
  content: message.content
@@ -5981,9 +5986,13 @@ ${context.content.join("\n\n")}`;
5981
5986
  } else if (message.type === "agent-status" || message.type === "agent-done" || message.type === "agent-error") {
5982
5987
  const messageQueue = sessionMessageQueues.get(message.sessionId);
5983
5988
  if (messageQueue) {
5984
- const mappedType = message.type === "agent-status" ? "status" : message.type === "agent-done" ? "done" : "error";
5989
+ const getQueueMessageType = (handlerMessageType) => {
5990
+ if (handlerMessageType === "agent-status") return "status";
5991
+ if (handlerMessageType === "agent-done") return "done";
5992
+ return "error";
5993
+ };
5985
5994
  messageQueue.push({
5986
- type: mappedType,
5995
+ type: getQueueMessageType(message.type),
5987
5996
  content: message.content ?? ""
5988
5997
  });
5989
5998
  if (message.type === "agent-done" || message.type === "agent-error") {
@@ -8681,7 +8690,7 @@ async function fkill(inputs, options = {}) {
8681
8690
  }
8682
8691
  }
8683
8692
  var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
8684
- var VERSION = "0.1.0-beta.9";
8693
+ var VERSION = "0.1.0-beta.10";
8685
8694
  var checkIfRelayServerIsRunning = async (port, token) => {
8686
8695
  try {
8687
8696
  const healthUrl = token ? `http://localhost:${port}/health?${RELAY_TOKEN_PARAM}=${encodeURIComponent(token)}` : `http://localhost:${port}/health`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-grab/opencode",
3
- "version": "0.1.0-beta.10",
3
+ "version": "0.1.0-beta.11",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "react-grab-opencode": "./dist/cli.cjs"
@@ -26,13 +26,13 @@
26
26
  "devDependencies": {
27
27
  "@types/node": "^22.10.7",
28
28
  "tsup": "^8.4.0",
29
- "@react-grab/utils": "0.1.0-beta.10"
29
+ "@react-grab/utils": "0.1.0-beta.11"
30
30
  },
31
31
  "dependencies": {
32
32
  "@opencode-ai/sdk": "^1.0.132",
33
33
  "fkill": "^9.0.0",
34
- "@react-grab/relay": "0.1.0-beta.10",
35
- "react-grab": "0.1.0-beta.10"
34
+ "@react-grab/relay": "0.1.0-beta.11",
35
+ "react-grab": "0.1.0-beta.11"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "tsup --watch",