@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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "MeltingSpot Core SDK",
4
4
  "homepage": "https://meltingspot.io",
5
5
  "license": "BSD-3-Clause",
6
- "version": "1.9.0",
6
+ "version": "1.10.0",
7
7
  "main": "./index.umd.js",
8
8
  "module": "./index.mjs",
9
9
  "typings": "./index.d.ts",
@@ -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,8 @@
1
+ export declare enum CoachMutePreset {
2
+ Mute30Min = "Mute30Min",
3
+ Mute1Hour = "Mute1Hour",
4
+ Mute2Hours = "Mute2Hours",
5
+ UntilTomorrow = "UntilTomorrow",
6
+ UntilNextWeek = "UntilNextWeek",
7
+ Always = "Always"
8
+ }
@@ -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
@@ -1,4 +1,5 @@
1
1
  export * from './authTokens';
2
+ export * from './coachMute';
2
3
  export * from './conversation';
3
4
  export * from './injectable';
4
5
  export * from './integrationSchema';
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum DisplayRuleTimeUnit {
2
+ Hours = "Hours",
3
+ Days = "Days",
4
+ Never = "Never"
5
+ }
@@ -1,3 +1,6 @@
1
+ export * from './displayConfig';
2
+ export * from './displayRuleTimeUnit';
1
3
  export * from './intentUserState';
2
4
  export * from './lastActionState';
3
5
  export * from './meltyIntentUserStateList';
6
+ export * from './repetitionMode';
@@ -4,4 +4,5 @@ export interface IntentUserState {
4
4
  lastActionAt: Nullable<number>;
5
5
  lastActionState: Nullable<LastActionState>;
6
6
  completionStatus: Nullable<boolean>;
7
+ lastPoppedAt: Nullable<number>;
7
8
  }
@@ -0,0 +1,6 @@
1
+ export declare enum RepetitionMode {
2
+ NoLimit = "NoLimit",
3
+ OnlyOnce = "OnlyOnce",
4
+ OncePerDays = "OncePerDays",
5
+ UntilContentCompletion = "UntilContentCompletion"
6
+ }
@@ -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
- * Set the playbook-editor active flag and broadcast the change. Idempotent —
19
- * emits the event only when the value actually flips, so SDK listeners don't
20
- * churn on repeated set calls.
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). */