@callimacus/thamyr-core 4.17.3 → 4.19.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.
@@ -920,6 +920,23 @@ type ChapterOutput = {
920
920
  */
921
921
  type: string;
922
922
  }>;
923
+ /**
924
+ * Blocks this round did not send because one of their contents failed. For the site's developer: log them, never render them. The reason stays server-side; `callimacus thamyr probe` shows it.
925
+ */
926
+ warnings?: Array<{
927
+ /**
928
+ * The key of the block that was not sent.
929
+ */
930
+ block: string;
931
+ /**
932
+ * The id of its content that failed.
933
+ */
934
+ content: string;
935
+ /**
936
+ * `shortfall`: the content found fewer items than its `minItems` and its `onShort` is `fail`. `error`: anything else threw.
937
+ */
938
+ cause: 'shortfall' | 'error';
939
+ }>;
923
940
  status: ChapterStatus$1;
924
941
  };
925
942
  type CreateRoundContextOutput = {
@@ -3935,6 +3952,94 @@ type TtsAudio = {
3935
3952
  */
3936
3953
  declare function extractTtsAudio(data: unknown): TtsAudio | undefined;
3937
3954
 
3955
+ type CreateRoundPayload = InteractionPayloadMap[UserInteractionType.CREATE_ROUND];
3956
+ /**
3957
+ The landing value blocks and conditions read (`{{input.value}}`); the server caps it at 200 characters.
3958
+ */
3959
+ declare const LANDING_VALUE_MAX_LENGTH = 200;
3960
+ /**
3961
+ The `create-round` payload that opens the landing page: a round with no message,
3962
+ composed from the tenant's landing configuration.
3963
+ @param value - Optional landing value — a page slug, a campaign, whatever the
3964
+ tenant's landing blocks were written to read.
3965
+ @param options - The story to continue and the language to compose in.
3966
+ */
3967
+ declare function landingRound(value?: string, options?: RoundOptions): CreateRoundPayload;
3968
+ /**
3969
+ The `create-round` payload for a declared interaction. Blocks answer it by
3970
+ naming the id in their condition; the block key it carries lets a block whose
3971
+ `patchOn` names the interaction be patched in place.
3972
+ */
3973
+ declare function interactionRound<I extends InteractionId>(id: I, options?: InteractionOptions<I>): CreateRoundPayload;
3974
+ /**
3975
+ The receptor labels the classifier assigned a round — the per-message
3976
+ classification, not the session intent. Reads `receptors`, falling back to the
3977
+ `intent` name servers used before the rename (kept one release as an alias).
3978
+ */
3979
+ declare function receptorsOf(chapter: Pick<Chapter, 'receptors' | 'intent'>): string[];
3980
+ /**
3981
+ A block's key — the identity everything attributes, pins and links by. `type`
3982
+ is a render hint two blocks may share. Only custom blocks carry one, and only
3983
+ on rounds recorded since keys travel on the wire.
3984
+ */
3985
+ declare function blockKeyOf(block: Block): string | undefined;
3986
+ /**
3987
+ The block the flow emits when adding to cart needs the visitor to pick a size.
3988
+ */
3989
+ declare const ADD_TO_CART_RESULT_BLOCK = "custom:addToCartResult";
3990
+ /**
3991
+ How an add-to-cart request resolved; the flow attaches it to every block of the round as `data.addToCart`.
3992
+ */
3993
+ type AddToCartResult = {
3994
+ status: 'resolved';
3995
+ variantId: string;
3996
+ productName: string;
3997
+ size: string;
3998
+ } | {
3999
+ status: 'size_selection_needed';
4000
+ productSku: string;
4001
+ productName: string;
4002
+ availableSizes: Array<{
4003
+ size: string;
4004
+ variantId: string;
4005
+ orderable: boolean;
4006
+ }>;
4007
+ } | {
4008
+ status: 'error';
4009
+ };
4010
+ /**
4011
+ The add-to-cart result a block carries, when the round resolved one.
4012
+
4013
+ Every field is checked, not only the status: the block's data is whatever the round
4014
+ put there, and a half-written result would otherwise reach a caller as a complete one
4015
+ — with `undefined` where the type promises a string.
4016
+ */
4017
+ declare function addToCartResultOf(block: {
4018
+ data?: unknown;
4019
+ }): AddToCartResult | undefined;
4020
+ /**
4021
+ The round with a `block-patch` applied, as the server stored it: `values`,
4022
+ `inputs` and `textRuns` merged into the animation at `contentId` (a dotted path
4023
+ into `block.data`), everything else left as it was. Returns `chapter` itself
4024
+ when the patch is for another round, a block it does not show, or a place that
4025
+ holds no animation, so a caller can tell nothing changed.
4026
+
4027
+ `fire` is not written: triggers play once, when the patch arrives, and
4028
+ keeping them would replay them on every render and reload.
4029
+ */
4030
+ declare function applyBlockPatch(chapter: Chapter, patch: BlockPatch): Chapter;
4031
+ /**
4032
+ A block the round did not send because one of its contents failed: its key, the content's id, and
4033
+ `shortfall` (fewer items than `minItems` under `onShort: "fail"`) or `error`. The reason stays
4034
+ server-side; `callimacus thamyr probe` shows it.
4035
+ */
4036
+ type RoundWarning = NonNullable<Chapter['warnings']>[number];
4037
+ /**
4038
+ The round's warnings not reported yet. A round is re-sent on every streamed chunk, so each warning
4039
+ arrives many times; `reported` remembers which were already handed on.
4040
+ */
4041
+ declare function newRoundWarnings(chapter: Pick<Chapter, 'id' | 'warnings'>, reported: Set<string>): RoundWarning[];
4042
+
3938
4043
  /**
3939
4044
  The error surface hosts subscribe to via `onError`: server `error`-channel
3940
4045
  messages plus terminal connection refusals. `reason` is present only on
@@ -3951,11 +4056,14 @@ type CallimacusErrorMessage = ErrorMessage;
3951
4056
  type ServerResponseCallback<T = ThamyrResponse> = (response: T) => void;
3952
4057
  type ConnectionStatusCallback = (isConnected: boolean) => void;
3953
4058
  type ErrorCallback = (error: CallimacusErrorMessage) => void;
4059
+ type WarningCallback = (warning: RoundWarning) => void;
3954
4060
  declare class CallimacusService {
3955
4061
  private socket?;
3956
4062
  private readonly serverResponseListeners;
3957
4063
  private readonly connectionStatusListeners;
3958
4064
  private readonly errorListeners;
4065
+ private readonly warningListeners;
4066
+ private readonly reportedWarnings;
3959
4067
  private uiObserver?;
3960
4068
  private uiObserverConfig;
3961
4069
  private handshakeRetryAttempts;
@@ -3989,6 +4097,11 @@ declare class CallimacusService {
3989
4097
  @param error - The error to notify listeners about
3990
4098
  */
3991
4099
  private notifyErrorListeners;
4100
+ /**
4101
+ Hands each new round warning to the warning listeners. With none registered, the SDK's logger
4102
+ reports it, so a developer who turned the logger on still sees it.
4103
+ */
4104
+ private notifyWarningListeners;
3992
4105
  /**
3993
4106
  Retrieves the user's current geolocation coordinates.
3994
4107
 
@@ -4076,86 +4189,18 @@ declare class CallimacusService {
4076
4189
  @returns Unsubscribe function to remove the listener
4077
4190
  */
4078
4191
  onError(callback: ErrorCallback): () => void;
4192
+ /**
4193
+ Registers a callback for blocks a round did not send because one of their contents failed. Each
4194
+ warning is delivered once, however often the round is re-sent. For the site's developer: log it or
4195
+ forward it to monitoring; never render it. Registering one replaces the default logger warning.
4196
+
4197
+ @param callback - Function to call with each new warning
4198
+ @returns Unsubscribe function to remove the listener
4199
+ */
4200
+ onWarning(callback: WarningCallback): () => void;
4079
4201
  }
4080
4202
  declare const callimacusService: CallimacusService;
4081
4203
 
4082
- type CreateRoundPayload = InteractionPayloadMap[UserInteractionType.CREATE_ROUND];
4083
- /**
4084
- The landing value blocks and conditions read (`{{input.value}}`); the server caps it at 200 characters.
4085
- */
4086
- declare const LANDING_VALUE_MAX_LENGTH = 200;
4087
- /**
4088
- The `create-round` payload that opens the landing page: a round with no message,
4089
- composed from the tenant's landing configuration.
4090
- @param value - Optional landing value — a page slug, a campaign, whatever the
4091
- tenant's landing blocks were written to read.
4092
- @param options - The story to continue and the language to compose in.
4093
- */
4094
- declare function landingRound(value?: string, options?: RoundOptions): CreateRoundPayload;
4095
- /**
4096
- The `create-round` payload for a declared interaction. Blocks answer it by
4097
- naming the id in their condition; the block key it carries lets a block whose
4098
- `patchOn` names the interaction be patched in place.
4099
- */
4100
- declare function interactionRound<I extends InteractionId>(id: I, options?: InteractionOptions<I>): CreateRoundPayload;
4101
- /**
4102
- The receptor labels the classifier assigned a round — the per-message
4103
- classification, not the session intent. Reads `receptors`, falling back to the
4104
- `intent` name servers used before the rename (kept one release as an alias).
4105
- */
4106
- declare function receptorsOf(chapter: Pick<Chapter, 'receptors' | 'intent'>): string[];
4107
- /**
4108
- A block's key — the identity everything attributes, pins and links by. `type`
4109
- is a render hint two blocks may share. Only custom blocks carry one, and only
4110
- on rounds recorded since keys travel on the wire.
4111
- */
4112
- declare function blockKeyOf(block: Block): string | undefined;
4113
- /**
4114
- The block the flow emits when adding to cart needs the visitor to pick a size.
4115
- */
4116
- declare const ADD_TO_CART_RESULT_BLOCK = "custom:addToCartResult";
4117
- /**
4118
- How an add-to-cart request resolved; the flow attaches it to every block of the round as `data.addToCart`.
4119
- */
4120
- type AddToCartResult = {
4121
- status: 'resolved';
4122
- variantId: string;
4123
- productName: string;
4124
- size: string;
4125
- } | {
4126
- status: 'size_selection_needed';
4127
- productSku: string;
4128
- productName: string;
4129
- availableSizes: Array<{
4130
- size: string;
4131
- variantId: string;
4132
- orderable: boolean;
4133
- }>;
4134
- } | {
4135
- status: 'error';
4136
- };
4137
- /**
4138
- The add-to-cart result a block carries, when the round resolved one.
4139
-
4140
- Every field is checked, not only the status: the block's data is whatever the round
4141
- put there, and a half-written result would otherwise reach a caller as a complete one
4142
- — with `undefined` where the type promises a string.
4143
- */
4144
- declare function addToCartResultOf(block: {
4145
- data?: unknown;
4146
- }): AddToCartResult | undefined;
4147
- /**
4148
- The round with a `block-patch` applied, as the server stored it: `values`,
4149
- `inputs` and `textRuns` merged into the animation at `contentId` (a dotted path
4150
- into `block.data`), everything else left as it was. Returns `chapter` itself
4151
- when the patch is for another round, a block it does not show, or a place that
4152
- holds no animation, so a caller can tell nothing changed.
4153
-
4154
- `fire` is not written: triggers play once, when the patch arrives, and
4155
- keeping them would replay them on every render and reload.
4156
- */
4157
- declare function applyBlockPatch(chapter: Chapter, patch: BlockPatch): Chapter;
4158
-
4159
4204
  type ContractClient = Client;
4160
4205
  /**
4161
4206
  What a contract call rejects with under `{throwOnError: true}`.
@@ -4875,5 +4920,5 @@ declare function transformImageUrl(cdnUrl: string, edits: ImageEdits): string;
4875
4920
  */
4876
4921
  declare function randomUuid(): string;
4877
4922
 
4878
- export { ACTION_TYPES, ADD_TO_CART_RESULT_BLOCK, CallimacusApi, CallimacusEvent, CallimacusService, ChapterStatus, ClientEvents, DELIVER_RESULT_BLOCK, GalleryMode, LANDING_VALUE_MAX_LENGTH, MAX_HANDSHAKE_RETRIES, SLInputEventType, STOREFRONT_API_VERSION, ServerEvents, ThamyrHttpError, ThamyrResponseType, UserInteractionType, actionOf, addToCartResultOf, applyBlockPatch, blockKeyOf, callimacusService, cartSettingsFor, classifyConnectError, createContractClient, createPageStorage, createShopifyCart, createWooCommerceCart, deliverResultOf, extractTtsAudio, fieldsOf, interactionRound, isCustomBlock, isMasterProduct, isSetProduct, isVariantGid, landingRound, leaseLock, logger, mergeShopifySettings, parseConnectRejection, parseMapPath, randomUuid, readShopifySettings, receptorsOf, resolveMapPage, shouldRetryHandshake, transformImageUrl, webLocks };
4879
- export type { Action, ActionType, AddToCartResult, BCProduct, Basket, Block, BlockPatch, BoundingBox, CallimacusErrorMessage, CartCommand, CartLock, CartStorage, Chapter, ClientInfo, ConnectRejection, ConnectionStatusCallback, ContractClient, CustomBlock, DeliverResult, DocumentIndexEntry, ErrorCallback, ErrorMessage, Gallery, GenericProduct, HomePage, Image, ImageEdits, ImageFormatEdit, ImageResizeEdit, InteractionContext, InteractionId, InteractionOptions, InteractionPayload, InteractionPayloadMap, LegacyBlock, LocalizedEPArtwork, LocalizedEPChapter, LogLevel, LoggerConfig, MapPage, MapPath, MasterProduct, MasterProductWithVariationGroup, OptionItem, ProductItem, ProductMatch, RecommendationsResponse, RiveManifest, RoundOptions, SLDocument, SLDocumentSection, SLInputEvent, ServerResponseCallback, SetProduct, ShopifyCart, ShopifyCartClient, ShopifyCartClientOptions, ShopifyCartError, ShopifyCartErrorCode, ShopifyCartLine, ShopifyCartResult, ShopifyCartSettings, ShopifyCartWarning, ShopifyConfig, ShopifyMoney, ShopifySettings, ShopifyStorefront, ShopifyUserError, SkesisItem, SkesisItemPage, SkesisRelatedResponse, SkesisSimilarResponse, Story, SuggestPayload, Suggestions, ThamyrInteractionMap, ThamyrResponse, Topic, TopicContentsPage, TopicSummary, TtsAudio, UiElement, UiObserverConfig, UiSnapshot, UserInteraction, Variant, VariationAttribute, VariationGroup, Video, WhisperPayload, WooCommerceCart, WooCommerceCartClient, WooCommerceCartClientOptions, WooCommerceCartError, WooCommerceCartErrorCode, WooCommerceCartItem, WooCommerceCartResult, WooCommerceMoney, WooCommerceStart };
4923
+ export { ACTION_TYPES, ADD_TO_CART_RESULT_BLOCK, CallimacusApi, CallimacusEvent, CallimacusService, ChapterStatus, ClientEvents, DELIVER_RESULT_BLOCK, GalleryMode, LANDING_VALUE_MAX_LENGTH, MAX_HANDSHAKE_RETRIES, SLInputEventType, STOREFRONT_API_VERSION, ServerEvents, ThamyrHttpError, ThamyrResponseType, UserInteractionType, actionOf, addToCartResultOf, applyBlockPatch, blockKeyOf, callimacusService, cartSettingsFor, classifyConnectError, createContractClient, createPageStorage, createShopifyCart, createWooCommerceCart, deliverResultOf, extractTtsAudio, fieldsOf, interactionRound, isCustomBlock, isMasterProduct, isSetProduct, isVariantGid, landingRound, leaseLock, logger, mergeShopifySettings, newRoundWarnings, parseConnectRejection, parseMapPath, randomUuid, readShopifySettings, receptorsOf, resolveMapPage, shouldRetryHandshake, transformImageUrl, webLocks };
4924
+ export type { Action, ActionType, AddToCartResult, BCProduct, Basket, Block, BlockPatch, BoundingBox, CallimacusErrorMessage, CartCommand, CartLock, CartStorage, Chapter, ClientInfo, ConnectRejection, ConnectionStatusCallback, ContractClient, CustomBlock, DeliverResult, DocumentIndexEntry, ErrorCallback, ErrorMessage, Gallery, GenericProduct, HomePage, Image, ImageEdits, ImageFormatEdit, ImageResizeEdit, InteractionContext, InteractionId, InteractionOptions, InteractionPayload, InteractionPayloadMap, LegacyBlock, LocalizedEPArtwork, LocalizedEPChapter, LogLevel, LoggerConfig, MapPage, MapPath, MasterProduct, MasterProductWithVariationGroup, OptionItem, ProductItem, ProductMatch, RecommendationsResponse, RiveManifest, RoundOptions, RoundWarning, SLDocument, SLDocumentSection, SLInputEvent, ServerResponseCallback, SetProduct, ShopifyCart, ShopifyCartClient, ShopifyCartClientOptions, ShopifyCartError, ShopifyCartErrorCode, ShopifyCartLine, ShopifyCartResult, ShopifyCartSettings, ShopifyCartWarning, ShopifyConfig, ShopifyMoney, ShopifySettings, ShopifyStorefront, ShopifyUserError, SkesisItem, SkesisItemPage, SkesisRelatedResponse, SkesisSimilarResponse, Story, SuggestPayload, Suggestions, ThamyrInteractionMap, ThamyrResponse, Topic, TopicContentsPage, TopicSummary, TtsAudio, UiElement, UiObserverConfig, UiSnapshot, UserInteraction, Variant, VariationAttribute, VariationGroup, Video, WarningCallback, WhisperPayload, WooCommerceCart, WooCommerceCartClient, WooCommerceCartClientOptions, WooCommerceCartError, WooCommerceCartErrorCode, WooCommerceCartItem, WooCommerceCartResult, WooCommerceMoney, WooCommerceStart };
@@ -918,6 +918,23 @@ type ChapterOutput = {
918
918
  */
919
919
  type: string;
920
920
  }>;
921
+ /**
922
+ * Blocks this round did not send because one of their contents failed. For the site's developer: log them, never render them. The reason stays server-side; `callimacus thamyr probe` shows it.
923
+ */
924
+ warnings?: Array<{
925
+ /**
926
+ * The key of the block that was not sent.
927
+ */
928
+ block: string;
929
+ /**
930
+ * The id of its content that failed.
931
+ */
932
+ content: string;
933
+ /**
934
+ * `shortfall`: the content found fewer items than its `minItems` and its `onShort` is `fail`. `error`: anything else threw.
935
+ */
936
+ cause: 'shortfall' | 'error';
937
+ }>;
921
938
  status: ChapterStatus$1;
922
939
  };
923
940
  type CreateRoundContextOutput = {
@@ -3933,6 +3950,94 @@ type TtsAudio = {
3933
3950
  */
3934
3951
  declare function extractTtsAudio(data: unknown): TtsAudio | undefined;
3935
3952
 
3953
+ type CreateRoundPayload = InteractionPayloadMap[UserInteractionType.CREATE_ROUND];
3954
+ /**
3955
+ The landing value blocks and conditions read (`{{input.value}}`); the server caps it at 200 characters.
3956
+ */
3957
+ declare const LANDING_VALUE_MAX_LENGTH = 200;
3958
+ /**
3959
+ The `create-round` payload that opens the landing page: a round with no message,
3960
+ composed from the tenant's landing configuration.
3961
+ @param value - Optional landing value — a page slug, a campaign, whatever the
3962
+ tenant's landing blocks were written to read.
3963
+ @param options - The story to continue and the language to compose in.
3964
+ */
3965
+ declare function landingRound(value?: string, options?: RoundOptions): CreateRoundPayload;
3966
+ /**
3967
+ The `create-round` payload for a declared interaction. Blocks answer it by
3968
+ naming the id in their condition; the block key it carries lets a block whose
3969
+ `patchOn` names the interaction be patched in place.
3970
+ */
3971
+ declare function interactionRound<I extends InteractionId>(id: I, options?: InteractionOptions<I>): CreateRoundPayload;
3972
+ /**
3973
+ The receptor labels the classifier assigned a round — the per-message
3974
+ classification, not the session intent. Reads `receptors`, falling back to the
3975
+ `intent` name servers used before the rename (kept one release as an alias).
3976
+ */
3977
+ declare function receptorsOf(chapter: Pick<Chapter, 'receptors' | 'intent'>): string[];
3978
+ /**
3979
+ A block's key — the identity everything attributes, pins and links by. `type`
3980
+ is a render hint two blocks may share. Only custom blocks carry one, and only
3981
+ on rounds recorded since keys travel on the wire.
3982
+ */
3983
+ declare function blockKeyOf(block: Block): string | undefined;
3984
+ /**
3985
+ The block the flow emits when adding to cart needs the visitor to pick a size.
3986
+ */
3987
+ declare const ADD_TO_CART_RESULT_BLOCK = "custom:addToCartResult";
3988
+ /**
3989
+ How an add-to-cart request resolved; the flow attaches it to every block of the round as `data.addToCart`.
3990
+ */
3991
+ type AddToCartResult = {
3992
+ status: 'resolved';
3993
+ variantId: string;
3994
+ productName: string;
3995
+ size: string;
3996
+ } | {
3997
+ status: 'size_selection_needed';
3998
+ productSku: string;
3999
+ productName: string;
4000
+ availableSizes: Array<{
4001
+ size: string;
4002
+ variantId: string;
4003
+ orderable: boolean;
4004
+ }>;
4005
+ } | {
4006
+ status: 'error';
4007
+ };
4008
+ /**
4009
+ The add-to-cart result a block carries, when the round resolved one.
4010
+
4011
+ Every field is checked, not only the status: the block's data is whatever the round
4012
+ put there, and a half-written result would otherwise reach a caller as a complete one
4013
+ — with `undefined` where the type promises a string.
4014
+ */
4015
+ declare function addToCartResultOf(block: {
4016
+ data?: unknown;
4017
+ }): AddToCartResult | undefined;
4018
+ /**
4019
+ The round with a `block-patch` applied, as the server stored it: `values`,
4020
+ `inputs` and `textRuns` merged into the animation at `contentId` (a dotted path
4021
+ into `block.data`), everything else left as it was. Returns `chapter` itself
4022
+ when the patch is for another round, a block it does not show, or a place that
4023
+ holds no animation, so a caller can tell nothing changed.
4024
+
4025
+ `fire` is not written: triggers play once, when the patch arrives, and
4026
+ keeping them would replay them on every render and reload.
4027
+ */
4028
+ declare function applyBlockPatch(chapter: Chapter, patch: BlockPatch): Chapter;
4029
+ /**
4030
+ A block the round did not send because one of its contents failed: its key, the content's id, and
4031
+ `shortfall` (fewer items than `minItems` under `onShort: "fail"`) or `error`. The reason stays
4032
+ server-side; `callimacus thamyr probe` shows it.
4033
+ */
4034
+ type RoundWarning = NonNullable<Chapter['warnings']>[number];
4035
+ /**
4036
+ The round's warnings not reported yet. A round is re-sent on every streamed chunk, so each warning
4037
+ arrives many times; `reported` remembers which were already handed on.
4038
+ */
4039
+ declare function newRoundWarnings(chapter: Pick<Chapter, 'id' | 'warnings'>, reported: Set<string>): RoundWarning[];
4040
+
3936
4041
  /**
3937
4042
  The error surface hosts subscribe to via `onError`: server `error`-channel
3938
4043
  messages plus terminal connection refusals. `reason` is present only on
@@ -3949,11 +4054,14 @@ type CallimacusErrorMessage = ErrorMessage;
3949
4054
  type ServerResponseCallback<T = ThamyrResponse> = (response: T) => void;
3950
4055
  type ConnectionStatusCallback = (isConnected: boolean) => void;
3951
4056
  type ErrorCallback = (error: CallimacusErrorMessage) => void;
4057
+ type WarningCallback = (warning: RoundWarning) => void;
3952
4058
  declare class CallimacusService {
3953
4059
  private socket?;
3954
4060
  private readonly serverResponseListeners;
3955
4061
  private readonly connectionStatusListeners;
3956
4062
  private readonly errorListeners;
4063
+ private readonly warningListeners;
4064
+ private readonly reportedWarnings;
3957
4065
  private uiObserver?;
3958
4066
  private uiObserverConfig;
3959
4067
  private handshakeRetryAttempts;
@@ -3987,6 +4095,11 @@ declare class CallimacusService {
3987
4095
  @param error - The error to notify listeners about
3988
4096
  */
3989
4097
  private notifyErrorListeners;
4098
+ /**
4099
+ Hands each new round warning to the warning listeners. With none registered, the SDK's logger
4100
+ reports it, so a developer who turned the logger on still sees it.
4101
+ */
4102
+ private notifyWarningListeners;
3990
4103
  /**
3991
4104
  Retrieves the user's current geolocation coordinates.
3992
4105
 
@@ -4074,86 +4187,18 @@ declare class CallimacusService {
4074
4187
  @returns Unsubscribe function to remove the listener
4075
4188
  */
4076
4189
  onError(callback: ErrorCallback): () => void;
4190
+ /**
4191
+ Registers a callback for blocks a round did not send because one of their contents failed. Each
4192
+ warning is delivered once, however often the round is re-sent. For the site's developer: log it or
4193
+ forward it to monitoring; never render it. Registering one replaces the default logger warning.
4194
+
4195
+ @param callback - Function to call with each new warning
4196
+ @returns Unsubscribe function to remove the listener
4197
+ */
4198
+ onWarning(callback: WarningCallback): () => void;
4077
4199
  }
4078
4200
  declare const callimacusService: CallimacusService;
4079
4201
 
4080
- type CreateRoundPayload = InteractionPayloadMap[UserInteractionType.CREATE_ROUND];
4081
- /**
4082
- The landing value blocks and conditions read (`{{input.value}}`); the server caps it at 200 characters.
4083
- */
4084
- declare const LANDING_VALUE_MAX_LENGTH = 200;
4085
- /**
4086
- The `create-round` payload that opens the landing page: a round with no message,
4087
- composed from the tenant's landing configuration.
4088
- @param value - Optional landing value — a page slug, a campaign, whatever the
4089
- tenant's landing blocks were written to read.
4090
- @param options - The story to continue and the language to compose in.
4091
- */
4092
- declare function landingRound(value?: string, options?: RoundOptions): CreateRoundPayload;
4093
- /**
4094
- The `create-round` payload for a declared interaction. Blocks answer it by
4095
- naming the id in their condition; the block key it carries lets a block whose
4096
- `patchOn` names the interaction be patched in place.
4097
- */
4098
- declare function interactionRound<I extends InteractionId>(id: I, options?: InteractionOptions<I>): CreateRoundPayload;
4099
- /**
4100
- The receptor labels the classifier assigned a round — the per-message
4101
- classification, not the session intent. Reads `receptors`, falling back to the
4102
- `intent` name servers used before the rename (kept one release as an alias).
4103
- */
4104
- declare function receptorsOf(chapter: Pick<Chapter, 'receptors' | 'intent'>): string[];
4105
- /**
4106
- A block's key — the identity everything attributes, pins and links by. `type`
4107
- is a render hint two blocks may share. Only custom blocks carry one, and only
4108
- on rounds recorded since keys travel on the wire.
4109
- */
4110
- declare function blockKeyOf(block: Block): string | undefined;
4111
- /**
4112
- The block the flow emits when adding to cart needs the visitor to pick a size.
4113
- */
4114
- declare const ADD_TO_CART_RESULT_BLOCK = "custom:addToCartResult";
4115
- /**
4116
- How an add-to-cart request resolved; the flow attaches it to every block of the round as `data.addToCart`.
4117
- */
4118
- type AddToCartResult = {
4119
- status: 'resolved';
4120
- variantId: string;
4121
- productName: string;
4122
- size: string;
4123
- } | {
4124
- status: 'size_selection_needed';
4125
- productSku: string;
4126
- productName: string;
4127
- availableSizes: Array<{
4128
- size: string;
4129
- variantId: string;
4130
- orderable: boolean;
4131
- }>;
4132
- } | {
4133
- status: 'error';
4134
- };
4135
- /**
4136
- The add-to-cart result a block carries, when the round resolved one.
4137
-
4138
- Every field is checked, not only the status: the block's data is whatever the round
4139
- put there, and a half-written result would otherwise reach a caller as a complete one
4140
- — with `undefined` where the type promises a string.
4141
- */
4142
- declare function addToCartResultOf(block: {
4143
- data?: unknown;
4144
- }): AddToCartResult | undefined;
4145
- /**
4146
- The round with a `block-patch` applied, as the server stored it: `values`,
4147
- `inputs` and `textRuns` merged into the animation at `contentId` (a dotted path
4148
- into `block.data`), everything else left as it was. Returns `chapter` itself
4149
- when the patch is for another round, a block it does not show, or a place that
4150
- holds no animation, so a caller can tell nothing changed.
4151
-
4152
- `fire` is not written: triggers play once, when the patch arrives, and
4153
- keeping them would replay them on every render and reload.
4154
- */
4155
- declare function applyBlockPatch(chapter: Chapter, patch: BlockPatch): Chapter;
4156
-
4157
4202
  type ContractClient = Client;
4158
4203
  /**
4159
4204
  What a contract call rejects with under `{throwOnError: true}`.
@@ -4935,5 +4980,5 @@ declare function ensureIntentSessionId(): void;
4935
4980
  declare function clearIntentSessionId(): void;
4936
4981
  declare function setIntentSessionMaxAge(_seconds: number): void;
4937
4982
 
4938
- export { ACTION_TYPES, ADD_TO_CART_RESULT_BLOCK, CallimacusApi, CallimacusEvent, CallimacusService, ChapterStatus, ClientEvents, DELIVER_RESULT_BLOCK, GalleryMode, LANDING_VALUE_MAX_LENGTH, MAX_HANDSHAKE_RETRIES, SLInputEventType, STOREFRONT_API_VERSION, ServerEvents, ThamyrHttpError, ThamyrResponseType, UserInteractionType, actionOf, addToCartResultOf, applyBlockPatch, blockKeyOf, callimacusService, cartSettingsFor, classifyConnectError, clearIntentSessionId, createContractClient, createPageStorage, createShopifyCart, createWooCommerceCart, deliverResultOf, ensureIntentSessionId, extractTtsAudio, fieldsOf, getIntentSessionId, initIntent, interactionRound, isCustomBlock, isMasterProduct, isSetProduct, isVariantGid, landingRound, leaseLock, logger, mergeShopifySettings, parseConnectRejection, parseMapPath, randomUuid, readShopifySettings, receptorsOf, resolveMapPage, setConsent, setDebug, setDebugPanel, setGeo, setIntentSessionMaxAge, shouldRetryHandshake, transformImageUrl, webLocks };
4939
- export type { Action, ActionType, AddToCartResult, BCProduct, Basket, Block, BlockPatch, BoundingBox, CallimacusErrorMessage, CartCommand, CartLock, CartStorage, Chapter, ClientInfo, ConnectRejection, ConnectionStatusCallback, ContractClient, CustomBlock, DeliverResult, DocumentIndexEntry, ErrorCallback, ErrorMessage, Gallery, GenericProduct, HomePage, Image, ImageEdits, ImageFormatEdit, ImageResizeEdit, InitOptions, InteractionContext, InteractionId, InteractionOptions, InteractionPayload, InteractionPayloadMap, LegacyBlock, LocalizedEPArtwork, LocalizedEPChapter, LogLevel, LoggerConfig, MapPage, MapPath, MasterProduct, MasterProductWithVariationGroup, OptionItem, ProductItem, ProductMatch, RecommendationsResponse, RiveManifest, RoundOptions, SLDocument, SLDocumentSection, SLInputEvent, ServerResponseCallback, SetProduct, ShopifyCart, ShopifyCartClient, ShopifyCartClientOptions, ShopifyCartError, ShopifyCartErrorCode, ShopifyCartLine, ShopifyCartResult, ShopifyCartSettings, ShopifyCartWarning, ShopifyConfig, ShopifyMoney, ShopifySettings, ShopifyStorefront, ShopifyUserError, SkesisItem, SkesisItemPage, SkesisRelatedResponse, SkesisSimilarResponse, Story, SuggestPayload, Suggestions, ThamyrInteractionMap, ThamyrResponse, Topic, TopicContentsPage, TopicSummary, TtsAudio, UiElement, UiObserverConfig, UiSnapshot, UserInteraction, Variant, VariationAttribute, VariationGroup, Video, WhisperPayload, WooCommerceCart, WooCommerceCartClient, WooCommerceCartClientOptions, WooCommerceCartError, WooCommerceCartErrorCode, WooCommerceCartItem, WooCommerceCartResult, WooCommerceMoney, WooCommerceStart };
4983
+ export { ACTION_TYPES, ADD_TO_CART_RESULT_BLOCK, CallimacusApi, CallimacusEvent, CallimacusService, ChapterStatus, ClientEvents, DELIVER_RESULT_BLOCK, GalleryMode, LANDING_VALUE_MAX_LENGTH, MAX_HANDSHAKE_RETRIES, SLInputEventType, STOREFRONT_API_VERSION, ServerEvents, ThamyrHttpError, ThamyrResponseType, UserInteractionType, actionOf, addToCartResultOf, applyBlockPatch, blockKeyOf, callimacusService, cartSettingsFor, classifyConnectError, clearIntentSessionId, createContractClient, createPageStorage, createShopifyCart, createWooCommerceCart, deliverResultOf, ensureIntentSessionId, extractTtsAudio, fieldsOf, getIntentSessionId, initIntent, interactionRound, isCustomBlock, isMasterProduct, isSetProduct, isVariantGid, landingRound, leaseLock, logger, mergeShopifySettings, newRoundWarnings, parseConnectRejection, parseMapPath, randomUuid, readShopifySettings, receptorsOf, resolveMapPage, setConsent, setDebug, setDebugPanel, setGeo, setIntentSessionMaxAge, shouldRetryHandshake, transformImageUrl, webLocks };
4984
+ export type { Action, ActionType, AddToCartResult, BCProduct, Basket, Block, BlockPatch, BoundingBox, CallimacusErrorMessage, CartCommand, CartLock, CartStorage, Chapter, ClientInfo, ConnectRejection, ConnectionStatusCallback, ContractClient, CustomBlock, DeliverResult, DocumentIndexEntry, ErrorCallback, ErrorMessage, Gallery, GenericProduct, HomePage, Image, ImageEdits, ImageFormatEdit, ImageResizeEdit, InitOptions, InteractionContext, InteractionId, InteractionOptions, InteractionPayload, InteractionPayloadMap, LegacyBlock, LocalizedEPArtwork, LocalizedEPChapter, LogLevel, LoggerConfig, MapPage, MapPath, MasterProduct, MasterProductWithVariationGroup, OptionItem, ProductItem, ProductMatch, RecommendationsResponse, RiveManifest, RoundOptions, RoundWarning, SLDocument, SLDocumentSection, SLInputEvent, ServerResponseCallback, SetProduct, ShopifyCart, ShopifyCartClient, ShopifyCartClientOptions, ShopifyCartError, ShopifyCartErrorCode, ShopifyCartLine, ShopifyCartResult, ShopifyCartSettings, ShopifyCartWarning, ShopifyConfig, ShopifyMoney, ShopifySettings, ShopifyStorefront, ShopifyUserError, SkesisItem, SkesisItemPage, SkesisRelatedResponse, SkesisSimilarResponse, Story, SuggestPayload, Suggestions, ThamyrInteractionMap, ThamyrResponse, Topic, TopicContentsPage, TopicSummary, TtsAudio, UiElement, UiObserverConfig, UiSnapshot, UserInteraction, Variant, VariationAttribute, VariationGroup, Video, WarningCallback, WhisperPayload, WooCommerceCart, WooCommerceCartClient, WooCommerceCartClientOptions, WooCommerceCartError, WooCommerceCartErrorCode, WooCommerceCartItem, WooCommerceCartResult, WooCommerceMoney, WooCommerceStart };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callimacus/thamyr-core",
3
- "version": "4.17.3",
3
+ "version": "4.19.0",
4
4
  "private": false,
5
5
  "description": "Core package for Thamyr",
6
6
  "license": "SEE LICENSE IN LICENSE.md",