@overmap-ai/core 1.0.48-add-agent-service.2 → 1.0.48-fix-agent-errors.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.
@@ -5001,6 +5001,10 @@ var __publicField = (obj, key, value) => {
5001
5001
  checkAuth: false,
5002
5002
  // Don't wait for other requests to finish, or we might end up in a deadlock.
5003
5003
  immediate: true
5004
+ }).catch((e) => {
5005
+ console.error("Could not renew tokens; logging out due to error:", e);
5006
+ void this.logout();
5007
+ return void 0;
5004
5008
  });
5005
5009
  let response = void 0;
5006
5010
  try {
@@ -5009,7 +5013,7 @@ var __publicField = (obj, key, value) => {
5009
5013
  await this.logout();
5010
5014
  }
5011
5015
  if (!response)
5012
- throw new Error("No response");
5016
+ return void 0;
5013
5017
  if (!response.access)
5014
5018
  throw new Error("Missing access token");
5015
5019
  if (!response.refresh)
@@ -5081,7 +5085,11 @@ var __publicField = (obj, key, value) => {
5081
5085
  throw new Error("No refresh token found");
5082
5086
  }
5083
5087
  try {
5084
- const { accessToken, refreshToken } = await this._getRenewedTokens(dyingRefreshToken);
5088
+ const tokens = await this._getRenewedTokens(dyingRefreshToken);
5089
+ if (!tokens) {
5090
+ return void 0;
5091
+ }
5092
+ const { accessToken, refreshToken } = tokens;
5085
5093
  console.log("Got renewed tokens");
5086
5094
  store.dispatch(setTokens({ accessToken, refreshToken }));
5087
5095
  } catch (e) {
@@ -6096,7 +6104,6 @@ var __publicField = (obj, key, value) => {
6096
6104
  async remove(projectAccess) {
6097
6105
  const { store } = this.client;
6098
6106
  store.dispatch(removeProjectAccess(projectAccess));
6099
- store.dispatch(removeUser(projectAccess.user));
6100
6107
  return this.enqueueRequest({
6101
6108
  description: "Delete project access",
6102
6109
  method: HttpMethod.DELETE,
@@ -7478,7 +7485,12 @@ var __publicField = (obj, key, value) => {
7478
7485
  }
7479
7486
  }
7480
7487
  class AgentService extends BaseApiService {
7481
- prompt(request2) {
7488
+ /**
7489
+ * Prompt the agent with a message.
7490
+ * @param request The message to prompt the agent with.
7491
+ * @param conversationId If continuing an existing message, the UUID of that conversation.
7492
+ */
7493
+ prompt(request2, conversationId) {
7482
7494
  const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
7483
7495
  return this.enqueueRequest({
7484
7496
  description: "Prompt agent",
@@ -7489,7 +7501,8 @@ var __publicField = (obj, key, value) => {
7489
7501
  active_project: activeProjectId
7490
7502
  },
7491
7503
  blockers: ["prompt"],
7492
- blocks: ["prompt"]
7504
+ blocks: ["prompt"],
7505
+ queryParams: conversationId ? { conversation_id: conversationId } : {}
7493
7506
  });
7494
7507
  }
7495
7508
  }