@meltingspot/core 1.9.0 → 1.10.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 +22 -0
- package/api/meltingSpotApi.d.ts +6 -2
- package/index.d.ts +1 -1
- package/index.mjs +693 -661
- package/index.umd.js +4 -4
- package/package.json +1 -1
- package/playbookEditor/index.d.ts +4 -1
- package/services/api/playbook/playbook.api.output.d.ts +3 -0
- package/services/http.service.d.ts +3 -0
- package/types/coachMute/coachMutePreset.d.ts +8 -0
- package/types/coachMute/index.d.ts +1 -0
- package/types/conversation/conversationSseEvent.d.ts +8 -1
- package/types/index.d.ts +1 -0
- package/types/meltyIntent/displayConfig.d.ts +13 -0
- package/types/meltyIntent/displayRuleTimeUnit.d.ts +5 -0
- package/types/meltyIntent/index.d.ts +3 -0
- package/types/meltyIntent/intentUserState.d.ts +1 -0
- package/types/meltyIntent/repetitionMode.d.ts +6 -0
- package/utils/playbookEditor/bridge.d.ts +19 -4
package/package.json
CHANGED
|
@@ -10,5 +10,8 @@
|
|
|
10
10
|
* preview): the extension marks its own injected coach exempt from the editor
|
|
11
11
|
* pause so it survives the takeover. Same extension-only régime — writer here,
|
|
12
12
|
* reader on the public surface.
|
|
13
|
+
*
|
|
14
|
+
* `PlaybookEditorOwner` names the caller of the writer, so it ships alongside it:
|
|
15
|
+
* only the extension's own surfaces can hold the flag.
|
|
13
16
|
*/
|
|
14
|
-
export { setEditorPauseExempt, setPlaybookEditorActive, } from '../utils/playbookEditor/bridge';
|
|
17
|
+
export { PlaybookEditorOwner, setEditorPauseExempt, setPlaybookEditorActive, } from '../utils/playbookEditor/bridge';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MeltyDisplayConfig } from '../../../types/meltyIntent/displayConfig';
|
|
1
2
|
import { Nullable } from '../../../types/nullable';
|
|
2
3
|
import { WidgetContentMetadata } from '../../../types/widget/metadata';
|
|
3
4
|
import { Playbook } from '../../../types/widget/playbook/playbook';
|
|
@@ -39,6 +40,7 @@ export interface AccessiblePlaybookIntentOutput {
|
|
|
39
40
|
highlighted: boolean;
|
|
40
41
|
mode: PlaybookIntentWidgetMode;
|
|
41
42
|
widgetMetadata: WidgetContentMetadata[];
|
|
43
|
+
displayConfig?: MeltyDisplayConfig;
|
|
42
44
|
}
|
|
43
45
|
export interface ListAccessiblePlaybookIntentsOutput {
|
|
44
46
|
items: AccessiblePlaybookIntentOutput[];
|
|
@@ -48,6 +50,7 @@ export interface AccessiblePlaybookIntentCandidateOutput {
|
|
|
48
50
|
widgetId: string;
|
|
49
51
|
mode: PlaybookIntentWidgetMode;
|
|
50
52
|
widgetMetadata: WidgetContentMetadata[];
|
|
53
|
+
displayConfig?: MeltyDisplayConfig;
|
|
51
54
|
}
|
|
52
55
|
export interface AccessiblePlaybookHotspotOutput {
|
|
53
56
|
hotspotId: string;
|
|
@@ -5,6 +5,7 @@ export declare class HttpError extends Error {
|
|
|
5
5
|
constructor(code: StatusCodes, message?: string);
|
|
6
6
|
}
|
|
7
7
|
export declare enum HttpMethods {
|
|
8
|
+
DELETE = "DELETE",
|
|
8
9
|
GET = "GET",
|
|
9
10
|
PATCH = "PATCH",
|
|
10
11
|
POST = "POST"
|
|
@@ -24,11 +25,13 @@ export interface HttpPatchInput extends HttpInput {
|
|
|
24
25
|
export interface HttpPostInput extends HttpInput {
|
|
25
26
|
payload: string | object;
|
|
26
27
|
}
|
|
28
|
+
export type HttpDeleteInput = HttpInput;
|
|
27
29
|
export declare class HttpService {
|
|
28
30
|
private headers;
|
|
29
31
|
setHeaders(headers: Record<string, string>): void;
|
|
30
32
|
get<TResponse>(input: HttpGetInput): Promise<Result<TResponse, HttpError>>;
|
|
31
33
|
post<TResponse>(input: HttpPostInput): Promise<Result<TResponse, HttpError>>;
|
|
34
|
+
delete<TResponse>(input: HttpDeleteInput): Promise<Result<TResponse, HttpError>>;
|
|
32
35
|
patch<TResponse>(input: HttpPatchInput): Promise<Result<TResponse, HttpError>>;
|
|
33
36
|
private serializeQuery;
|
|
34
37
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './coachMutePreset';
|
|
@@ -3,6 +3,7 @@ import { MeltyWidgetAction } from './meltyWidgetAction';
|
|
|
3
3
|
export declare enum ConversationSseEventType {
|
|
4
4
|
Metadata = "metadata",
|
|
5
5
|
Token = "token",
|
|
6
|
+
ActionsPending = "actions_pending",
|
|
6
7
|
Action = "action",
|
|
7
8
|
Bubble = "bubble",
|
|
8
9
|
Handoff = "handoff",
|
|
@@ -22,6 +23,12 @@ export interface ConversationSseTokenEvent {
|
|
|
22
23
|
content: string;
|
|
23
24
|
};
|
|
24
25
|
}
|
|
26
|
+
export interface ConversationSseActionsPendingEvent {
|
|
27
|
+
type: ConversationSseEventType.ActionsPending;
|
|
28
|
+
data: {
|
|
29
|
+
count: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
25
32
|
export interface ConversationSseActionEvent {
|
|
26
33
|
type: ConversationSseEventType.Action;
|
|
27
34
|
data: MeltyWidgetAction;
|
|
@@ -50,4 +57,4 @@ export interface ConversationSseErrorEvent {
|
|
|
50
57
|
code: string;
|
|
51
58
|
};
|
|
52
59
|
}
|
|
53
|
-
export type ConversationSseEvent = ConversationSseMetadataEvent | ConversationSseTokenEvent | ConversationSseActionEvent | ConversationSseBubbleEvent | ConversationSseHandoffEvent | ConversationSseDoneEvent | ConversationSseErrorEvent;
|
|
60
|
+
export type ConversationSseEvent = ConversationSseMetadataEvent | ConversationSseTokenEvent | ConversationSseActionsPendingEvent | ConversationSseActionEvent | ConversationSseBubbleEvent | ConversationSseHandoffEvent | ConversationSseDoneEvent | ConversationSseErrorEvent;
|
package/types/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Nullable } from '../nullable';
|
|
2
|
+
import { DisplayRuleTimeUnit } from './displayRuleTimeUnit';
|
|
3
|
+
import { RepetitionMode } from './repetitionMode';
|
|
4
|
+
export interface DisplayRuleTimer {
|
|
5
|
+
value: Nullable<number>;
|
|
6
|
+
unit: DisplayRuleTimeUnit;
|
|
7
|
+
}
|
|
8
|
+
export interface MeltyDisplayConfig {
|
|
9
|
+
repetitionMode: RepetitionMode;
|
|
10
|
+
later: DisplayRuleTimer;
|
|
11
|
+
closeA: DisplayRuleTimer;
|
|
12
|
+
closeB: DisplayRuleTimer;
|
|
13
|
+
}
|
|
@@ -12,14 +12,29 @@ export declare const PLAYBOOK_EDITOR_ACTIVE_EVENT = "meltingspot:playbook-editor
|
|
|
12
12
|
export interface PlaybookEditorActiveEventDetail {
|
|
13
13
|
active: boolean;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* The extension surfaces that can pause the host page's coach. Each one claims
|
|
17
|
+
* and releases its own slot, so neither can drop the other's takeover (COM-9539:
|
|
18
|
+
* the edit-mode content script released a flag the preview owned).
|
|
19
|
+
*/
|
|
20
|
+
export declare enum PlaybookEditorOwner {
|
|
21
|
+
EditMode = "edit-mode",
|
|
22
|
+
Preview = "preview"
|
|
23
|
+
}
|
|
15
24
|
/** Read the current playbook-editor active flag. */
|
|
16
25
|
export declare const isPlaybookEditorActive: () => boolean;
|
|
17
26
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
27
|
+
* Claim (`active: true`) or release (`active: false`) the playbook-editor flag on
|
|
28
|
+
* behalf of ONE owner, then broadcast the change.
|
|
29
|
+
*
|
|
30
|
+
* The flag is derived from the owner set, not written directly: it stays up while
|
|
31
|
+
* ANY owner still holds it. Releasing an owner that never claimed is a safe no-op,
|
|
32
|
+
* which the error and teardown paths rely on.
|
|
33
|
+
*
|
|
34
|
+
* Idempotent — emits the event only when the effective value flips, so SDK
|
|
35
|
+
* listeners don't churn on repeated calls.
|
|
21
36
|
*/
|
|
22
|
-
export declare const setPlaybookEditorActive: (active: boolean) => void;
|
|
37
|
+
export declare const setPlaybookEditorActive: (active: boolean, owner: PlaybookEditorOwner) => void;
|
|
23
38
|
/** Read whether this realm's Coach is exempt from the editor pause. */
|
|
24
39
|
export declare const isEditorPauseExempt: () => boolean;
|
|
25
40
|
/** Set this realm's editor-pause exemption (extension-only, via the sub-path). */
|