@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.
- package/dist/overmap-core.js +18 -5
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +18 -5
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AgentService.d.ts +35 -2
- package/dist/sdk/services/AuthService.d.ts +1 -1
- package/dist/typings/models/base.d.ts +5 -0
- package/dist/typings/models/users.d.ts +2 -3
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -5010,6 +5010,10 @@ class AuthService extends BaseApiService {
|
|
|
5010
5010
|
checkAuth: false,
|
|
5011
5011
|
// Don't wait for other requests to finish, or we might end up in a deadlock.
|
|
5012
5012
|
immediate: true
|
|
5013
|
+
}).catch((e) => {
|
|
5014
|
+
console.error("Could not renew tokens; logging out due to error:", e);
|
|
5015
|
+
void this.logout();
|
|
5016
|
+
return void 0;
|
|
5013
5017
|
});
|
|
5014
5018
|
let response = void 0;
|
|
5015
5019
|
try {
|
|
@@ -5018,7 +5022,7 @@ class AuthService extends BaseApiService {
|
|
|
5018
5022
|
await this.logout();
|
|
5019
5023
|
}
|
|
5020
5024
|
if (!response)
|
|
5021
|
-
|
|
5025
|
+
return void 0;
|
|
5022
5026
|
if (!response.access)
|
|
5023
5027
|
throw new Error("Missing access token");
|
|
5024
5028
|
if (!response.refresh)
|
|
@@ -5090,7 +5094,11 @@ class AuthService extends BaseApiService {
|
|
|
5090
5094
|
throw new Error("No refresh token found");
|
|
5091
5095
|
}
|
|
5092
5096
|
try {
|
|
5093
|
-
const
|
|
5097
|
+
const tokens = await this._getRenewedTokens(dyingRefreshToken);
|
|
5098
|
+
if (!tokens) {
|
|
5099
|
+
return void 0;
|
|
5100
|
+
}
|
|
5101
|
+
const { accessToken, refreshToken } = tokens;
|
|
5094
5102
|
console.log("Got renewed tokens");
|
|
5095
5103
|
store.dispatch(setTokens({ accessToken, refreshToken }));
|
|
5096
5104
|
} catch (e) {
|
|
@@ -6105,7 +6113,6 @@ class ProjectAccessService extends BaseApiService {
|
|
|
6105
6113
|
async remove(projectAccess) {
|
|
6106
6114
|
const { store } = this.client;
|
|
6107
6115
|
store.dispatch(removeProjectAccess(projectAccess));
|
|
6108
|
-
store.dispatch(removeUser(projectAccess.user));
|
|
6109
6116
|
return this.enqueueRequest({
|
|
6110
6117
|
description: "Delete project access",
|
|
6111
6118
|
method: HttpMethod.DELETE,
|
|
@@ -7487,7 +7494,12 @@ class DocumentService extends BaseApiService {
|
|
|
7487
7494
|
}
|
|
7488
7495
|
}
|
|
7489
7496
|
class AgentService extends BaseApiService {
|
|
7490
|
-
|
|
7497
|
+
/**
|
|
7498
|
+
* Prompt the agent with a message.
|
|
7499
|
+
* @param request The message to prompt the agent with.
|
|
7500
|
+
* @param conversationId If continuing an existing message, the UUID of that conversation.
|
|
7501
|
+
*/
|
|
7502
|
+
prompt(request2, conversationId) {
|
|
7491
7503
|
const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
7492
7504
|
return this.enqueueRequest({
|
|
7493
7505
|
description: "Prompt agent",
|
|
@@ -7498,7 +7510,8 @@ class AgentService extends BaseApiService {
|
|
|
7498
7510
|
active_project: activeProjectId
|
|
7499
7511
|
},
|
|
7500
7512
|
blockers: ["prompt"],
|
|
7501
|
-
blocks: ["prompt"]
|
|
7513
|
+
blocks: ["prompt"],
|
|
7514
|
+
queryParams: conversationId ? { conversation_id: conversationId } : {}
|
|
7502
7515
|
});
|
|
7503
7516
|
}
|
|
7504
7517
|
}
|