@overmap-ai/core 1.0.53-add-agent-sdk.1 → 1.0.53-add-agent-conversations.1

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.
@@ -1,25 +1,5 @@
1
1
  import { BaseApiService } from "./BaseApiService";
2
- import { Payload } from "../../typings";
3
- import { JSONContent } from "@tiptap/core";
4
- import { AgentConversation, AgentProfile } from "../../typings/models/agents";
5
- export interface PromptAgentResponse {
6
- /**
7
- * The response from the agent.
8
- */
9
- response: JSONContent[];
10
- /**
11
- * The UUID of the conversation.
12
- */
13
- conversation_id: string;
14
- /**
15
- * The UUID of the response (used when submitting ratings)
16
- */
17
- response_id: string;
18
- /**
19
- * The profile of the agent. Only included in the first response in a conversation.
20
- */
21
- profile?: AgentProfile;
22
- }
2
+ import { Payload, PromptAgentResponse } from "../../typings";
23
3
  export declare class AgentService extends BaseApiService {
24
4
  /**
25
5
  * Prompt the agent with a message.
@@ -27,6 +7,6 @@ export declare class AgentService extends BaseApiService {
27
7
  * @param conversationId If continuing an existing message, the UUID of that conversation.
28
8
  */
29
9
  prompt(request: Payload<string>, conversationId?: string | null | undefined): Promise<PromptAgentResponse>;
30
- fetchAll(): Promise<AgentConversation[]>;
31
10
  rate(responseId: string, rating: 1 | 5): Promise<undefined>;
11
+ refreshStore(): Promise<void>;
32
12
  }
@@ -0,0 +1,14 @@
1
+ import { PayloadAction, Reducer } from "@reduxjs/toolkit";
2
+ import { AgentUserConversation, OfflineIdMapping, RootState } from "../../typings";
3
+ export interface AgentsState {
4
+ conversations: OfflineIdMapping<AgentUserConversation>;
5
+ }
6
+ export declare const agentsSlice: import("@reduxjs/toolkit").Slice<AgentsState, {
7
+ setConversations: (state: import("immer/dist/internal.js").WritableDraft<AgentsState>, action: PayloadAction<AgentUserConversation[]>) => void;
8
+ addConversation: (state: import("immer/dist/internal.js").WritableDraft<AgentsState>, action: PayloadAction<AgentUserConversation>) => void;
9
+ setConversation: (state: import("immer/dist/internal.js").WritableDraft<AgentsState>, action: PayloadAction<AgentUserConversation>) => void;
10
+ }, "agents">;
11
+ export declare const setConversations: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation[], "agents/setConversations">, addConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation, "agents/addConversation">, setConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation, "agents/setConversation">;
12
+ export declare const selectConversationMapping: (state: RootState) => OfflineIdMapping<AgentUserConversation>;
13
+ export declare const selectConversation: (args: string) => (state: RootState) => AgentUserConversation | undefined;
14
+ export declare const agentsReducer: Reducer<AgentsState>;
@@ -70,6 +70,7 @@ export declare const selectCategories: ((state: import("redux").EmptyObject & {
70
70
  licenseReducer: import('..').LicenseState;
71
71
  documentsReducer: import('..').DocumentState;
72
72
  teamReducer: import('..').TeamState;
73
+ agentsReducer: import('..').AgentsState;
73
74
  } & {
74
75
  offline: import("@redux-offline/redux-offline/lib/types").OfflineState;
75
76
  }) => Category[]) & import("reselect").OutputSelectorFields<(args_0: Record<string, Category>, args_1: string | null) => Category[], {
@@ -262,6 +262,7 @@ export declare const selectRootDocuments: ((state: import("redux").EmptyObject &
262
262
  licenseReducer: import('..').LicenseState;
263
263
  documentsReducer: DocumentState;
264
264
  teamReducer: import('..').TeamState;
265
+ agentsReducer: import('..').AgentsState;
265
266
  } & {
266
267
  offline: import("@redux-offline/redux-offline/lib/types").OfflineState;
267
268
  }) => ((import('../../typings/models/base').OfflineModel & import('../../typings/models/base').CreatedByModel & {
@@ -49,6 +49,7 @@ export declare const selectFormRevisions: ((state: import("redux").EmptyObject &
49
49
  licenseReducer: import('..').LicenseState;
50
50
  documentsReducer: import('..').DocumentState;
51
51
  teamReducer: import('..').TeamState;
52
+ agentsReducer: import('..').AgentsState;
52
53
  } & {
53
54
  offline: import("@redux-offline/redux-offline/lib/types").OfflineState;
54
55
  }) => Stored<UserFormRevision<import('../../forms').ISerializedField>>[]) & import("reselect").OutputSelectorFields<(args_0: Record<string, Stored<UserFormRevision<import('../../forms').ISerializedField>>>) => Stored<UserFormRevision<import('../../forms').ISerializedField>>[], {
@@ -25,3 +25,4 @@ export * from "./emailDomainsSlice";
25
25
  export * from "./licenseSlice";
26
26
  export * from "./documentSlice";
27
27
  export * from "./teamSlice";
28
+ export * from "./agentsSlice";
@@ -146,6 +146,7 @@ export declare const selectAllAttachments: ((state: import("redux").EmptyObject
146
146
  licenseReducer: import('..').LicenseState;
147
147
  documentsReducer: import('..').DocumentState;
148
148
  teamReducer: import('..').TeamState;
149
+ agentsReducer: import('..').AgentsState;
149
150
  } & {
150
151
  offline: import("@redux-offline/redux-offline/lib/types").OfflineState;
151
152
  }) => Stored<IssueAttachment>[]) & import("reselect").OutputSelectorFields<(args_0: Record<string, Stored<IssueAttachment>>) => Stored<IssueAttachment>[], {
@@ -78,6 +78,7 @@ export declare const selectProjectFiles: ((state: import("redux").EmptyObject &
78
78
  licenseReducer: import('..').LicenseState;
79
79
  documentsReducer: import('..').DocumentState;
80
80
  teamReducer: import('..').TeamState;
81
+ agentsReducer: import('..').AgentsState;
81
82
  } & {
82
83
  offline: import("@redux-offline/redux-offline/lib/types").OfflineState;
83
84
  }) => ProjectFile[]) & import("reselect").OutputSelectorFields<(args_0: Record<string, ProjectFile>, args_1: number | null) => ProjectFile[], {
@@ -56,6 +56,7 @@ export declare const selectWorkspaces: ((state: import("redux").EmptyObject & {
56
56
  licenseReducer: import('..').LicenseState;
57
57
  documentsReducer: import('..').DocumentState;
58
58
  teamReducer: import('..').TeamState;
59
+ agentsReducer: import('..').AgentsState;
59
60
  } & {
60
61
  offline: import("@redux-offline/redux-offline/lib/types").OfflineState;
61
62
  }) => Workspace[]) & import("reselect").OutputSelectorFields<(args_0: Record<string, Workspace>) => Workspace[], {
@@ -3,7 +3,7 @@ import { AnyAction, Reducer } from "redux";
3
3
  import { Config, OfflineAction, OfflineMetadata, OfflineState } from "@redux-offline/redux-offline/lib/types";
4
4
  import request from "superagent";
5
5
  import { type OfflineMetaEffect, type OvermapSDK, RequestDetails } from "../sdk";
6
- import { AuthState, CategoryState, ComponentStageCompletionState, ComponentStageState, ComponentState, ComponentTypeState, DocumentState, EmailDomainState, FileState, IssueState, IssueTypeState, LicenseState, MapState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectFileState, ProjectState, RehydratedState, SettingState, FormState, FormRevisionState, FormSubmissionState, UserState, WorkspaceState, TeamState } from "./slices";
6
+ import { AuthState, CategoryState, ComponentStageCompletionState, ComponentStageState, ComponentState, ComponentTypeState, DocumentState, EmailDomainState, FileState, IssueState, IssueTypeState, LicenseState, MapState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectFileState, ProjectState, RehydratedState, SettingState, FormState, FormRevisionState, FormSubmissionState, UserState, WorkspaceState, TeamState, AgentsState } from "./slices";
7
7
  import { VersioningState } from "./slices/versioningSlice";
8
8
  import { RootState } from "../typings";
9
9
  export declare const overmapReducers: {
@@ -35,6 +35,7 @@ export declare const overmapReducers: {
35
35
  licenseReducer: Reducer<LicenseState>;
36
36
  documentsReducer: Reducer<DocumentState>;
37
37
  teamReducer: Reducer<TeamState>;
38
+ agentsReducer: Reducer<AgentsState>;
38
39
  };
39
40
  export declare const overmapReducer: Reducer<import("redux").CombinedState<{
40
41
  versioning: VersioningState;
@@ -65,6 +66,7 @@ export declare const overmapReducer: Reducer<import("redux").CombinedState<{
65
66
  licenseReducer: LicenseState;
66
67
  documentsReducer: DocumentState;
67
68
  teamReducer: TeamState;
69
+ agentsReducer: AgentsState;
68
70
  }>, AnyAction>;
69
71
  export declare const resetStore = "RESET";
70
72
  export declare const rootReducer: Reducer<RootState>;
@@ -113,6 +115,7 @@ export declare const defaultStore: import("@reduxjs/toolkit/dist/configureStore"
113
115
  licenseReducer: LicenseState;
114
116
  documentsReducer: DocumentState;
115
117
  teamReducer: TeamState;
118
+ agentsReducer: AgentsState;
116
119
  } & {
117
120
  offline: OfflineState;
118
121
  }, AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<RootState, AnyAction>]>>;
@@ -1,5 +1,5 @@
1
1
  import { JSONContent } from "@tiptap/core";
2
- import { OptionalFileModel, TimestampedModel } from "./base";
2
+ import { Offline, OptionalFileModel, TimestampedModel } from "./base";
3
3
  export interface AgentProfile extends OptionalFileModel {
4
4
  /**
5
5
  * The name of the agent.
@@ -10,8 +10,35 @@ export interface AgentProfile extends OptionalFileModel {
10
10
  */
11
11
  description: string;
12
12
  }
13
- export type AgentConversation = Omit<TimestampedModel, "updated_at"> & {
14
- id: string;
13
+ export interface PromptAgentResponse {
14
+ /**
15
+ * The response from the agent.
16
+ */
17
+ response: JSONContent[];
18
+ /**
19
+ * The UUID of the conversation.
20
+ */
21
+ conversation_id: string;
22
+ /**
23
+ * The UUID of the response (used when submitting ratings)
24
+ */
25
+ response_id: string;
26
+ /**
27
+ * The profile of the agent. Only included in the first response in a conversation.
28
+ */
29
+ profile?: AgentProfile;
30
+ }
31
+ export interface AgentProfile extends OptionalFileModel {
32
+ /**
33
+ * The name of the agent.
34
+ */
35
+ name: string;
36
+ /**
37
+ * The description of the agent.
38
+ */
39
+ description: string;
40
+ }
41
+ export type AgentUserConversation = Offline<Omit<TimestampedModel, "updated_at">> & {
15
42
  profile?: AgentProfile | null;
16
43
  history: JSONContent[];
17
44
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core functionality for Overmap",
4
4
  "author": "Wôrdn Inc.",
5
5
  "license": "UNLICENSED",
6
- "version": "1.0.53-add-agent-sdk.1",
6
+ "version": "1.0.53-add-agent-conversations.1",
7
7
  "type": "module",
8
8
  "main": "dist/overmap-core.umd.cjs",
9
9
  "module": "dist/overmap-core.js",