@memberjunction/skip-types 2.43.0 → 2.45.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/agent-types.d.ts +251 -0
- package/dist/agent-types.d.ts.map +1 -0
- package/dist/agent-types.js +76 -0
- package/dist/agent-types.js.map +1 -0
- package/dist/api-types.d.ts +212 -0
- package/dist/api-types.d.ts.map +1 -0
- package/dist/api-types.js +80 -0
- package/dist/api-types.js.map +1 -0
- package/dist/artifact-types.d.ts +142 -0
- package/dist/artifact-types.d.ts.map +1 -0
- package/dist/artifact-types.js +26 -0
- package/dist/artifact-types.js.map +1 -0
- package/dist/auth-types.d.ts +39 -0
- package/dist/auth-types.d.ts.map +1 -0
- package/dist/auth-types.js +32 -0
- package/dist/auth-types.js.map +1 -0
- package/dist/component-types.d.ts +355 -0
- package/dist/component-types.d.ts.map +1 -0
- package/dist/component-types.js +28 -0
- package/dist/component-types.js.map +1 -0
- package/dist/conversation-types.d.ts +141 -0
- package/dist/conversation-types.d.ts.map +1 -0
- package/dist/conversation-types.js +46 -0
- package/dist/conversation-types.js.map +1 -0
- package/dist/entity-metadata-types.d.ts +125 -0
- package/dist/entity-metadata-types.d.ts.map +1 -0
- package/dist/entity-metadata-types.js +78 -0
- package/dist/entity-metadata-types.js.map +1 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/query-types.d.ts +107 -0
- package/dist/query-types.d.ts.map +1 -0
- package/dist/query-types.js +65 -0
- package/dist/query-types.js.map +1 -0
- package/dist/response-types.d.ts +156 -0
- package/dist/response-types.d.ts.map +1 -0
- package/dist/response-types.js +63 -0
- package/dist/response-types.js.map +1 -0
- package/dist/shared.d.ts +44 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +3 -0
- package/dist/shared.js.map +1 -0
- package/dist/types.d.ts +31 -1028
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +45 -211
- package/dist/types.js.map +1 -1
- package/dist/util.d.ts +68 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +201 -0
- package/dist/util.js.map +1 -0
- package/package.json +3 -3
- package/readme.md +140 -47
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview AI Agent and learning cycle types for Skip API
|
|
3
|
+
*
|
|
4
|
+
* This file contains types related to AI agent functionality, learning cycles, and
|
|
5
|
+
* human-in-the-loop interactions within the Skip API system. These types define the structure for:
|
|
6
|
+
*
|
|
7
|
+
* - Agent notes and note types (SkipAPIAgentNote, SkipAPIAgentNoteType)
|
|
8
|
+
* - Agent requests for human approval/feedback (SkipAPIAgentRequest)
|
|
9
|
+
* - Learning cycle processes (SkipAPILearningCycleRequest, SkipAPILearningCycleResponse)
|
|
10
|
+
* - Change tracking for learning cycles (various SkipLearningCycle*Change types)
|
|
11
|
+
*
|
|
12
|
+
* The learning cycle functionality allows Skip to analyze conversation history and improve
|
|
13
|
+
* its performance over time by generating notes, updating queries, and creating agent
|
|
14
|
+
* requests based on patterns it discovers in user interactions.
|
|
15
|
+
*
|
|
16
|
+
* Agent requests enable human-in-the-loop workflows where Skip can ask for approval or
|
|
17
|
+
* guidance on specific actions, ensuring that AI decisions align with organizational
|
|
18
|
+
* policies and user preferences.
|
|
19
|
+
*
|
|
20
|
+
* Notes provide a way for Skip to store and retrieve organizational knowledge, user
|
|
21
|
+
* preferences, and contextual information that improves future interactions.
|
|
22
|
+
*
|
|
23
|
+
* @author MemberJunction
|
|
24
|
+
* @since 2.0.0
|
|
25
|
+
*/
|
|
26
|
+
import type { SkipConversation } from './conversation-types';
|
|
27
|
+
import type { SkipEntityInfo } from './entity-metadata-types';
|
|
28
|
+
import type { SkipQueryInfo, SkipLearningCycleQueryChange } from './query-types';
|
|
29
|
+
import type { SkipAPIRequestAPIKey } from './auth-types';
|
|
30
|
+
/**
|
|
31
|
+
* Type that defines a possible note type from the source system that invoked Skip
|
|
32
|
+
*/
|
|
33
|
+
export declare class SkipAPIAgentNoteType {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Defines the shape of an individual Agent note that is stored in MJ that can be passed to Skip for additional context.
|
|
40
|
+
*/
|
|
41
|
+
export declare class SkipAPIAgentNote {
|
|
42
|
+
/**
|
|
43
|
+
* Unique identifier for the note
|
|
44
|
+
*/
|
|
45
|
+
id: string;
|
|
46
|
+
/**
|
|
47
|
+
* Unique type id (UUID) for the note type, maps to a SkipAPIAgentNoteType that was passed in the SkipAPIRequest
|
|
48
|
+
*/
|
|
49
|
+
agentNoteTypeId: string;
|
|
50
|
+
/**
|
|
51
|
+
* Text name for the note type
|
|
52
|
+
*/
|
|
53
|
+
agentNoteType: string;
|
|
54
|
+
/**
|
|
55
|
+
* Date/Time the note was initially created
|
|
56
|
+
*/
|
|
57
|
+
createdAt: Date;
|
|
58
|
+
/**
|
|
59
|
+
* Date/Time the note was last updated
|
|
60
|
+
*/
|
|
61
|
+
updatedAt: Date;
|
|
62
|
+
/**
|
|
63
|
+
* The text of the note
|
|
64
|
+
*/
|
|
65
|
+
note: string;
|
|
66
|
+
/**
|
|
67
|
+
* This type field contains the scope of the note, either Global or User
|
|
68
|
+
*/
|
|
69
|
+
type: 'User' | 'Global';
|
|
70
|
+
/**
|
|
71
|
+
* The unique identifier for the user that the note is associated with, only populated if type === 'User'
|
|
72
|
+
*/
|
|
73
|
+
userId: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* The name of the user that the note is associated with, only populated if type === 'User'
|
|
76
|
+
*/
|
|
77
|
+
user: string | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Whenever an agent is interested in getting human-in-the-loop style feedback/approval, this type is used
|
|
81
|
+
*/
|
|
82
|
+
export declare class SkipAPIAgentRequest {
|
|
83
|
+
/**
|
|
84
|
+
* The unique identifier for the request
|
|
85
|
+
*/
|
|
86
|
+
id: string;
|
|
87
|
+
/**
|
|
88
|
+
* The unique identifier for the agent that made the request
|
|
89
|
+
*/
|
|
90
|
+
agentId: string;
|
|
91
|
+
/**
|
|
92
|
+
* The name of the agent that made the request
|
|
93
|
+
*/
|
|
94
|
+
agent: string;
|
|
95
|
+
/**
|
|
96
|
+
* The date and time the request was made
|
|
97
|
+
*/
|
|
98
|
+
requestedAt: Date;
|
|
99
|
+
/**
|
|
100
|
+
* Optional, the unique identifier for the user that the request was made for by the Agent
|
|
101
|
+
*/
|
|
102
|
+
requestForUserId?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Only populated if the request was made for a user, the name of the user that the request was made for
|
|
105
|
+
*/
|
|
106
|
+
requestForUser?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Status of the request: 'Requested' | 'Approved' | 'Rejected' | 'Canceled'
|
|
109
|
+
*/
|
|
110
|
+
status: 'Requested' | 'Approved' | 'Rejected' | 'Canceled';
|
|
111
|
+
/**
|
|
112
|
+
* Text body of the request the AI Agent is making
|
|
113
|
+
*/
|
|
114
|
+
request: string;
|
|
115
|
+
/**
|
|
116
|
+
* Text body of the response that is being sent back to the AI Agent
|
|
117
|
+
*/
|
|
118
|
+
response: string;
|
|
119
|
+
/**
|
|
120
|
+
* The unique identifier for the user that responded to the request
|
|
121
|
+
*/
|
|
122
|
+
responseByUserId: string;
|
|
123
|
+
/**
|
|
124
|
+
* The name of the user that responded to the request
|
|
125
|
+
*/
|
|
126
|
+
responseByUser: string;
|
|
127
|
+
/**
|
|
128
|
+
* The date and time the user responded to the request
|
|
129
|
+
*/
|
|
130
|
+
respondedAt: Date;
|
|
131
|
+
/**
|
|
132
|
+
* Internal comments that are not intended to be shared with the AI Agent
|
|
133
|
+
*/
|
|
134
|
+
comments: string;
|
|
135
|
+
/**
|
|
136
|
+
* The date and time the request record was created in the database
|
|
137
|
+
*/
|
|
138
|
+
createdAt: Date;
|
|
139
|
+
/**
|
|
140
|
+
* The date and time the request record was last updated in the database
|
|
141
|
+
*/
|
|
142
|
+
updatedAt: Date;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Represents a change to agent notes during the learning cycle process, allowing Skip
|
|
146
|
+
* to add new notes, update existing ones, or mark notes for deletion based on
|
|
147
|
+
* its analysis of conversation patterns and organizational learning.
|
|
148
|
+
*/
|
|
149
|
+
export declare class SkipLearningCycleNoteChange {
|
|
150
|
+
note: SkipAPIAgentNote;
|
|
151
|
+
changeType: 'add' | 'update' | 'delete';
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Represents a change to agent requests during the learning cycle process, allowing Skip
|
|
155
|
+
* to add new requests, update existing ones, or mark requests for deletion based on
|
|
156
|
+
* its analysis of conversation patterns and user feedback.
|
|
157
|
+
*/
|
|
158
|
+
export declare class SkipLearningCycleRequestChange {
|
|
159
|
+
request: SkipAPIAgentRequest;
|
|
160
|
+
changeType: 'add' | 'update' | 'delete';
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* API Request shape to ask the /learn end point to learn from conversation history and pass back "notes" that can be stored in the database for future requests
|
|
164
|
+
*/
|
|
165
|
+
export declare class SkipAPILearningCycleRequest {
|
|
166
|
+
/**
|
|
167
|
+
* OrganizationID for Skip to identify the organization
|
|
168
|
+
*/
|
|
169
|
+
organizationId: string;
|
|
170
|
+
/**
|
|
171
|
+
* This is an optional string parameter where you can tell Skip anything you'd like to share about your organization, structure, database schema, and anything else
|
|
172
|
+
* that might be helpful for him to be aware of. Keep in mind that this organizationInfo will be incorprorated into every request Skip makes to the underlying AI
|
|
173
|
+
* services which can add cost and processing time to your requests. Including this information is extremely helpful as a very simple method of
|
|
174
|
+
* contextualizing Skip for your organization. In the Pro and above Skip plans, there are far more granular and effect methods of training Skip beyond this organizationInfo parameter, contact
|
|
175
|
+
* the team at MemberJunction.com for more information if you're interested.
|
|
176
|
+
*/
|
|
177
|
+
organizationInfo?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Learning Cycle ID is a unique identifier from the MJ AI Agent Learning Cycles table that will track the details of the API calls and the results for logging purposes and
|
|
180
|
+
* also to track the timestamps for each run to batch the conversations that are being sent
|
|
181
|
+
*/
|
|
182
|
+
learningCycleId: string;
|
|
183
|
+
/**
|
|
184
|
+
* An array of conversations that have taken place since the last learning cycle
|
|
185
|
+
*/
|
|
186
|
+
newConversations: SkipConversation[];
|
|
187
|
+
/**
|
|
188
|
+
* Summary entity metadata that is passed into the Skip Server so that Skip has knowledge of the schema of the calling MJAPI environment
|
|
189
|
+
*/
|
|
190
|
+
entities: SkipEntityInfo[];
|
|
191
|
+
/**
|
|
192
|
+
* Stored queries in the MJ metadata that Skip can use and learn from
|
|
193
|
+
*/
|
|
194
|
+
queries: SkipQueryInfo[];
|
|
195
|
+
/**
|
|
196
|
+
* An array of notes that have been generated by the Skip API server during the learning cycle process in the past
|
|
197
|
+
*/
|
|
198
|
+
notes: SkipAPIAgentNote[];
|
|
199
|
+
/**
|
|
200
|
+
* An array of the possible note types that can be stored in the source MJ system
|
|
201
|
+
*/
|
|
202
|
+
noteTypes: SkipAPIAgentNoteType[];
|
|
203
|
+
/**
|
|
204
|
+
* An array of the requests that Skip has previously made. Full history provided including requests of all status conditions.
|
|
205
|
+
*/
|
|
206
|
+
requests: SkipAPIAgentRequest[];
|
|
207
|
+
/**
|
|
208
|
+
* Optional, the date/time of the last learning cycle performed on this dataset
|
|
209
|
+
*/
|
|
210
|
+
lastLearningCycleDate: Date;
|
|
211
|
+
/**
|
|
212
|
+
* One or more API keys that are used for AI systems that Skip will access on behalf of the API caller
|
|
213
|
+
* NOTE: This is not where you put in the bearer token for the Skip API server itself, that goes in the header of the request
|
|
214
|
+
*/
|
|
215
|
+
apiKeys: SkipAPIRequestAPIKey[];
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* API Response shape to ask the /learn end point to learn from conversation history and pass back "notes", an array of notes are provided that should be stored in the database
|
|
219
|
+
* to then be passed into future Skip API requests for analysis/etc.
|
|
220
|
+
*/
|
|
221
|
+
export declare class SkipAPILearningCycleResponse {
|
|
222
|
+
/**
|
|
223
|
+
* Indicates if the learning cycle was successful or not
|
|
224
|
+
*/
|
|
225
|
+
success: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* If a learning cycle is skipped because there is no new conversation data to learn from, this property will be set to true
|
|
228
|
+
*/
|
|
229
|
+
learningCycleSkipped?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* If the learning cycle was not successful, this property will contain an error message that describes the reason for the failure
|
|
232
|
+
*/
|
|
233
|
+
error?: string;
|
|
234
|
+
/**
|
|
235
|
+
* The number of milliseconds that have elapsed since the learning cycle process started
|
|
236
|
+
*/
|
|
237
|
+
elapsedTime: number;
|
|
238
|
+
/**
|
|
239
|
+
* The notes that were generated by the Skip API server during the learning cycle process
|
|
240
|
+
*/
|
|
241
|
+
noteChanges: SkipLearningCycleNoteChange[];
|
|
242
|
+
/**
|
|
243
|
+
* This provides an array of changes requested by Skip to the MJ database for queries, adding, updating and/or deleting.
|
|
244
|
+
*/
|
|
245
|
+
queryChanges: SkipLearningCycleQueryChange[];
|
|
246
|
+
/**
|
|
247
|
+
* This array should be populated by the agent with any changes to requests - deleting existing requests that have not been responded to yet and for whatever reason are not relevant anymore, updating existing requests that haven't yet been responded to, and adding new requests to help the agent learn.
|
|
248
|
+
*/
|
|
249
|
+
requestChanges: SkipLearningCycleRequestChange[];
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=agent-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-types.d.ts","sourceRoot":"","sources":["../src/agent-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA4B,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pB;;OAEG;IACH,WAAW,EAAE,2BAA2B,EAAE,CAAC;IAE3C;;OAEG;IACH,YAAY,EAAE,4BAA4B,EAAE,CAAC;IAE7C;;OAEG;IACH,cAAc,EAAE,8BAA8B,EAAE,CAAC;CACpD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview AI Agent and learning cycle types for Skip API
|
|
4
|
+
*
|
|
5
|
+
* This file contains types related to AI agent functionality, learning cycles, and
|
|
6
|
+
* human-in-the-loop interactions within the Skip API system. These types define the structure for:
|
|
7
|
+
*
|
|
8
|
+
* - Agent notes and note types (SkipAPIAgentNote, SkipAPIAgentNoteType)
|
|
9
|
+
* - Agent requests for human approval/feedback (SkipAPIAgentRequest)
|
|
10
|
+
* - Learning cycle processes (SkipAPILearningCycleRequest, SkipAPILearningCycleResponse)
|
|
11
|
+
* - Change tracking for learning cycles (various SkipLearningCycle*Change types)
|
|
12
|
+
*
|
|
13
|
+
* The learning cycle functionality allows Skip to analyze conversation history and improve
|
|
14
|
+
* its performance over time by generating notes, updating queries, and creating agent
|
|
15
|
+
* requests based on patterns it discovers in user interactions.
|
|
16
|
+
*
|
|
17
|
+
* Agent requests enable human-in-the-loop workflows where Skip can ask for approval or
|
|
18
|
+
* guidance on specific actions, ensuring that AI decisions align with organizational
|
|
19
|
+
* policies and user preferences.
|
|
20
|
+
*
|
|
21
|
+
* Notes provide a way for Skip to store and retrieve organizational knowledge, user
|
|
22
|
+
* preferences, and contextual information that improves future interactions.
|
|
23
|
+
*
|
|
24
|
+
* @author MemberJunction
|
|
25
|
+
* @since 2.0.0
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.SkipAPILearningCycleResponse = exports.SkipAPILearningCycleRequest = exports.SkipLearningCycleRequestChange = exports.SkipLearningCycleNoteChange = exports.SkipAPIAgentRequest = exports.SkipAPIAgentNote = exports.SkipAPIAgentNoteType = void 0;
|
|
29
|
+
/**
|
|
30
|
+
* Type that defines a possible note type from the source system that invoked Skip
|
|
31
|
+
*/
|
|
32
|
+
class SkipAPIAgentNoteType {
|
|
33
|
+
}
|
|
34
|
+
exports.SkipAPIAgentNoteType = SkipAPIAgentNoteType;
|
|
35
|
+
/**
|
|
36
|
+
* Defines the shape of an individual Agent note that is stored in MJ that can be passed to Skip for additional context.
|
|
37
|
+
*/
|
|
38
|
+
class SkipAPIAgentNote {
|
|
39
|
+
}
|
|
40
|
+
exports.SkipAPIAgentNote = SkipAPIAgentNote;
|
|
41
|
+
/**
|
|
42
|
+
* Whenever an agent is interested in getting human-in-the-loop style feedback/approval, this type is used
|
|
43
|
+
*/
|
|
44
|
+
class SkipAPIAgentRequest {
|
|
45
|
+
}
|
|
46
|
+
exports.SkipAPIAgentRequest = SkipAPIAgentRequest;
|
|
47
|
+
/**
|
|
48
|
+
* Represents a change to agent notes during the learning cycle process, allowing Skip
|
|
49
|
+
* to add new notes, update existing ones, or mark notes for deletion based on
|
|
50
|
+
* its analysis of conversation patterns and organizational learning.
|
|
51
|
+
*/
|
|
52
|
+
class SkipLearningCycleNoteChange {
|
|
53
|
+
}
|
|
54
|
+
exports.SkipLearningCycleNoteChange = SkipLearningCycleNoteChange;
|
|
55
|
+
/**
|
|
56
|
+
* Represents a change to agent requests during the learning cycle process, allowing Skip
|
|
57
|
+
* to add new requests, update existing ones, or mark requests for deletion based on
|
|
58
|
+
* its analysis of conversation patterns and user feedback.
|
|
59
|
+
*/
|
|
60
|
+
class SkipLearningCycleRequestChange {
|
|
61
|
+
}
|
|
62
|
+
exports.SkipLearningCycleRequestChange = SkipLearningCycleRequestChange;
|
|
63
|
+
/**
|
|
64
|
+
* API Request shape to ask the /learn end point to learn from conversation history and pass back "notes" that can be stored in the database for future requests
|
|
65
|
+
*/
|
|
66
|
+
class SkipAPILearningCycleRequest {
|
|
67
|
+
}
|
|
68
|
+
exports.SkipAPILearningCycleRequest = SkipAPILearningCycleRequest;
|
|
69
|
+
/**
|
|
70
|
+
* API Response shape to ask the /learn end point to learn from conversation history and pass back "notes", an array of notes are provided that should be stored in the database
|
|
71
|
+
* to then be passed into future Skip API requests for analysis/etc.
|
|
72
|
+
*/
|
|
73
|
+
class SkipAPILearningCycleResponse {
|
|
74
|
+
}
|
|
75
|
+
exports.SkipAPILearningCycleResponse = SkipAPILearningCycleResponse;
|
|
76
|
+
//# sourceMappingURL=agent-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-types.js","sourceRoot":"","sources":["../src/agent-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AAOH;;GAEG;AACH,MAAa,oBAAoB;CAIhC;AAJD,oDAIC;AAED;;GAEG;AACH,MAAa,gBAAgB;CAqC5B;AArCD,4CAqCC;AAED;;GAEG;AACH,MAAa,mBAAmB;CA8D/B;AA9DD,kDA8DC;AAED;;;;GAIG;AACH,MAAa,2BAA2B;CAGvC;AAHD,kEAGC;AAED;;;;GAIG;AACH,MAAa,8BAA8B;CAG1C;AAHD,wEAGC;AAED;;GAEG;AACH,MAAa,2BAA2B;CA6DvC;AA7DD,kEA6DC;AAED;;;GAGG;AACH,MAAa,4BAA4B;CAmCxC;AAnCD,oEAmCC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Core API types for Skip API communication
|
|
3
|
+
*
|
|
4
|
+
* This file contains the fundamental API request and response types used for communication
|
|
5
|
+
* between client applications and the Skip API server. These types define the core data
|
|
6
|
+
* structures for:
|
|
7
|
+
*
|
|
8
|
+
* - Main API requests and responses (SkipAPIRequest, SkipAPIResponse)
|
|
9
|
+
* - API result wrapper for MJ API server responses (MJAPISkipResult)
|
|
10
|
+
* - Request and response phase enumerations
|
|
11
|
+
* - Special API request types (SkipAPIRunScriptRequest)
|
|
12
|
+
*
|
|
13
|
+
* These types form the foundation of the Skip API communication protocol and are used
|
|
14
|
+
* across all Skip API interactions regardless of the specific functionality being invoked.
|
|
15
|
+
*
|
|
16
|
+
* @author MemberJunction
|
|
17
|
+
* @since 2.0.0
|
|
18
|
+
*/
|
|
19
|
+
import { DataContext } from '@memberjunction/data-context';
|
|
20
|
+
import type { SkipMessage } from './conversation-types';
|
|
21
|
+
import type { SkipEntityInfo } from './entity-metadata-types';
|
|
22
|
+
import type { SkipQueryInfo } from './query-types';
|
|
23
|
+
import type { SkipAPIRequestAPIKey } from './auth-types';
|
|
24
|
+
import type { SkipAPIArtifact } from './artifact-types';
|
|
25
|
+
import type { SkipAPIAgentNote, SkipAPIAgentNoteType } from './agent-types';
|
|
26
|
+
/**
|
|
27
|
+
* Describes the different request phases that are used to communicate with the Skip API Server
|
|
28
|
+
* The phase of the conversation, defined as follows:
|
|
29
|
+
* * initial_request: The initial request from the user - when a new conversation gets started or after a report is created, pass in this value
|
|
30
|
+
* * clarify_question_response: Sometimes the Skip API server responds back to your request with a responsePhase of 'clarifying_question' - in this situation, the MJAPI server needs to communicate with the UI to ask the follow up question to the user. When you have that feedback from the user gathered and are providing the response to the clarifying question back to Skip API, use this requestPhase
|
|
31
|
+
* * data_gathering_response: Sometimes the Skip API server responds back to your request with a responsePhase of 'data_request' - in this situation, the MJAPI server needs to process the data request, gather whatever additional data the Skip API has asked for, and then return it in the dataContext property of the SkipAPIRequest object. When you are finished gathering data and returning it to the Skip API server, use this requestPhase
|
|
32
|
+
* * data_gathering_failure: When you send an API request to the Skip API server saying there was a data_gathering_failure that means that you attempted to retrieve data Skip requested but there was (typically) an error in the SQL statement that Skip generated and it needs to be regenerated. The MJAPI server code handles this scenario automatically.
|
|
33
|
+
* * run_existing_script: Use this to run an existing script that was already processed. When this option is used, the script provided is run and the results are provided in the response.
|
|
34
|
+
* * chat_with_a_record: This is used for the simple record chatting feature that is separate from other Skip API features. This is used for having a chat conversation with Skip about a specific record in the database that the user is typically looking at in a UI.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SkipRequestPhase: {
|
|
37
|
+
readonly initial_request: "initial_request";
|
|
38
|
+
readonly clarify_question_response: "clarify_question_response";
|
|
39
|
+
readonly data_gathering_response: "data_gathering_response";
|
|
40
|
+
readonly data_gathering_failure: "data_gathering_failure";
|
|
41
|
+
readonly run_existing_script: "run_existing_script";
|
|
42
|
+
readonly chat_with_a_record: "chat_with_a_record";
|
|
43
|
+
};
|
|
44
|
+
export type SkipRequestPhase = typeof SkipRequestPhase[keyof typeof SkipRequestPhase];
|
|
45
|
+
/**
|
|
46
|
+
* Describes the different response phases that are used by the Skip API Server to respond back to the caller (usually the MJAPI server but can be anyone)
|
|
47
|
+
* The response phase indicates if the Skip API server is asking for additional data, a clarifying question, or if the analysis is complete and the information has been provided
|
|
48
|
+
* * clarifying_question: The Skip API server is asking for a clarifying question to be asked to the user - typecast the response to SkipAPIClarifyingQuestionResponse for all of the additional properties that are available in this response phase
|
|
49
|
+
* * data_request: The Skip API server is asking for additional data to be gathered - typecast the response to SkipAPIDataRequestResponse for all of the additional properties that are available in this response phase
|
|
50
|
+
* * analysis_complete: The Skip API server has completed the analysis and is providing the results - typecast the response to SkipAPIAnalysisCompleteResponse for all of the additional properties that are available in this response phase
|
|
51
|
+
* * chat_with_a_record_complete: The Skip API server has completed the chat with a record and is providing the results - typecast the response to SkipAPIChatWithRecordResponse for all of the additional properties that are available in this response phase
|
|
52
|
+
*/
|
|
53
|
+
export declare const SkipResponsePhase: {
|
|
54
|
+
readonly status_update: "status_update";
|
|
55
|
+
readonly clarifying_question: "clarifying_question";
|
|
56
|
+
readonly data_request: "data_request";
|
|
57
|
+
readonly analysis_complete: "analysis_complete";
|
|
58
|
+
readonly chat_with_a_record_complete: "chat_with_a_record_complete";
|
|
59
|
+
};
|
|
60
|
+
export type SkipResponsePhase = typeof SkipResponsePhase[keyof typeof SkipResponsePhase];
|
|
61
|
+
/**
|
|
62
|
+
* This type defines the shape of data that is passed back from the MJ API server to callers, typically the MJ Explorer UI
|
|
63
|
+
*/
|
|
64
|
+
export declare class MJAPISkipResult {
|
|
65
|
+
/**
|
|
66
|
+
* Indicates if the API request was successful or not, true if successful, false if not
|
|
67
|
+
*/
|
|
68
|
+
Success: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Contains a more detailed status of the API request. This is typically used to provide additional information about the request, such as an error message if the request was not successful
|
|
71
|
+
*/
|
|
72
|
+
Status: string;
|
|
73
|
+
/**
|
|
74
|
+
* The phase of the conversation, defined in the SkipResponsePhase type
|
|
75
|
+
*/
|
|
76
|
+
ResponsePhase: SkipResponsePhase;
|
|
77
|
+
/**
|
|
78
|
+
* Contains the JSON data that is returned from the Skip API server.
|
|
79
|
+
* This can be a SkipAPIAnalysisCompleteResponse, SkipAPIClarifyingQuestionResponse, or SkipAPIDataRequestResponse.
|
|
80
|
+
* To determine which type it is and to access the properties of the response, you will need to typecast
|
|
81
|
+
* this property to the appropriate type. For example:
|
|
82
|
+
*
|
|
83
|
+
* if (result.ResponsePhase === 'analysis_complete') {
|
|
84
|
+
* // typecast the MJAPISkipResult object Result property
|
|
85
|
+
* const resultData = <SkipAPIAnalysisCompleteResponse>JSON.parse(result.Result);
|
|
86
|
+
* // now you can access the properties of the SkipAPIAnalysisCompleteResponse type in a strongly typed manner
|
|
87
|
+
* // and do whatever you want to do.
|
|
88
|
+
* }
|
|
89
|
+
*/
|
|
90
|
+
Result: string;
|
|
91
|
+
/**
|
|
92
|
+
* The MemberJunction Conversation ID assigned to this conversation. This is used to track the
|
|
93
|
+
* conversation in the database, used for conversation history, and will be generated by the MJ API server if
|
|
94
|
+
* no existing Conversation ID was passed in with the request.
|
|
95
|
+
*/
|
|
96
|
+
ConversationId: string;
|
|
97
|
+
/**
|
|
98
|
+
* The Conversation Detail ID for the inbound user message that was passed in with the request.
|
|
99
|
+
*/
|
|
100
|
+
UserMessageConversationDetailId: string;
|
|
101
|
+
/**
|
|
102
|
+
* The Conversation Detail ID for the outbound system message that was generated by the Skip API server, stored in the database by the MJ API server,
|
|
103
|
+
* and is being passed back here.
|
|
104
|
+
*/
|
|
105
|
+
AIMessageConversationDetailId: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Defines the shape of the data that is expected by the Skip API Server when making a request
|
|
109
|
+
*/
|
|
110
|
+
export declare class SkipAPIRequest {
|
|
111
|
+
/**
|
|
112
|
+
* An array of 1 or more messages that are part of the conversation. The Skip API server will use these messages to understand the context of the conversation.
|
|
113
|
+
* When Skip responds to a request, he provides a messages array as well that will include the input messages as well as additional messages that he has generated as part of the conversation.
|
|
114
|
+
* In future requests for the same conversation it is important to include ALL of the messages that have been part of the conversation so far, so that Skip can understand the full context of the conversation.
|
|
115
|
+
*/
|
|
116
|
+
messages: SkipMessage[];
|
|
117
|
+
/**
|
|
118
|
+
* This is an optional string parameter where you can tell Skip anything you'd like to share about your organization, structure, database schema, and anything else
|
|
119
|
+
* that might be helpful for him to be aware of. Keep in mind that this organizationInfo will be incorprorated into every request Skip makes to the underlying AI
|
|
120
|
+
* services which can add cost and processing time to your requests. Including this information is extremely helpful as a very simple method of
|
|
121
|
+
* contextualizing Skip for your organization. In the Pro and above Skip plans, there are far more granular and effect methods of training Skip beyond this organizationInfo parameter, contact
|
|
122
|
+
* the team at MemberJunction.com for more information if you're interested.
|
|
123
|
+
*/
|
|
124
|
+
organizationInfo?: string;
|
|
125
|
+
/**
|
|
126
|
+
* The data context, use this to provide all of the data you have in a data context to Skip. You should provide this from cache or refreshed based on the parameters provided by the user.
|
|
127
|
+
*/
|
|
128
|
+
dataContext: DataContext;
|
|
129
|
+
/**
|
|
130
|
+
* Summary entity metadata that is passed into the Skip Server so that Skip has knowledge of the schema of the calling MJAPI environment
|
|
131
|
+
*/
|
|
132
|
+
entities: SkipEntityInfo[];
|
|
133
|
+
/**
|
|
134
|
+
* Stored queries in the MJ metadata that Skip can use and learn from
|
|
135
|
+
*/
|
|
136
|
+
queries: SkipQueryInfo[];
|
|
137
|
+
/**
|
|
138
|
+
* The conversation ID
|
|
139
|
+
*/
|
|
140
|
+
conversationID: string;
|
|
141
|
+
/**
|
|
142
|
+
* The organization ID - this is part of the Skip API Authentication Request, along with the bearer token in the header (the bearer token is not yet implemented, To-Do!)
|
|
143
|
+
*/
|
|
144
|
+
organizationID: string;
|
|
145
|
+
/**
|
|
146
|
+
* The request phase, defined within the SkipRequestPhase type
|
|
147
|
+
*/
|
|
148
|
+
requestPhase: SkipRequestPhase;
|
|
149
|
+
/**
|
|
150
|
+
* One or more API keys that are used for AI systems that Skip will access on behalf of the API caller
|
|
151
|
+
* NOTE: This is not where you put in the bearer token for the Skip API server itself, that goes in the header of the request
|
|
152
|
+
*/
|
|
153
|
+
apiKeys: SkipAPIRequestAPIKey[];
|
|
154
|
+
/**
|
|
155
|
+
* Optional, array of artifacts that already exist for the given conversation.
|
|
156
|
+
*/
|
|
157
|
+
artifacts?: SkipAPIArtifact[];
|
|
158
|
+
/**
|
|
159
|
+
* Optional notes that can be passed to Skip for additional context
|
|
160
|
+
*/
|
|
161
|
+
notes?: SkipAPIAgentNote[];
|
|
162
|
+
/**
|
|
163
|
+
* Optional, list of the possible types of notes that an agent can store in the source MJ system
|
|
164
|
+
*/
|
|
165
|
+
noteTypes?: SkipAPIAgentNoteType[];
|
|
166
|
+
/**
|
|
167
|
+
* Optional, if the calling server wants to enable the AI agent to call back to interact and request data or otherwise, this is the URL that the AI agent can use to call back to the source server
|
|
168
|
+
*/
|
|
169
|
+
callingServerURL?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Optional, if the calling server wants to enable the AI agent to call back to interact and request data or otherwise, this is the API key that the AI agent can use to call back to the source server
|
|
172
|
+
*/
|
|
173
|
+
callingServerAPIKey?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Optional, if the calling server requires the use of an additional short-lived access token beyond the API key, this is the token that the AI agent can use to call back to the source server during the lifecycle
|
|
176
|
+
* of the request
|
|
177
|
+
*/
|
|
178
|
+
callingServerAccessToken?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Defines the shape of the data that is returned by the Skip API Server
|
|
182
|
+
*/
|
|
183
|
+
export declare class SkipAPIResponse {
|
|
184
|
+
/**
|
|
185
|
+
* Used for all response phases, to indicate if the API request was successful or not
|
|
186
|
+
*/
|
|
187
|
+
success: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* This property is only used if success is false, and contains an error message that describes the reason for the failure
|
|
190
|
+
*/
|
|
191
|
+
error: string;
|
|
192
|
+
/**
|
|
193
|
+
* The Skip API server response phase, defined within the SkipResponsePhase type
|
|
194
|
+
*/
|
|
195
|
+
responsePhase: SkipResponsePhase;
|
|
196
|
+
/**
|
|
197
|
+
* An array of messages including the messaged passed in with the SkipAPIRequest object as well as
|
|
198
|
+
* any additional messages that Skip generates as part of the conversation.
|
|
199
|
+
*/
|
|
200
|
+
messages: SkipMessage[];
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Special API request type that extends the base SkipAPIRequest to include script execution capabilities.
|
|
204
|
+
* Used when the requestPhase is 'run_existing_script' to execute pre-defined script text.
|
|
205
|
+
*/
|
|
206
|
+
export declare class SkipAPIRunScriptRequest extends SkipAPIRequest {
|
|
207
|
+
/**
|
|
208
|
+
* The script text to run
|
|
209
|
+
*/
|
|
210
|
+
scriptText: string;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=api-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-types.d.ts","sourceRoot":"","sources":["../src/api-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC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oBAAoB,EAAE,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAEnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CACpC;AAED;;GAEG;AACH,qBAAa,eAAe;IACxB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,iBAAiB,CAAC;IACjC;;;OAGG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,cAAc;IACvD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Core API types for Skip API communication
|
|
4
|
+
*
|
|
5
|
+
* This file contains the fundamental API request and response types used for communication
|
|
6
|
+
* between client applications and the Skip API server. These types define the core data
|
|
7
|
+
* structures for:
|
|
8
|
+
*
|
|
9
|
+
* - Main API requests and responses (SkipAPIRequest, SkipAPIResponse)
|
|
10
|
+
* - API result wrapper for MJ API server responses (MJAPISkipResult)
|
|
11
|
+
* - Request and response phase enumerations
|
|
12
|
+
* - Special API request types (SkipAPIRunScriptRequest)
|
|
13
|
+
*
|
|
14
|
+
* These types form the foundation of the Skip API communication protocol and are used
|
|
15
|
+
* across all Skip API interactions regardless of the specific functionality being invoked.
|
|
16
|
+
*
|
|
17
|
+
* @author MemberJunction
|
|
18
|
+
* @since 2.0.0
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.SkipAPIRunScriptRequest = exports.SkipAPIResponse = exports.SkipAPIRequest = exports.MJAPISkipResult = exports.SkipResponsePhase = exports.SkipRequestPhase = void 0;
|
|
22
|
+
/**
|
|
23
|
+
* Describes the different request phases that are used to communicate with the Skip API Server
|
|
24
|
+
* The phase of the conversation, defined as follows:
|
|
25
|
+
* * initial_request: The initial request from the user - when a new conversation gets started or after a report is created, pass in this value
|
|
26
|
+
* * clarify_question_response: Sometimes the Skip API server responds back to your request with a responsePhase of 'clarifying_question' - in this situation, the MJAPI server needs to communicate with the UI to ask the follow up question to the user. When you have that feedback from the user gathered and are providing the response to the clarifying question back to Skip API, use this requestPhase
|
|
27
|
+
* * data_gathering_response: Sometimes the Skip API server responds back to your request with a responsePhase of 'data_request' - in this situation, the MJAPI server needs to process the data request, gather whatever additional data the Skip API has asked for, and then return it in the dataContext property of the SkipAPIRequest object. When you are finished gathering data and returning it to the Skip API server, use this requestPhase
|
|
28
|
+
* * data_gathering_failure: When you send an API request to the Skip API server saying there was a data_gathering_failure that means that you attempted to retrieve data Skip requested but there was (typically) an error in the SQL statement that Skip generated and it needs to be regenerated. The MJAPI server code handles this scenario automatically.
|
|
29
|
+
* * run_existing_script: Use this to run an existing script that was already processed. When this option is used, the script provided is run and the results are provided in the response.
|
|
30
|
+
* * chat_with_a_record: This is used for the simple record chatting feature that is separate from other Skip API features. This is used for having a chat conversation with Skip about a specific record in the database that the user is typically looking at in a UI.
|
|
31
|
+
*/
|
|
32
|
+
exports.SkipRequestPhase = {
|
|
33
|
+
initial_request: 'initial_request',
|
|
34
|
+
clarify_question_response: 'clarify_question_response',
|
|
35
|
+
data_gathering_response: 'data_gathering_response',
|
|
36
|
+
data_gathering_failure: 'data_gathering_failure',
|
|
37
|
+
run_existing_script: 'run_existing_script',
|
|
38
|
+
chat_with_a_record: 'chat_with_a_record'
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Describes the different response phases that are used by the Skip API Server to respond back to the caller (usually the MJAPI server but can be anyone)
|
|
42
|
+
* The response phase indicates if the Skip API server is asking for additional data, a clarifying question, or if the analysis is complete and the information has been provided
|
|
43
|
+
* * clarifying_question: The Skip API server is asking for a clarifying question to be asked to the user - typecast the response to SkipAPIClarifyingQuestionResponse for all of the additional properties that are available in this response phase
|
|
44
|
+
* * data_request: The Skip API server is asking for additional data to be gathered - typecast the response to SkipAPIDataRequestResponse for all of the additional properties that are available in this response phase
|
|
45
|
+
* * analysis_complete: The Skip API server has completed the analysis and is providing the results - typecast the response to SkipAPIAnalysisCompleteResponse for all of the additional properties that are available in this response phase
|
|
46
|
+
* * chat_with_a_record_complete: The Skip API server has completed the chat with a record and is providing the results - typecast the response to SkipAPIChatWithRecordResponse for all of the additional properties that are available in this response phase
|
|
47
|
+
*/
|
|
48
|
+
exports.SkipResponsePhase = {
|
|
49
|
+
status_update: "status_update",
|
|
50
|
+
clarifying_question: "clarifying_question",
|
|
51
|
+
data_request: "data_request",
|
|
52
|
+
analysis_complete: "analysis_complete",
|
|
53
|
+
chat_with_a_record_complete: "chat_with_a_record_complete"
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* This type defines the shape of data that is passed back from the MJ API server to callers, typically the MJ Explorer UI
|
|
57
|
+
*/
|
|
58
|
+
class MJAPISkipResult {
|
|
59
|
+
}
|
|
60
|
+
exports.MJAPISkipResult = MJAPISkipResult;
|
|
61
|
+
/**
|
|
62
|
+
* Defines the shape of the data that is expected by the Skip API Server when making a request
|
|
63
|
+
*/
|
|
64
|
+
class SkipAPIRequest {
|
|
65
|
+
}
|
|
66
|
+
exports.SkipAPIRequest = SkipAPIRequest;
|
|
67
|
+
/**
|
|
68
|
+
* Defines the shape of the data that is returned by the Skip API Server
|
|
69
|
+
*/
|
|
70
|
+
class SkipAPIResponse {
|
|
71
|
+
}
|
|
72
|
+
exports.SkipAPIResponse = SkipAPIResponse;
|
|
73
|
+
/**
|
|
74
|
+
* Special API request type that extends the base SkipAPIRequest to include script execution capabilities.
|
|
75
|
+
* Used when the requestPhase is 'run_existing_script' to execute pre-defined script text.
|
|
76
|
+
*/
|
|
77
|
+
class SkipAPIRunScriptRequest extends SkipAPIRequest {
|
|
78
|
+
}
|
|
79
|
+
exports.SkipAPIRunScriptRequest = SkipAPIRunScriptRequest;
|
|
80
|
+
//# sourceMappingURL=api-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-types.js","sourceRoot":"","sources":["../src/api-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAUH;;;;;;;;;GASG;AACU,QAAA,gBAAgB,GAAG;IAC5B,eAAe,EAAE,iBAAiB;IAClC,yBAAyB,EAAE,2BAA2B;IACtD,uBAAuB,EAAE,yBAAyB;IAClD,sBAAsB,EAAE,wBAAwB;IAChD,mBAAmB,EAAE,qBAAqB;IAC1C,kBAAkB,EAAE,oBAAoB;CAClC,CAAC;AAGX;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG;IAC7B,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,cAAc;IAC5B,iBAAiB,EAAE,mBAAmB;IACtC,2BAA2B,EAAE,6BAA6B;CACpD,CAAC;AAGX;;GAEG;AACH,MAAa,eAAe;CAgD3B;AAhDD,0CAgDC;AAED;;GAEG;AACH,MAAa,cAAc;CAgF1B;AAhFD,wCAgFC;AAED;;GAEG;AACH,MAAa,eAAe;CAkB3B;AAlBD,0CAkBC;AAED;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,cAAc;CAK1D;AALD,0DAKC"}
|