2.48.0 • Published 4 months ago

@memberjunction/ng-ask-skip v2.48.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

@memberjunction/ng-ask-skip

The @memberjunction/ng-ask-skip library provides Angular components for integrating Skip AI assistant functionality into your MemberJunction applications. Skip is MemberJunction's AI assistant that enables natural language interaction with your data, including record analysis, report generation, and AI-powered insights.

Features

  • AI Chat with Records: Direct chat interface with Skip AI about specific entity records
  • Skip Button Integration: Easy way to add Skip functionality to any view with route or window modes
  • Dynamic Reports: Generate and display AI-powered reports with interactive charts and tables
  • Inline Artifacts: View and interact with AI-generated artifacts directly within messages
  • Customizable Welcome Questions: Configure context-aware suggested prompts for users
  • Window and Inline Modes: Display Skip as a popup overlay or embedded in your UI
  • Conversation History: Automatically saves and loads conversation history with full context
  • Resource Sharing: Share conversations with other users through the MJ resource system
  • Data Context Integration: Leverages MemberJunction's data context for comprehensive record analysis
  • Drill-Down Capabilities: Navigate through related data with interactive drill-down functionality

Installation

npm install @memberjunction/ng-ask-skip

Requirements

  • Angular 18.0.2 or higher
  • Font Awesome 5+ (used for icons throughout the UI)
  • MemberJunction core libraries (v2.43.0 or compatible)
  • Kendo UI for Angular (v16.2.0)
  • Plotly.js for chart visualization

Add Font Awesome to your index.html:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">

Usage

Import the module in your application:

import { AskSkipModule } from '@memberjunction/ng-ask-skip';

@NgModule({
  imports: [
    // ...
    AskSkipModule
  ]
})
export class YourModule { }

Skip Button

Add a button that opens Skip in a popup overlay window:

<mj-skip-button 
  action="window" 
  (click)="handleSkipButtonClicked($event)">
</mj-skip-button>

Navigation to a dedicated Skip page (routes to /askskip):

<mj-skip-button 
  action="route" 
  (click)="handleSkipButtonClicked($event)">
</mj-skip-button>

Handle the button click:

import { SkipClickedEvent } from '@memberjunction/ng-ask-skip';

handleSkipButtonClicked(event: SkipClickedEvent) {
  // Optionally cancel the default action
  // event.cancel = true;
  
  // Custom logic before/after Skip opens
  console.log('Skip button clicked');
  
  // The button automatically tracks open windows
  console.log('Open Skip windows:', SkipChatComponent.SkipChatWindowsCurrentlyVisible);
}

Skip Chat with Record

Chat with Skip about a specific entity record:

<mj-skip-chat-with-record
  [LinkedEntityID]="entityId"
  [LinkedPrimaryKey]="recordPrimaryKey">
</mj-skip-chat-with-record>

With custom welcome questions:

import { ChatWelcomeQuestion } from '@memberjunction/ng-chat';

@Component({...})
export class MyComponent {
  customWelcomeQuestions: ChatWelcomeQuestion[] = [
    {
      topLine: "Overview",
      bottomLine: "Give me a quick overview of this record",
      prompt: "Can you provide a brief overview of this record?"
    },
    {
      topLine: "Analysis",
      bottomLine: "Provide detailed analysis of this record",
      prompt: "I need a detailed analysis of this record"
    }
  ];
}
<mj-skip-chat-with-record
  [LinkedEntityID]="entityId"
  [LinkedPrimaryKey]="recordPrimaryKey"
  [WelcomeQuestions]="customWelcomeQuestions">
</mj-skip-chat-with-record>

Skip Chat in a Dialog Window

Open Skip chat for a record in a modal dialog:

<mj-skip-chat-with-record-window
  [LinkedEntityID]="entityId"
  [LinkedPrimaryKey]="recordPrimaryKey"
  [Visible]="showSkipChat"
  (DialogClosed)="handleDialogClosed()">
</mj-skip-chat-with-record-window>

Dynamic Report Components

Display AI-generated reports with interactive tabs for different views:

<mj-skip-dynamic-tabbed-report
  [ReportID]="reportId"
  [ShowDetailsTab]="true"
  [AllowDrillDown]="true">
</mj-skip-dynamic-tabbed-report>

The dynamic report component provides multiple tabs:

  • Chart Tab: Interactive Plotly.js visualizations
  • HTML Tab: Formatted HTML content
  • Table Tab: Tabular data view with sorting and filtering
  • Drill-Down Tab: Navigate to related data (when enabled)
  • Details Tab: Additional report metadata (when enabled)

Working with Skip-Generated Reports

// Handle report events
<mj-skip-dynamic-tabbed-report
  [SkipData]="skipReportData"
  [ConversationID]="conversationId"
  [ConversationName]="conversationName"
  [ConversationDetailID]="detailId"
  (reportCreated)="onReportCreated($event)">
</mj-skip-dynamic-tabbed-report>

Available Components

ComponentSelectorDescription
SkipButtonComponentmj-skip-buttonButton that opens Skip via route navigation or overlay window
SkipWindowComponentmj-skip-windowSkip chat displayed in a CDK overlay popup window
SkipChatWithRecordComponentmj-skip-chat-with-recordSkip chat interface for analyzing a specific entity record
SkipChatWithRecordWindowComponentmj-skip-chat-with-record-windowSkip chat for a record wrapped in a Kendo dialog window
SkipDynamicTabbedReportComponentskip-dynamic-tabbed-reportDynamic AI-generated report with chart, HTML, table, and drill-down tabs
DynamicReportDrillDownComponentmj-dynamic-report-drill-downInteractive drill-down component for exploring related data
UserViewGridWithAnalysisComponentmj-user-view-grid-with-analysisUser view grid enhanced with Skip AI analysis capabilities
SkipChatWrapperComponentmj-skip-chat-wrapperContainer wrapper for Skip chat with navigation and drill-down support

Inline Artifacts Support

Ask Skip includes intelligent integration with AI-generated artifacts directly within the conversation interface. Artifacts are standalone content pieces created during AI conversations, such as:

  • Code snippets
  • Data analyses and visualizations
  • Documents and reports
  • SQL queries
  • JSON data structures
  • Markdown content
  • Plain text notes

Artifact Display Design

The artifacts integration follows an intuitive inline approach:

  1. Message-Linked Artifacts: When a message has an associated artifact (identified by ArtifactID in the ConversationDetailEntity), a visual indicator appears within the message display.

  2. Split-Panel Viewing: Clicking on an artifact indicator dynamically splits the conversation area:

    • Left panel: Continues displaying all conversation messages
    • Right panel: Shows the selected artifact's content
    • Draggable splitter between panels allows users to customize the view ratio
  3. Context-Aware Integration: Artifacts remain in context with the conversation that created them

Using Artifacts

Working with artifacts is straightforward:

  1. View Artifact: Click on the artifact indicator within a message to open the split-panel view
  2. Resize Panels: Drag the splitter to adjust the ratio between conversation and artifact content
  3. Close Artifact View: Close the artifact panel to return to the full conversation view

Artifact Events

Components provide event emitters for artifact interactions:

// Listen for artifact events
<mj-skip-chat-with-record
  (ArtifactSelected)="handleArtifactSelected($event)"
  (ArtifactViewed)="handleArtifactViewed($event)">
</mj-skip-chat-with-record>

Handle artifact events in your component:

import { SkipAPIArtifact } from '@memberjunction/skip-types';

@Component({...})
export class MyComponent {
  handleArtifactSelected(artifact: SkipAPIArtifact) {
    console.log(`Selected artifact: ${artifact.name}`);
    // Custom handling of artifact selection
  }
  
  handleArtifactViewed(artifact: SkipAPIArtifact) {
    console.log(`Viewing artifact: ${artifact.name}`);
    // Custom handling for artifact viewing
  }
}

Configuration Options

Control artifact features with these input properties:

<mj-skip-chat-with-record
  [EnableArtifactSplitView]="true"
  [DefaultSplitRatio]="0.6">
</mj-skip-chat-with-record>
PropertyTypeDefaultDescription
EnableArtifactSplitViewbooleantrueEnable/disable split-panel artifact viewing
DefaultSplitRationumber0.6Default ratio for split panels (0-1)

Component Details

SkipChatWithRecordComponent

Inputs

  • LinkedEntityID: string - ID of the entity to chat about
  • LinkedPrimaryKey: CompositeKey - Primary key of the record to chat about
  • WelcomeQuestions: ChatWelcomeQuestion[] - Custom welcome questions
  • EnableArtifactSplitView: boolean - Whether to enable split-panel artifact viewing (default: true)
  • DefaultSplitRatio: number - Default ratio for split panels (0-1, default: 0.6)

Outputs

  • ArtifactSelected: EventEmitter - Fires when an artifact is selected
  • ArtifactViewed: EventEmitter - Fires when an artifact is viewed in the panel
  • NavigateToMatchingReport: EventEmitter - Fires when a report link is clicked
  • NewReportCreated: EventEmitter - Fires when a new report is created

Methods

  • HandleChatMessageAdded(message: ChatMessage): Processes new chat messages
  • HandleClearChat(): Clears the conversation history
  • ViewArtifact(artifactId: string): Opens an artifact in the split-panel view

SkipButtonComponent

Inputs

  • action: 'route' | 'window' - Whether to navigate to a Skip page or open a popup

Outputs

  • click: EventEmitter - Fires when the button is clicked

SkipChatWithRecordWindowComponent

Inputs

  • LinkedEntityID: string - ID of the entity to chat about
  • LinkedPrimaryKey: CompositeKey - Primary key of the record to chat about
  • DialogTitle: string - Title for the dialog window
  • Visible: boolean - Whether the dialog is visible
  • Width: number - Width of the dialog
  • Height: number - Height of the dialog
  • WelcomeQuestions: ChatWelcomeQuestion[] - Custom welcome questions
  • EnableArtifactSplitView: boolean - Whether to enable split-panel artifact viewing (default: true)
  • DefaultSplitRatio: number - Default ratio for split panels (0-1, default: 0.6)

Outputs

  • DialogClosed: EventEmitter - Fires when the dialog is closed
  • ArtifactSelected: EventEmitter - Fires when an artifact is selected
  • ArtifactViewed: EventEmitter - Fires when an artifact is viewed

SkipChatWrapperComponent

Inputs

  • EnableArtifactSplitView: boolean - Whether to enable split-panel artifact viewing (default: true)
  • DefaultSplitRatio: number - Default ratio for split panels (0-1, default: 0.6)

Outputs

  • NavigateToMatchingReport: EventEmitter - Fires when a report link is clicked
  • ConversationSelected: EventEmitter - Fires when a conversation is selected
  • DrillDownEvent: EventEmitter - Fires when drill-down is requested
  • ArtifactSelected: EventEmitter - Fires when an artifact is selected
  • ArtifactViewed: EventEmitter - Fires when an artifact is viewed

Building the Package

To build this package:

# From the package directory
npm run build

# Or from the repository root using turbo
turbo build --filter="@memberjunction/ng-ask-skip"

The compiled output will be in the dist/ directory.

Module Configuration

The module automatically configures Plotly.js for chart rendering:

// Configured in module.ts
PlotlyViaCDNModule.setPlotlyVersion('latest');
PlotlyViaCDNModule.setPlotlyBundle(null); // Uses full bundle

Dependencies

Angular Dependencies

  • @angular/common (18.0.2)
  • @angular/core (18.0.2)
  • @angular/forms (18.0.2)
  • @angular/router (18.0.2)
  • @angular/cdk (18.0.2)

MemberJunction Dependencies

  • @memberjunction/core (2.43.0)
  • @memberjunction/core-entities (2.43.0)
  • @memberjunction/global (2.43.0)
  • @memberjunction/graphql-dataprovider (2.43.0)
  • @memberjunction/skip-types (2.43.0)
  • @memberjunction/ng-container-directives (2.43.0)
  • @memberjunction/ng-chat (2.43.0)
  • @memberjunction/ng-skip-chat (2.43.0)
  • @memberjunction/ng-shared (2.43.0)
  • @memberjunction/ng-data-context (2.43.0)
  • @memberjunction/ng-user-view-grid (2.43.0)
  • @memberjunction/ng-tabstrip (2.43.0)

Third-Party Dependencies

  • @progress/kendo-angular-grid (16.2.0)
  • @progress/kendo-angular-listview (16.2.0)
  • @progress/kendo-angular-notification (16.2.0)
  • @progress/kendo-angular-dialog (16.2.0)
  • @progress/kendo-angular-label (16.2.0)
  • @progress/kendo-angular-layout (16.2.0)
  • @progress/kendo-angular-filter (16.2.0)
  • @progress/kendo-angular-indicators (16.2.0)
  • angular-plotly.js (^5.2.2)
  • plotly.js-dist-min (^2.3.4)
  • ngx-markdown (18.0.0)
  • tslib (^2.3.0)

TypeScript Types and Interfaces

Key types used throughout the library:

import { 
  SkipClickedEvent,
  // Component classes
  SkipButtonComponent,
  SkipWindowComponent,
  SkipChatWithRecordComponent,
  SkipChatWithRecordWindowComponent,
  SkipDynamicTabbedReportComponent,
  DynamicReportDrillDownComponent,
  UserViewGridWithAnalysisComponent,
  SkipChatWrapperComponent
} from '@memberjunction/ng-ask-skip';

// From related packages
import { ChatMessage, ChatWelcomeQuestion } from '@memberjunction/ng-chat';
import { SkipAPIChatWithRecordResponse, SkipAPIArtifact } from '@memberjunction/skip-types';
import { DrillDownInfo } from '@memberjunction/ng-skip-chat';
import { CompositeKey } from '@memberjunction/core';

Integration with MemberJunction

This package integrates seamlessly with MemberJunction's entity system:

  1. Entity Context: Skip automatically loads data context for the linked entity
  2. Conversation Persistence: All conversations are saved to the Conversations and Conversation Details entities
  3. User Integration: Conversations are automatically linked to the current MJ user
  4. Resource System: Conversations can be shared as resources with other users
  5. Report Storage: Generated reports can be saved to the Reports entity

License

This package is part of the MemberJunction ecosystem and follows the same licensing terms.

2.23.2

8 months ago

2.46.0

4 months ago

2.23.1

8 months ago

2.34.0

6 months ago

2.19.4

9 months ago

2.19.5

9 months ago

2.19.2

9 months ago

2.19.3

9 months ago

2.19.0

9 months ago

2.19.1

9 months ago

2.34.2

6 months ago

2.34.1

6 months ago

2.45.0

4 months ago

2.22.1

8 months ago

2.22.0

8 months ago

2.22.2

8 months ago

2.33.0

6 months ago

2.18.3

9 months ago

2.18.1

9 months ago

2.18.2

9 months ago

2.18.0

9 months ago

2.21.0

8 months ago

2.44.0

5 months ago

2.29.0

7 months ago

2.29.2

7 months ago

2.29.1

7 months ago

2.32.0

7 months ago

2.32.2

7 months ago

2.32.1

7 months ago

2.17.0

9 months ago

2.43.0

5 months ago

2.20.2

9 months ago

2.20.3

8 months ago

2.20.0

9 months ago

2.20.1

9 months ago

2.28.0

8 months ago

2.31.0

7 months ago

2.39.0

5 months ago

2.16.1

9 months ago

2.16.0

9 months ago

2.42.1

5 months ago

2.42.0

5 months ago

2.27.1

8 months ago

2.27.0

8 months ago

2.30.0

7 months ago

2.15.2

9 months ago

2.15.1

9 months ago

2.38.0

5 months ago

2.41.0

5 months ago

2.26.1

8 months ago

2.26.0

8 months ago

2.37.1

5 months ago

2.37.0

5 months ago

2.14.0

9 months ago

2.40.0

5 months ago

2.25.0

8 months ago

2.48.0

4 months ago

2.13.4

10 months ago

2.36.0

6 months ago

2.13.2

11 months ago

2.13.3

10 months ago

2.13.0

11 months ago

2.36.1

6 months ago

2.13.1

11 months ago

2.47.0

4 months ago

2.24.1

8 months ago

2.24.0

8 months ago

2.12.0

12 months ago

2.35.1

6 months ago

2.35.0

6 months ago

2.23.0

8 months ago

2.11.0

12 months ago

2.10.0

12 months ago

2.9.0

12 months ago

2.8.0

1 year ago

2.7.0

1 year ago

2.7.1

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.5.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.0.0

1 year ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.3

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.5.0

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.5.1

1 year ago

2.1.5

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.11

1 year ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.8-next.6

2 years ago

1.0.8-next.5

2 years ago

1.0.8-next.4

2 years ago

1.0.8-next.3

2 years ago

1.0.8-next.2

2 years ago

1.0.8-next.1

2 years ago

1.0.8-next.0

2 years ago

1.0.7-next.0

2 years ago

1.0.8-beta.0

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.9.127

2 years ago

0.9.120

2 years ago

0.9.123

2 years ago

0.9.125

2 years ago

0.9.124

2 years ago

0.9.126

2 years ago

0.9.118

2 years ago

0.9.119

2 years ago

0.9.117

2 years ago

0.9.114

2 years ago

0.9.113

2 years ago

0.9.116

2 years ago

0.9.115

2 years ago

0.9.110

2 years ago

0.9.112

2 years ago

0.9.109

2 years ago

0.9.107

2 years ago

0.9.106

2 years ago

0.9.103

2 years ago

0.9.104

2 years ago

0.9.102

2 years ago

0.9.101

2 years ago

0.9.100

2 years ago

0.9.96

2 years ago

0.9.97

2 years ago

0.9.98

2 years ago

0.9.93

2 years ago

0.9.94

2 years ago

0.9.92

2 years ago

0.9.90

2 years ago

0.9.89

2 years ago

0.9.86

2 years ago

0.9.87

2 years ago

0.9.88

2 years ago

0.9.84

2 years ago

0.9.82

2 years ago

0.9.83

2 years ago

0.9.81

2 years ago

0.9.80

2 years ago

0.9.79

2 years ago

0.9.78

2 years ago

0.9.76

2 years ago

0.9.77

2 years ago

0.9.75

2 years ago

0.9.74

2 years ago

0.9.73

2 years ago

0.9.70

2 years ago

0.9.71

2 years ago

0.9.72

2 years ago

0.9.69

2 years ago

0.9.56

2 years ago

0.9.57

2 years ago

0.9.58

2 years ago

0.9.59

2 years ago

0.9.55

2 years ago

0.9.67

2 years ago

0.9.68

2 years ago

0.9.63

2 years ago

0.9.64

2 years ago

0.9.60

2 years ago

0.9.61

2 years ago

0.9.62

2 years ago

0.9.52

2 years ago

0.9.54

2 years ago

0.9.51

2 years ago

0.9.50

2 years ago

0.9.34

2 years ago

0.9.35

2 years ago

0.9.36

2 years ago

0.9.37

2 years ago

0.9.30

2 years ago

0.9.31

2 years ago

0.9.32

2 years ago

0.9.33

2 years ago

0.9.38

2 years ago

0.9.39

2 years ago

0.9.23

2 years ago

0.9.46

2 years ago

0.9.24

2 years ago

0.9.47

2 years ago

0.9.25

2 years ago

0.9.48

2 years ago

0.9.26

2 years ago

0.9.41

2 years ago

0.9.42

2 years ago

0.9.43

2 years ago

0.9.44

2 years ago

0.9.49

2 years ago

0.9.27

2 years ago

0.9.28

2 years ago

0.9.29

2 years ago

0.9.40

2 years ago

0.9.22

2 years ago

0.9.20

2 years ago

0.9.21

2 years ago

0.9.17

2 years ago

0.9.19

2 years ago

0.9.12

2 years ago

0.9.13

2 years ago

0.9.14

2 years ago

0.9.15

2 years ago

0.9.10

2 years ago

0.9.11

2 years ago

0.9.16

2 years ago

0.9.9

2 years ago

0.9.8

2 years ago

0.9.7

2 years ago