@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.
Files changed (54) hide show
  1. package/dist/agent-types.d.ts +251 -0
  2. package/dist/agent-types.d.ts.map +1 -0
  3. package/dist/agent-types.js +76 -0
  4. package/dist/agent-types.js.map +1 -0
  5. package/dist/api-types.d.ts +212 -0
  6. package/dist/api-types.d.ts.map +1 -0
  7. package/dist/api-types.js +80 -0
  8. package/dist/api-types.js.map +1 -0
  9. package/dist/artifact-types.d.ts +142 -0
  10. package/dist/artifact-types.d.ts.map +1 -0
  11. package/dist/artifact-types.js +26 -0
  12. package/dist/artifact-types.js.map +1 -0
  13. package/dist/auth-types.d.ts +39 -0
  14. package/dist/auth-types.d.ts.map +1 -0
  15. package/dist/auth-types.js +32 -0
  16. package/dist/auth-types.js.map +1 -0
  17. package/dist/component-types.d.ts +355 -0
  18. package/dist/component-types.d.ts.map +1 -0
  19. package/dist/component-types.js +28 -0
  20. package/dist/component-types.js.map +1 -0
  21. package/dist/conversation-types.d.ts +141 -0
  22. package/dist/conversation-types.d.ts.map +1 -0
  23. package/dist/conversation-types.js +46 -0
  24. package/dist/conversation-types.js.map +1 -0
  25. package/dist/entity-metadata-types.d.ts +125 -0
  26. package/dist/entity-metadata-types.d.ts.map +1 -0
  27. package/dist/entity-metadata-types.js +78 -0
  28. package/dist/entity-metadata-types.js.map +1 -0
  29. package/dist/index.d.ts +11 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +12 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/query-types.d.ts +107 -0
  34. package/dist/query-types.d.ts.map +1 -0
  35. package/dist/query-types.js +65 -0
  36. package/dist/query-types.js.map +1 -0
  37. package/dist/response-types.d.ts +156 -0
  38. package/dist/response-types.d.ts.map +1 -0
  39. package/dist/response-types.js +63 -0
  40. package/dist/response-types.js.map +1 -0
  41. package/dist/shared.d.ts +44 -0
  42. package/dist/shared.d.ts.map +1 -0
  43. package/dist/shared.js +3 -0
  44. package/dist/shared.js.map +1 -0
  45. package/dist/types.d.ts +31 -1028
  46. package/dist/types.d.ts.map +1 -1
  47. package/dist/types.js +45 -211
  48. package/dist/types.js.map +1 -1
  49. package/dist/util.d.ts +68 -0
  50. package/dist/util.d.ts.map +1 -0
  51. package/dist/util.js +201 -0
  52. package/dist/util.js.map +1 -0
  53. package/package.json +3 -3
  54. package/readme.md +140 -47
package/readme.md CHANGED
@@ -19,45 +19,52 @@ npm install @memberjunction/skip-types
19
19
  Types used for making requests to the Skip API:
20
20
 
21
21
  - `SkipAPIRequest` - Base interface for Skip API requests
22
- - `SkipAPIRequestContext` - Context information for Skip API requests
23
- - `SkipAPIRequestFilter` - Filter parameters for Skip requests
24
- - `SkipAPIRequestSort` - Sort parameters for Skip requests
25
- - `SkipAPIEntityQueryRequest` - Request for entity data queries
26
- - `SkipAPIDataContextItemRequest` - Request for data context items
27
- - `SkipAPIConversationRequest` - Request for conversation management
28
- - `SkipAPIFetchImageRequest` - Request for image fetching
22
+ - `SkipAPIRequestAPIKey` - API key configuration for LLM vendors
23
+ - `SkipAPIRunScriptRequest` - Request to run an existing script
24
+ - `SkipRequestPhase` - Defines the different phases of Skip requests:
25
+ - `initial_request` - Starting a new conversation or after component creation
26
+ - `clarify_question_response` - Responding to Skip's clarifying questions
27
+ - `data_gathering_response` - Returning requested data to Skip
28
+ - `data_gathering_failure` - Reporting data gathering errors
29
+ - `run_existing_script` - Running previously processed scripts
30
+ - `chat_with_a_record` - Simple record chatting feature
29
31
 
30
32
  ### Response Types
31
33
 
32
34
  Types used for handling responses from the Skip API:
33
35
 
34
36
  - `SkipAPIResponse` - Base interface for Skip API responses
35
- - `SkipAPIEntityQueryResponse` - Response with entity query results
36
- - `SkipAPIConversationResponse` - Response for conversation operations
37
- - `SkipAPIImageResponse` - Response for image operations
38
- - `SkipAPIErrorResponse` - Error response structure
39
37
  - `MJAPISkipResult` - Response format from MJAPI to the UI
40
- - `SkipResponsePhase` - Defines the different phases of Skip responses
38
+ - `SkipResponsePhase` - Defines the different phases of Skip responses:
39
+ - `status_update` - Status update during processing
40
+ - `clarifying_question` - Skip needs more information
41
+ - `data_request` - Skip needs additional data
42
+ - `analysis_complete` - Analysis finished with results
43
+ - `chat_with_a_record_complete` - Record chat completed
41
44
 
42
45
  ### Message and Conversation Types
43
46
 
44
47
  - `SkipMessage` - Individual message in a conversation with Skip
48
+ - Includes role, content, conversationDetailID
49
+ - Optional: error, hiddenToUser, userRating, userFeedback, reflectionInsights
45
50
  - `SkipConversation` - Collection of messages forming a conversation
46
- - `SkipRequestPhase` - Defines the different phases of Skip requests
47
- - `SkipConversationDetail` - Detailed conversation information
48
- - `SkipConversationStatus` - Conversation status enum
51
+ - Includes id, name, userId, messages array
52
+ - Optional: description, artifacts
49
53
 
50
- ### Report Types
54
+ ### Component Types
51
55
 
52
- Types for Skip-generated reports and visualizations:
56
+ Types for Skip-generated components and visualizations:
53
57
 
54
- - `SkipHTMLReport` - HTML-based report generated by Skip
55
- - `SkipHTMLReportCallbacks` - Interface for callbacks from HTML reports
56
- - `SkipHTMLReportInitFunction` - Initialization function for HTML reports
57
- - `SkipReportAction` - Actions that can be performed on reports
58
- - `SkipReportEvent` - Events that can occur in reports
59
- - `SkipReportCallbackResponse` - Response from report callbacks
60
- - `SimpleDataContext` - Simplified data context for HTML reports
58
+ - `SkipComponent` - Component generated by Skip
59
+ - `SkipComponentCallbacks` - Interface for callbacks from components:
60
+ - `RefreshData()` - Refresh the data context
61
+ - `OpenEntityRecord(entityName, key)` - Open a specific record
62
+ - `UpdateUserState(userState)` - Update user-specific state
63
+ - `NotifyEvent(eventName, eventData)` - Send custom events
64
+ - `SkipComponentInitFunction` - Initialization function for components
65
+ - `SkipComponentObject` - Interface exposed by components
66
+ - `SkipComponentOption` - Alternative component options
67
+ - `SimpleDataContext` - Simplified data context for components
61
68
 
62
69
  ### Learning Cycle Types
63
70
 
@@ -66,25 +73,42 @@ Types for Skip-generated reports and visualizations:
66
73
  - `SkipAPIAgentNote` - Notes that Skip can generate during learning
67
74
  - `SkipAPIAgentNoteType` - Types of notes Skip can generate
68
75
  - `SkipAPIAgentRequest` - Format for Skip's human-in-the-loop requests
76
+ - `SkipLearningCycleQueryChange` - Query changes during learning
77
+ - `SkipLearningCycleRequestChange` - Request changes during learning
78
+ - `SkipLearningCycleNoteChange` - Note changes during learning
69
79
 
70
80
  ### Data Types
71
81
 
72
82
  - `SkipDataRequest` - Format for Skip to request additional data
73
- - `SkipDataRequestType` - Types of data requests Skip can make
83
+ - `SkipDataRequestType` - Types of data requests Skip can make:
84
+ - `sql` - Fully executable SQL statement
85
+ - `stored_query` - Stored query from Queries entity
74
86
  - `SkipSubProcessResponse` - Results from sandboxed script execution
75
87
  - `SkipEntityInfo` - Entity metadata information for Skip
76
88
  - `SkipEntityFieldInfo` - Field metadata for entities
89
+ - `SkipEntityFieldValueInfo` - Possible values for entity fields
77
90
  - `SkipEntityRelationshipInfo` - Relationship metadata for entities
78
- - `SkipDataContextItem` - Data context item structure
79
- - `SkipDataContextItemType` - Types of data context items
80
- - `SkipDataContextItemSource` - Source of data context items
91
+ - `SkipQueryInfo` - Stored query information
92
+ - `SkipQueryFieldInfo` - Field information for queries
93
+ - `SkipColumnInfo` - Column information for report data
81
94
 
82
95
  ### Specialized Response Types
83
96
 
84
97
  - `SkipAPIAnalysisCompleteResponse` - Response for completed analysis
98
+ - Includes dataContext, resultType, executionResults
99
+ - Optional: component, drillDown, scriptText, newDataItems
85
100
  - `SkipAPIClarifyingQuestionResponse` - Response when Skip needs clarification
86
101
  - `SkipAPIDataRequestResponse` - Response when Skip needs more data
87
102
  - `SkipAPIChatWithRecordResponse` - Response for chat-with-record feature
103
+ - `SkipAPIAnalysisDrillDown` - Drill-down information for reports
104
+ - `SkipAPIAnalysisDrillDownFilter` - Individual drill-down filter
105
+
106
+ ### Artifact Types
107
+
108
+ - `SkipAPIArtifact` - Artifact information with versions
109
+ - `SkipAPIArtifactType` - Artifact type definition
110
+ - `SkipAPIArtifactVersion` - Version information for artifacts
111
+ - `SkipAPIArtifactRequest` - Request to create/update artifacts
88
112
 
89
113
  ## Usage Examples
90
114
 
@@ -148,17 +172,17 @@ function handleSkipResponse(result: MJAPISkipResult) {
148
172
  // Handle plot data from executionResults.plotData
149
173
  renderPlot(response.executionResults.plotData);
150
174
  } else if (response.resultType === "html") {
151
- // Handle custom HTML report
152
- renderHTML(response.executionResults.htmlReport);
175
+ // Handle custom component
176
+ renderComponent(response.component);
153
177
  }
154
178
  } else if (result.ResponsePhase === SkipResponsePhase.clarifying_question) {
155
179
  // Handle clarifying questions
156
180
  const questionResponse = JSON.parse(result.Result) as SkipAPIClarifyingQuestionResponse;
157
- promptUserForAnswer(questionResponse.question);
181
+ promptUserForAnswer(questionResponse.clarifyingQuestion);
158
182
  } else if (result.ResponsePhase === SkipResponsePhase.data_request) {
159
183
  // Handle data requests
160
184
  const dataRequest = JSON.parse(result.Result) as SkipAPIDataRequestResponse;
161
- fetchAdditionalData(dataRequest.dataRequests);
185
+ fetchAdditionalData(dataRequest.dataRequest);
162
186
  }
163
187
  } else {
164
188
  console.error("Skip API request failed:", result.Status);
@@ -166,22 +190,22 @@ function handleSkipResponse(result: MJAPISkipResult) {
166
190
  }
167
191
  ```
168
192
 
169
- ### Working with Skip HTML Reports and Callbacks
193
+ ### Working with Skip Components and Callbacks
170
194
 
171
195
  ```typescript
172
196
  import {
173
- SkipHTMLReportInitFunction,
197
+ SkipComponentInitFunction,
174
198
  SimpleDataContext,
175
- SkipHTMLReportCallbacks
199
+ SkipComponentCallbacks
176
200
  } from '@memberjunction/skip-types';
177
201
 
178
202
  // Init function that would be called by the container application
179
- const initReport: SkipHTMLReportInitFunction = (
203
+ const initComponent: SkipComponentInitFunction = (
180
204
  data: SimpleDataContext,
181
205
  userState?: any,
182
- callbacks?: SkipHTMLReportCallbacks
206
+ callbacks?: SkipComponentCallbacks
183
207
  ) => {
184
- // Initialize the report with the data
208
+ // Initialize the component with the data
185
209
  renderChart(data.data_item_1);
186
210
 
187
211
  // Set up event handlers that use callbacks
@@ -193,33 +217,102 @@ const initReport: SkipHTMLReportInitFunction = (
193
217
  callbacks?.OpenEntityRecord('Customer', { ID: 123 });
194
218
  });
195
219
 
196
- document.getElementById('drill-down').addEventListener('click', () => {
197
- callbacks?.DrillDown('SalesRegion', 'Northeast');
198
- });
199
-
200
- document.getElementById('export-data').addEventListener('click', () => {
201
- callbacks?.ExportData('csv');
202
- });
203
-
204
220
  // Update user state when something changes
205
221
  const newState = { selectedRegion: 'North' };
206
222
  callbacks?.UpdateUserState(newState);
207
223
  };
208
224
 
209
225
  // Register the init function globally so it can be called from the container
210
- window.initSkipReport = initReport;
226
+ window.initSkipComponent = initComponent;
227
+ ```
228
+
229
+ ### Working with Learning Cycles
230
+
231
+ ```typescript
232
+ import {
233
+ SkipAPILearningCycleRequest,
234
+ SkipAPILearningCycleResponse,
235
+ SkipConversation
236
+ } from '@memberjunction/skip-types';
237
+
238
+ // Create a learning cycle request
239
+ const learningRequest: SkipAPILearningCycleRequest = {
240
+ organizationId: "org-456",
241
+ learningCycleId: "cycle-123",
242
+ newConversations: conversationsSinceLastCycle,
243
+ entities: entityMetadata,
244
+ queries: storedQueries,
245
+ notes: existingNotes,
246
+ noteTypes: availableNoteTypes,
247
+ requests: existingRequests,
248
+ lastLearningCycleDate: lastCycleDate,
249
+ apiKeys: [
250
+ {
251
+ vendorDriverName: "AnthropicLLM",
252
+ apiKey: "YOUR_API_KEY"
253
+ }
254
+ ]
255
+ };
256
+
257
+ // Handle learning cycle response
258
+ function handleLearningResponse(response: SkipAPILearningCycleResponse) {
259
+ if (response.success) {
260
+ // Process note changes
261
+ response.noteChanges.forEach(change => {
262
+ if (change.changeType === 'add') {
263
+ addNote(change.note);
264
+ } else if (change.changeType === 'update') {
265
+ updateNote(change.note);
266
+ } else if (change.changeType === 'delete') {
267
+ deleteNote(change.note);
268
+ }
269
+ });
270
+
271
+ // Process query changes
272
+ response.queryChanges.forEach(change => {
273
+ // Handle query additions, updates, deletions
274
+ });
275
+
276
+ // Process request changes
277
+ response.requestChanges.forEach(change => {
278
+ // Handle request changes
279
+ });
280
+ } else {
281
+ console.error("Learning cycle failed:", response.error);
282
+ }
283
+ }
211
284
  ```
212
285
 
286
+ ## Supported LLM Vendors
287
+
288
+ The `vendorDriverName` in `SkipAPIRequestAPIKey` supports the following AI providers:
289
+ - `OpenAILLM` - OpenAI models
290
+ - `MistralLLM` - Mistral AI models
291
+ - `GeminiLLM` - Google Gemini models
292
+ - `AnthropicLLM` - Anthropic Claude models
293
+ - `GroqLLM` - Groq models
294
+
213
295
  ## Dependencies
214
296
 
215
297
  This package relies on the following MemberJunction packages:
298
+ - `@memberjunction/core` - Core MemberJunction types (CompositeKey)
216
299
  - `@memberjunction/core-entities` - Core entity definitions
217
300
  - `@memberjunction/data-context` - Data context types and utilities
218
301
 
302
+ ## TypeScript Configuration
303
+
304
+ This package is built with TypeScript and includes type definitions. No additional @types packages are required.
305
+
219
306
  ## Contributing
220
307
 
221
308
  Contributions to extend or improve the type definitions are welcome. Please ensure that any additions maintain backward compatibility and follow the established naming conventions.
222
309
 
310
+ ### Naming Conventions
311
+ - Use PascalCase for class and interface names
312
+ - Prefix Skip-specific types with `Skip`
313
+ - Use descriptive names that clearly indicate the type's purpose
314
+ - Group related types together in the source file
315
+
223
316
  ## License
224
317
 
225
318
  ISC