@meltingspot/core 1.19.0 → 1.21.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/CHANGELOG.md +32 -0
- package/index.d.ts +5 -0
- package/index.mjs +1009 -921
- package/index.umd.js +4 -4
- package/package.json +1 -1
- package/services/api/melty/melty.api.output.d.ts +7 -0
- package/services/api/melty/melty.api.service.d.ts +13 -0
- package/services/api/playbook/playbook.api.input.d.ts +5 -0
- package/types/conversation/conversationMessage.d.ts +2 -0
- package/types/conversation/conversationSseEvent.d.ts +9 -1
- package/types/conversation/getConversationMessagesResponse.d.ts +2 -0
- package/types/conversation/index.d.ts +1 -0
- package/types/conversation/listConversationsSort.d.ts +10 -0
- package/types/index.d.ts +1 -0
- package/types/roleplay/index.d.ts +1 -0
- package/types/roleplay/roleplayModality.d.ts +5 -0
- package/types/widget/metadata/generatedContentWidgetContentMetadata.d.ts +6 -0
- package/types/widget/metadata/index.d.ts +5 -1
- package/types/widget/metadata/roleplayWidgetContentMetadata.d.ts +10 -0
- package/types/widget/playbook/playbookIntentWidgetMode.d.ts +2 -1
- package/types/widget/spotWidgetContentType.d.ts +2 -0
- package/utils/date/types.d.ts +1 -1
- package/utils/formatLogContext.d.ts +12 -0
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Result } from 'neverthrow';
|
|
2
|
+
import { MeltyConfigOutput } from './melty.api.output';
|
|
3
|
+
export declare class MeltyApiService {
|
|
4
|
+
private readonly meltingSpotApi;
|
|
5
|
+
private static instance;
|
|
6
|
+
static getInstance(): MeltyApiService;
|
|
7
|
+
private constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Capabilities of the coach config of the current spot. A flag the API
|
|
10
|
+
* does not send reads as `false` (fail-closed).
|
|
11
|
+
*/
|
|
12
|
+
getConfig(): Promise<Result<MeltyConfigOutput, Error>>;
|
|
13
|
+
}
|
|
@@ -38,6 +38,7 @@ export interface ListPlaybookIntentsQuery extends PlaybookHotspotParams {
|
|
|
38
38
|
}
|
|
39
39
|
export interface ListAccessiblePlaybookIntentsQuery extends PlaybookPageParams {
|
|
40
40
|
domain?: string;
|
|
41
|
+
capabilities?: string[];
|
|
41
42
|
}
|
|
42
43
|
export interface PlaybookIntentParams extends PlaybookHotspotParams {
|
|
43
44
|
intentId: string;
|
|
@@ -61,11 +62,15 @@ export interface UpdatePlaybookHotspotInput {
|
|
|
61
62
|
highlighted?: boolean;
|
|
62
63
|
pageId?: string;
|
|
63
64
|
}
|
|
65
|
+
export interface CreatePlaybookIntentStandaloneInput {
|
|
66
|
+
title: string;
|
|
67
|
+
}
|
|
64
68
|
export interface CreatePlaybookIntentInput {
|
|
65
69
|
description: string;
|
|
66
70
|
status?: PlaybookIntentStatus;
|
|
67
71
|
widgetId?: string;
|
|
68
72
|
order?: number;
|
|
73
|
+
standalone?: CreatePlaybookIntentStandaloneInput;
|
|
69
74
|
}
|
|
70
75
|
export interface GenerateIntentStandaloneTitleInput {
|
|
71
76
|
prompt: string;
|
|
@@ -3,6 +3,7 @@ import { MeltyHandoffReason } from './meltyHandoffReason';
|
|
|
3
3
|
import { MeltyMessageFeedbackReason } from './meltyMessageFeedbackReason';
|
|
4
4
|
import { MeltyMessageFeedbackSignal } from './meltyMessageFeedbackSignal';
|
|
5
5
|
import { MessageIntentAction } from './messageIntentAction';
|
|
6
|
+
import { OnboardingStep } from './onboardingConversation';
|
|
6
7
|
import { RenderableWidgetAction } from './renderableWidgetAction';
|
|
7
8
|
export interface ConversationMessage {
|
|
8
9
|
id: string;
|
|
@@ -12,6 +13,7 @@ export interface ConversationMessage {
|
|
|
12
13
|
handoff?: {
|
|
13
14
|
reason: MeltyHandoffReason;
|
|
14
15
|
};
|
|
16
|
+
onboardingNextStep?: OnboardingStep;
|
|
15
17
|
feedback?: {
|
|
16
18
|
signal: MeltyMessageFeedbackSignal;
|
|
17
19
|
reason?: Nullable<MeltyMessageFeedbackReason>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MeltyHandoffReason } from './meltyHandoffReason';
|
|
2
2
|
import { MeltyWidgetAction } from './meltyWidgetAction';
|
|
3
|
+
import { OnboardingStep } from './onboardingConversation';
|
|
3
4
|
export declare enum ConversationSseEventType {
|
|
4
5
|
Metadata = "metadata",
|
|
5
6
|
Token = "token",
|
|
@@ -8,6 +9,7 @@ export declare enum ConversationSseEventType {
|
|
|
8
9
|
Action = "action",
|
|
9
10
|
Bubble = "bubble",
|
|
10
11
|
Handoff = "handoff",
|
|
12
|
+
OnboardingNextStep = "onboarding_next_step",
|
|
11
13
|
Done = "done",
|
|
12
14
|
Error = "error"
|
|
13
15
|
}
|
|
@@ -50,6 +52,12 @@ export interface ConversationSseHandoffEvent {
|
|
|
50
52
|
reason: MeltyHandoffReason;
|
|
51
53
|
};
|
|
52
54
|
}
|
|
55
|
+
export interface ConversationSseOnboardingNextStepEvent {
|
|
56
|
+
type: ConversationSseEventType.OnboardingNextStep;
|
|
57
|
+
data: {
|
|
58
|
+
step: OnboardingStep;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
53
61
|
export interface ConversationSseDoneEvent {
|
|
54
62
|
type: ConversationSseEventType.Done;
|
|
55
63
|
data: {
|
|
@@ -64,4 +72,4 @@ export interface ConversationSseErrorEvent {
|
|
|
64
72
|
code: string;
|
|
65
73
|
};
|
|
66
74
|
}
|
|
67
|
-
export type ConversationSseEvent = ConversationSseMetadataEvent | ConversationSseTokenEvent | ConversationSseStatusLabelEvent | ConversationSseActionsPendingEvent | ConversationSseActionEvent | ConversationSseBubbleEvent | ConversationSseHandoffEvent | ConversationSseDoneEvent | ConversationSseErrorEvent;
|
|
75
|
+
export type ConversationSseEvent = ConversationSseMetadataEvent | ConversationSseTokenEvent | ConversationSseStatusLabelEvent | ConversationSseActionsPendingEvent | ConversationSseActionEvent | ConversationSseBubbleEvent | ConversationSseHandoffEvent | ConversationSseOnboardingNextStepEvent | ConversationSseDoneEvent | ConversationSseErrorEvent;
|
|
@@ -6,6 +6,7 @@ import { MeltyMessageFeedbackReason } from './meltyMessageFeedbackReason';
|
|
|
6
6
|
import { MeltyMessageFeedbackSignal } from './meltyMessageFeedbackSignal';
|
|
7
7
|
import { MeltyWidgetAction } from './meltyWidgetAction';
|
|
8
8
|
import { MessageIntentAction } from './messageIntentAction';
|
|
9
|
+
import { OnboardingStep } from './onboardingConversation';
|
|
9
10
|
/**
|
|
10
11
|
* Raw payload of GET /melty/conversations/:id/messages. It differs from the SDK
|
|
11
12
|
* `Conversation`: the id is `conversationId`, and per-message widget actions are
|
|
@@ -24,6 +25,7 @@ export interface GetConversationMessageResponse {
|
|
|
24
25
|
intentAction?: MessageIntentAction;
|
|
25
26
|
wizardStepKey?: string;
|
|
26
27
|
wizardClosing?: boolean;
|
|
28
|
+
onboardingNextStep?: OnboardingStep;
|
|
27
29
|
}>;
|
|
28
30
|
feedback?: {
|
|
29
31
|
signal: MeltyMessageFeedbackSignal;
|
|
@@ -5,6 +5,7 @@ export * from './conversationStreamResponse';
|
|
|
5
5
|
export * from './createConversationResponse';
|
|
6
6
|
export * from './getConversationMessagesResponse';
|
|
7
7
|
export * from './listConversationsResponse';
|
|
8
|
+
export * from './listConversationsSort';
|
|
8
9
|
export * from './meltyHandoffReason';
|
|
9
10
|
export * from './meltyMessageFeedbackReason';
|
|
10
11
|
export * from './meltyMessageFeedbackSignal';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Order of `GET /v1/melty/conversations`. Mirror of the server enum.
|
|
3
|
+
* `CreatedAt` (the default when omitted): newest created first.
|
|
4
|
+
* `LastActivity`: most recent activity first, conversations without any
|
|
5
|
+
* activity last.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ListConversationsSort {
|
|
8
|
+
CreatedAt = "CreatedAt",
|
|
9
|
+
LastActivity = "LastActivity"
|
|
10
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './roleplayModality';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
2
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
3
|
+
export interface GeneratedContentWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
4
|
+
type: SpotWidgetContentType.GeneratedContent;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
@@ -4,11 +4,13 @@ import { CourseWidgetContentMetadata } from './courseWidgetContentMetadata';
|
|
|
4
4
|
import { DocumentLinkWidgetContentMetadata } from './documentLinkWidgetContentMetadata';
|
|
5
5
|
import { DocumentPageWidgetContentMetadata } from './documentPageWidgetContentMetadata';
|
|
6
6
|
import { ForumWidgetContentMetadata } from './forumWidgetContentMetadata';
|
|
7
|
+
import { GeneratedContentWidgetContentMetadata } from './generatedContentWidgetContentMetadata';
|
|
7
8
|
import { LearningPathWidgetContentMetadata } from './learningPathWidgetContentMetadata';
|
|
8
9
|
import { LiveWidgetContentMetadata } from './liveWidgetContentMetadata';
|
|
9
10
|
import { RichTextWidgetContentMetadata } from './richTextWidgetContentMetadata';
|
|
11
|
+
import { RoleplayWidgetContentMetadata } from './roleplayWidgetContentMetadata';
|
|
10
12
|
import { TopicWidgetContentMetadata } from './topicWidgetContentMetadata';
|
|
11
|
-
export type WidgetContentMetadata = ChannelWidgetContentMetadata | CollectionWidgetContentMetadata | CourseWidgetContentMetadata | DocumentLinkWidgetContentMetadata | DocumentPageWidgetContentMetadata | ForumWidgetContentMetadata | LearningPathWidgetContentMetadata | LiveWidgetContentMetadata | RichTextWidgetContentMetadata | TopicWidgetContentMetadata;
|
|
13
|
+
export type WidgetContentMetadata = ChannelWidgetContentMetadata | CollectionWidgetContentMetadata | CourseWidgetContentMetadata | DocumentLinkWidgetContentMetadata | DocumentPageWidgetContentMetadata | ForumWidgetContentMetadata | GeneratedContentWidgetContentMetadata | LearningPathWidgetContentMetadata | LiveWidgetContentMetadata | RichTextWidgetContentMetadata | RoleplayWidgetContentMetadata | TopicWidgetContentMetadata;
|
|
12
14
|
export type NonRichTextWidgetContentMetadata = Exclude<WidgetContentMetadata, RichTextWidgetContentMetadata>;
|
|
13
15
|
export * from './abstractWidgetContentMetadata';
|
|
14
16
|
export * from './channelWidgetContentMetadata';
|
|
@@ -17,7 +19,9 @@ export * from './courseWidgetContentMetadata';
|
|
|
17
19
|
export * from './documentLinkWidgetContentMetadata';
|
|
18
20
|
export * from './documentPageWidgetContentMetadata';
|
|
19
21
|
export * from './forumWidgetContentMetadata';
|
|
22
|
+
export * from './generatedContentWidgetContentMetadata';
|
|
20
23
|
export * from './learningPathWidgetContentMetadata';
|
|
21
24
|
export * from './liveWidgetContentMetadata';
|
|
22
25
|
export * from './richTextWidgetContentMetadata';
|
|
26
|
+
export * from './roleplayWidgetContentMetadata';
|
|
23
27
|
export * from './topicWidgetContentMetadata';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RoleplayModality } from '../../roleplay';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface RoleplayWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Roleplay;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
modality: RoleplayModality;
|
|
9
|
+
link: string;
|
|
10
|
+
}
|
|
@@ -4,11 +4,13 @@ export declare enum SpotWidgetContentType {
|
|
|
4
4
|
Course = "Course",
|
|
5
5
|
Discussion = "Discussion",
|
|
6
6
|
Forum = "Forum",
|
|
7
|
+
GeneratedContent = "GeneratedContent",
|
|
7
8
|
Link = "Link",
|
|
8
9
|
Live = "Live",
|
|
9
10
|
LearningPath = "LearningPath",
|
|
10
11
|
Page = "Page",
|
|
11
12
|
RichText = "RichText",// Not yet supported on concrete widgets but only from lists of content
|
|
13
|
+
Roleplay = "Roleplay",
|
|
12
14
|
Topic = "Topic"
|
|
13
15
|
}
|
|
14
16
|
export declare function isSpotWidgetContentType(value: any): value is SpotWidgetContentType;
|
package/utils/date/types.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an `Error` passed as log context readable in text-only sinks.
|
|
3
|
+
*
|
|
4
|
+
* The browser devtools expand an `Error` (or an object holding one) on their
|
|
5
|
+
* own, but text sinks such as the Errors tab of `chrome://extensions` only
|
|
6
|
+
* call `String()` on each argument: an object prints `[object Object]`, and
|
|
7
|
+
* `JSON.stringify` prints `{}` because an Error's own fields are not
|
|
8
|
+
* enumerable. So an `Error`, directly or under the `{ data }` key the SDKs
|
|
9
|
+
* use, is turned into `<name>: <message>` (an HTTP error already carries its
|
|
10
|
+
* status and body in its message). Any other value is returned unchanged.
|
|
11
|
+
*/
|
|
12
|
+
export declare const formatLogContext: (context: unknown) => unknown;
|