@principal-ai/control-tower-core 0.3.2 → 0.4.0

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/index.mjs CHANGED
@@ -5737,6 +5737,9 @@ class BaseClient extends TypedEventEmitter {
5737
5737
  case "error":
5738
5738
  await this.handleServerError(message.payload);
5739
5739
  break;
5740
+ default:
5741
+ await this.emit(message.type, message.payload);
5742
+ break;
5740
5743
  }
5741
5744
  } catch (error) {
5742
5745
  await this.emit("error", { error });
@@ -5951,6 +5954,12 @@ class PresenceClient extends TypedEventEmitter {
5951
5954
  throw new Error(response.error || "Failed to report repo focused");
5952
5955
  }
5953
5956
  }
5957
+ async updateRepoStatus(repoId, gitStatus) {
5958
+ const response = await this.client.request("presence:repo_status_update", { repoId, gitStatus });
5959
+ if (!response.success) {
5960
+ throw new Error(response.message || "Failed to update repo status");
5961
+ }
5962
+ }
5954
5963
  getClient() {
5955
5964
  return this.client;
5956
5965
  }
@@ -5983,6 +5992,17 @@ class PresenceClient extends TypedEventEmitter {
5983
5992
  });
5984
5993
  }
5985
5994
  });
5995
+ this.client.on("presence:repo_status_changed", (data) => {
5996
+ if (data && typeof data === "object") {
5997
+ const payload = data;
5998
+ this.emit("repoStatusChanged", {
5999
+ userId: payload.userId,
6000
+ repoId: payload.repoId,
6001
+ deviceId: payload.deviceId,
6002
+ gitStatus: payload.gitStatus
6003
+ });
6004
+ }
6005
+ });
5986
6006
  this.client.on("disconnected", () => {
5987
6007
  this.emit("disconnected", {});
5988
6008
  if (this.autoReconnectEnabled) {
@@ -7092,4 +7112,4 @@ export {
7092
7112
  BaseClient
7093
7113
  };
7094
7114
 
7095
- //# debugId=2344FC62E16D571364756E2164756E21
7115
+ //# debugId=83C48EE48B6503C464756E2164756E21