@wix/web5-core 1.63.28 → 1.63.29
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/dist/cjs/component/componentDefinitions/ErrorSectionDefinition.js +8 -0
- package/dist/cjs/component/componentDefinitions/ErrorSectionDefinition.js.map +1 -1
- package/dist/cjs/errors/conversationErrorTypes.js +4 -0
- package/dist/cjs/errors/conversationErrorTypes.js.map +1 -1
- package/dist/cjs/errors/errorTemplates.js +8 -0
- package/dist/cjs/errors/errorTemplates.js.map +1 -1
- package/dist/esm/component/componentDefinitions/ErrorSectionDefinition.js +8 -0
- package/dist/esm/component/componentDefinitions/ErrorSectionDefinition.js.map +1 -1
- package/dist/esm/errors/conversationErrorTypes.js +4 -0
- package/dist/esm/errors/conversationErrorTypes.js.map +1 -1
- package/dist/esm/errors/errorTemplates.js +8 -0
- package/dist/esm/errors/errorTemplates.js.map +1 -1
- package/dist/types/component/componentDefinitions/ErrorSectionDefinition.d.ts.map +1 -1
- package/dist/types/errors/conversationErrorTypes.d.ts +1 -1
- package/dist/types/errors/conversationErrorTypes.d.ts.map +1 -1
- package/dist/types/errors/errorTemplates.d.ts +1 -1
- package/dist/types/errors/errorTemplates.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -11,6 +11,9 @@ const ERROR_PATTERNS = [{
|
|
|
11
11
|
}, {
|
|
12
12
|
pattern: /Error: conversation-403/i,
|
|
13
13
|
type: 'conversation-403'
|
|
14
|
+
}, {
|
|
15
|
+
pattern: /Error: conversation-429/i,
|
|
16
|
+
type: 'conversation-429'
|
|
14
17
|
}, {
|
|
15
18
|
pattern: /Error: conversation-500/i,
|
|
16
19
|
type: 'conversation-500'
|
|
@@ -57,6 +60,11 @@ class ErrorSectionDefinition {
|
|
|
57
60
|
expected: {
|
|
58
61
|
type: 'conversation-500'
|
|
59
62
|
}
|
|
63
|
+
}, {
|
|
64
|
+
markdown: 'Error: conversation-429',
|
|
65
|
+
expected: {
|
|
66
|
+
type: 'conversation-429'
|
|
67
|
+
}
|
|
60
68
|
}]);
|
|
61
69
|
}
|
|
62
70
|
parse(parts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_parseUtils","require","ERROR_PATTERNS","pattern","type","ErrorSectionDefinition","constructor","_defineProperty2","default","markdown","expected","parse","parts","text","bodyText","test","exports"],"sources":["../../../../src/component/componentDefinitions/ErrorSectionDefinition.ts"],"sourcesContent":["import { bodyText } from './parse-utils';\nimport type { Part } from '../../parts/parts';\nimport type {\n ErrorCompProps,\n ErrorSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\nimport type { ConversationErrorType } from '../../errors/conversationErrorTypes';\n\ninterface ErrorPattern {\n pattern: RegExp;\n type: ConversationErrorType;\n}\n\nconst ERROR_PATTERNS: ErrorPattern[] = [\n { pattern: /Error: conversation-404/i, type: 'conversation-404' },\n { pattern: /Error: conversation-403/i, type: 'conversation-403' },\n { pattern: /Error: conversation-500/i, type: 'conversation-500' },\n {\n pattern: /Error: conversation-generic-network-error/i,\n type: 'conversation-generic-network-error',\n },\n { pattern: /Error: conversation-timeout/i, type: 'conversation-timeout' },\n {\n pattern: /Error: conversation-partial-load/i,\n type: 'conversation-partial-load',\n },\n {\n pattern: /Error: conversation-streaming-error/i,\n type: 'conversation-streaming-error',\n },\n {\n pattern: /Error: conversation-llm-empty-response/i,\n type: 'conversation-llm-empty-response',\n },\n { pattern: /Error: history-load-error/i, type: 'history-load-error' },\n { pattern: /^error/i, type: 'conversation-llm-error-text' },\n { pattern: /Error/i, type: 'conversation-llm-error-text' },\n];\n\nexport class ErrorSectionDefinition\n implements SectionDefinition<ErrorSectionComponent>\n{\n sectionType = 'error' as const;\n patterns = ['t'];\n maxConsumedNodes = 1;\n\n defaults: ErrorCompProps = {\n type: 'conversation-llm-error-text',\n };\n\n fixtures: SectionFixture<ErrorCompProps>[] = [\n {\n markdown: 'Error: conversation-404',\n expected: { type: 'conversation-404' },\n },\n {\n markdown: 'Error: conversation-500',\n expected: { type: 'conversation-500' },\n },\n ];\n\n parse(parts: Part[]): ErrorCompProps | null {\n const text = bodyText(parts);\n if (!text) {\n return null;\n }\n\n for (const { pattern, type } of ERROR_PATTERNS) {\n if (pattern.test(text)) {\n return { type };\n }\n }\n\n return null;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAeA,MAAMC,cAA8B,GAAG,CACrC;EAAEC,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EACED,OAAO,EAAE,4CAA4C;EACrDC,IAAI,EAAE;AACR,CAAC,EACD;EAAED,OAAO,EAAE,8BAA8B;EAAEC,IAAI,EAAE;AAAuB,CAAC,EACzE;EACED,OAAO,EAAE,mCAAmC;EAC5CC,IAAI,EAAE;AACR,CAAC,EACD;EACED,OAAO,EAAE,sCAAsC;EAC/CC,IAAI,EAAE;AACR,CAAC,EACD;EACED,OAAO,EAAE,yCAAyC;EAClDC,IAAI,EAAE;AACR,CAAC,EACD;EAAED,OAAO,EAAE,4BAA4B;EAAEC,IAAI,EAAE;AAAqB,CAAC,EACrE;EAAED,OAAO,EAAE,SAAS;EAAEC,IAAI,EAAE;AAA8B,CAAC,EAC3D;EAAED,OAAO,EAAE,QAAQ;EAAEC,IAAI,EAAE;AAA8B,CAAC,CAC3D;AAEM,MAAMC,sBAAsB,CAEnC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,uBACgB,OAAO;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBACV,CAAC,GAAG,CAAC;IAAA,IAAAD,gBAAA,CAAAC,OAAA,4BACG,CAAC;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAEO;MACzBJ,IAAI,EAAE;IACR,CAAC;IAAA,IAAAG,gBAAA,CAAAC,OAAA,oBAE4C,CAC3C;MACEC,QAAQ,EAAE,yBAAyB;MACnCC,QAAQ,EAAE;QAAEN,IAAI,EAAE;MAAmB;IACvC,CAAC,EACD;MACEK,QAAQ,EAAE,yBAAyB;MACnCC,QAAQ,EAAE;QAAEN,IAAI,EAAE;MAAmB;IACvC,CAAC,CACF;EAAA;EAEDO,KAAKA,CAACC,KAAa,EAAyB;IAC1C,MAAMC,IAAI,GAAG,IAAAC,oBAAQ,EAACF,KAAK,CAAC;IAC5B,IAAI,CAACC,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IAEA,KAAK,MAAM;MAAEV,OAAO;MAAEC;IAAK,CAAC,IAAIF,cAAc,EAAE;MAC9C,IAAIC,OAAO,CAACY,IAAI,CAACF,IAAI,CAAC,EAAE;QACtB,OAAO;UAAET;QAAK,CAAC;MACjB;IACF;IAEA,OAAO,IAAI;EACb;AACF;AAACY,OAAA,CAAAX,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_parseUtils","require","ERROR_PATTERNS","pattern","type","ErrorSectionDefinition","constructor","_defineProperty2","default","markdown","expected","parse","parts","text","bodyText","test","exports"],"sources":["../../../../src/component/componentDefinitions/ErrorSectionDefinition.ts"],"sourcesContent":["import { bodyText } from './parse-utils';\nimport type { Part } from '../../parts/parts';\nimport type {\n ErrorCompProps,\n ErrorSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\nimport type { ConversationErrorType } from '../../errors/conversationErrorTypes';\n\ninterface ErrorPattern {\n pattern: RegExp;\n type: ConversationErrorType;\n}\n\nconst ERROR_PATTERNS: ErrorPattern[] = [\n { pattern: /Error: conversation-404/i, type: 'conversation-404' },\n { pattern: /Error: conversation-403/i, type: 'conversation-403' },\n { pattern: /Error: conversation-429/i, type: 'conversation-429' },\n { pattern: /Error: conversation-500/i, type: 'conversation-500' },\n {\n pattern: /Error: conversation-generic-network-error/i,\n type: 'conversation-generic-network-error',\n },\n { pattern: /Error: conversation-timeout/i, type: 'conversation-timeout' },\n {\n pattern: /Error: conversation-partial-load/i,\n type: 'conversation-partial-load',\n },\n {\n pattern: /Error: conversation-streaming-error/i,\n type: 'conversation-streaming-error',\n },\n {\n pattern: /Error: conversation-llm-empty-response/i,\n type: 'conversation-llm-empty-response',\n },\n { pattern: /Error: history-load-error/i, type: 'history-load-error' },\n { pattern: /^error/i, type: 'conversation-llm-error-text' },\n { pattern: /Error/i, type: 'conversation-llm-error-text' },\n];\n\nexport class ErrorSectionDefinition\n implements SectionDefinition<ErrorSectionComponent>\n{\n sectionType = 'error' as const;\n patterns = ['t'];\n maxConsumedNodes = 1;\n\n defaults: ErrorCompProps = {\n type: 'conversation-llm-error-text',\n };\n\n fixtures: SectionFixture<ErrorCompProps>[] = [\n {\n markdown: 'Error: conversation-404',\n expected: { type: 'conversation-404' },\n },\n {\n markdown: 'Error: conversation-500',\n expected: { type: 'conversation-500' },\n },\n {\n markdown: 'Error: conversation-429',\n expected: { type: 'conversation-429' },\n },\n ];\n\n parse(parts: Part[]): ErrorCompProps | null {\n const text = bodyText(parts);\n if (!text) {\n return null;\n }\n\n for (const { pattern, type } of ERROR_PATTERNS) {\n if (pattern.test(text)) {\n return { type };\n }\n }\n\n return null;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAeA,MAAMC,cAA8B,GAAG,CACrC;EAAEC,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EACED,OAAO,EAAE,4CAA4C;EACrDC,IAAI,EAAE;AACR,CAAC,EACD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C,IAAIF,cAAc,EAAE;MAC9C,IAAIC,OAAO,CAACY,IAAI,CAACF,IAAI,CAAC,EAAE;QACtB,OAAO;UAAET;QAAK,CAAC;MACjB;IACF;IAEA,OAAO,IAAI;EACb;AACF;AAACY,OAAA,CAAAX,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -17,6 +17,7 @@ exports.getErrorTypeFromStatus = exports.createErrorMarkdown = exports.STREAMING
|
|
|
17
17
|
const ERROR_MARKDOWN = exports.ERROR_MARKDOWN = {
|
|
18
18
|
'conversation-404': 'Error: conversation-404',
|
|
19
19
|
'conversation-403': 'Error: conversation-403',
|
|
20
|
+
'conversation-429': 'Error: conversation-429',
|
|
20
21
|
'conversation-500': 'Error: conversation-500',
|
|
21
22
|
'conversation-generic-network-error': 'Error: conversation-generic-network-error',
|
|
22
23
|
'conversation-timeout': 'Error: conversation-timeout',
|
|
@@ -35,6 +36,9 @@ const getErrorTypeFromStatus = status => {
|
|
|
35
36
|
if (status === 403) {
|
|
36
37
|
return 'conversation-403';
|
|
37
38
|
}
|
|
39
|
+
if (status === 429) {
|
|
40
|
+
return 'conversation-429';
|
|
41
|
+
}
|
|
38
42
|
if (status >= 500) {
|
|
39
43
|
return 'conversation-500';
|
|
40
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ERROR_MARKDOWN","exports","getErrorTypeFromStatus","status","createErrorMarkdown","type","STREAMING_TIMEOUT_MS"],"sources":["../../../src/errors/conversationErrorTypes.ts"],"sourcesContent":["/**\n * Conversation Error Types\n *\n * Canonical error type definitions and utilities for the error handling pipeline.\n * Maps HTTP status codes and error conditions to typed error identifiers.\n *\n * Prefix conventions:\n * conversation- → errors during conversation streaming flow\n * history- → errors during conversation history loading\n */\n\nexport type ConversationErrorType =\n | 'conversation-llm-error-text'\n | 'conversation-llm-empty-response'\n | 'conversation-500'\n | 'conversation-generic-network-error'\n | 'conversation-timeout'\n | 'conversation-streaming-error'\n | 'conversation-404'\n | 'conversation-403'\n | 'conversation-partial-load'\n | 'history-load-error';\n\n/** Error markdown strings that ErrorSectionDefinition recognizes */\nexport const ERROR_MARKDOWN: Record<ConversationErrorType, string> = {\n 'conversation-404': 'Error: conversation-404',\n 'conversation-403': 'Error: conversation-403',\n 'conversation-500': 'Error: conversation-500',\n 'conversation-generic-network-error':\n 'Error: conversation-generic-network-error',\n 'conversation-timeout': 'Error: conversation-timeout',\n 'conversation-streaming-error': 'Error: conversation-streaming-error',\n 'conversation-partial-load': 'Error: conversation-partial-load',\n 'conversation-llm-empty-response': 'Error: conversation-llm-empty-response',\n 'conversation-llm-error-text': 'Error',\n 'history-load-error': 'Error: history-load-error',\n};\n\n/** Maps HTTP status code to error type */\nexport const getErrorTypeFromStatus = (\n status: number,\n): ConversationErrorType => {\n if (status === 404) {\n return 'conversation-404';\n }\n if (status === 403) {\n return 'conversation-403';\n }\n if (status >= 500) {\n return 'conversation-500';\n }\n if (status >= 400) {\n return 'conversation-generic-network-error';\n }\n return 'conversation-llm-error-text';\n};\n\n/** Creates error markdown string for the given error type */\nexport const createErrorMarkdown = (type: ConversationErrorType): string => {\n return ERROR_MARKDOWN[type] || ERROR_MARKDOWN['conversation-llm-error-text'];\n};\n\n/** Streaming timeout in milliseconds (60 seconds) */\nexport const STREAMING_TIMEOUT_MS = 60000;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["ERROR_MARKDOWN","exports","getErrorTypeFromStatus","status","createErrorMarkdown","type","STREAMING_TIMEOUT_MS"],"sources":["../../../src/errors/conversationErrorTypes.ts"],"sourcesContent":["/**\n * Conversation Error Types\n *\n * Canonical error type definitions and utilities for the error handling pipeline.\n * Maps HTTP status codes and error conditions to typed error identifiers.\n *\n * Prefix conventions:\n * conversation- → errors during conversation streaming flow\n * history- → errors during conversation history loading\n */\n\nexport type ConversationErrorType =\n | 'conversation-llm-error-text'\n | 'conversation-llm-empty-response'\n | 'conversation-500'\n | 'conversation-generic-network-error'\n | 'conversation-timeout'\n | 'conversation-streaming-error'\n | 'conversation-404'\n | 'conversation-403'\n | 'conversation-429'\n | 'conversation-partial-load'\n | 'history-load-error';\n\n/** Error markdown strings that ErrorSectionDefinition recognizes */\nexport const ERROR_MARKDOWN: Record<ConversationErrorType, string> = {\n 'conversation-404': 'Error: conversation-404',\n 'conversation-403': 'Error: conversation-403',\n 'conversation-429': 'Error: conversation-429',\n 'conversation-500': 'Error: conversation-500',\n 'conversation-generic-network-error':\n 'Error: conversation-generic-network-error',\n 'conversation-timeout': 'Error: conversation-timeout',\n 'conversation-streaming-error': 'Error: conversation-streaming-error',\n 'conversation-partial-load': 'Error: conversation-partial-load',\n 'conversation-llm-empty-response': 'Error: conversation-llm-empty-response',\n 'conversation-llm-error-text': 'Error',\n 'history-load-error': 'Error: history-load-error',\n};\n\n/** Maps HTTP status code to error type */\nexport const getErrorTypeFromStatus = (\n status: number,\n): ConversationErrorType => {\n if (status === 404) {\n return 'conversation-404';\n }\n if (status === 403) {\n return 'conversation-403';\n }\n if (status === 429) {\n return 'conversation-429';\n }\n if (status >= 500) {\n return 'conversation-500';\n }\n if (status >= 400) {\n return 'conversation-generic-network-error';\n }\n return 'conversation-llm-error-text';\n};\n\n/** Creates error markdown string for the given error type */\nexport const createErrorMarkdown = (type: ConversationErrorType): string => {\n return ERROR_MARKDOWN[type] || ERROR_MARKDOWN['conversation-llm-error-text'];\n};\n\n/** Streaming timeout in milliseconds (60 seconds) */\nexport const STREAMING_TIMEOUT_MS = 60000;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACO,MAAMA,cAAqD,GAAAC,OAAA,CAAAD,cAAA,GAAG;EACnE,kBAAkB,EAAE,yBAAyB;EAC7C,kBAAkB,EAAE,yBAAyB;EAC7C,kBAAkB,EAAE,yBAAyB;EAC7C,kBAAkB,EAAE,yBAAyB;EAC7C,oCAAoC,EAClC,2CAA2C;EAC7C,sBAAsB,EAAE,6BAA6B;EACrD,8BAA8B,EAAE,qCAAqC;EACrE,2BAA2B,EAAE,kCAAkC;EAC/D,iCAAiC,EAAE,wCAAwC;EAC3E,6BAA6B,EAAE,OAAO;EACtC,oBAAoB,EAAE;AACxB,CAAC;;AAED;AACO,MAAME,sBAAsB,GACjCC,MAAc,IACY;EAC1B,IAAIA,MAAM,KAAK,GAAG,EAAE;IAClB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,KAAK,GAAG,EAAE;IAClB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,KAAK,GAAG,EAAE;IAClB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,IAAI,GAAG,EAAE;IACjB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,IAAI,GAAG,EAAE;IACjB,OAAO,oCAAoC;EAC7C;EACA,OAAO,6BAA6B;AACtC,CAAC;;AAED;AAAAF,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AACO,MAAME,mBAAmB,GAAIC,IAA2B,IAAa;EAC1E,OAAOL,cAAc,CAACK,IAAI,CAAC,IAAIL,cAAc,CAAC,6BAA6B,CAAC;AAC9E,CAAC;;AAED;AAAAC,OAAA,CAAAG,mBAAA,GAAAA,mBAAA;AACO,MAAME,oBAAoB,GAAAL,OAAA,CAAAK,oBAAA,GAAG,KAAK","ignoreList":[]}
|
|
@@ -55,6 +55,14 @@ const DEFAULT_ERROR_TEMPLATES = exports.DEFAULT_ERROR_TEMPLATES = {
|
|
|
55
55
|
showChips: true,
|
|
56
56
|
chipsLabel: 'Some ideas to get you started:'
|
|
57
57
|
},
|
|
58
|
+
'conversation-429': {
|
|
59
|
+
iconType: 'quota-exceeded',
|
|
60
|
+
title: 'This service is currently out of quota.\nPlease try again later.',
|
|
61
|
+
buttons: [{
|
|
62
|
+
text: 'Contact Us',
|
|
63
|
+
variant: 'link'
|
|
64
|
+
}]
|
|
65
|
+
},
|
|
58
66
|
'conversation-partial-load': {
|
|
59
67
|
iconType: 'partial-load',
|
|
60
68
|
title: 'Some content didn\u2019t load',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["retryAndContactButtons","text","action","variant","DEFAULT_ERROR_TEMPLATES","exports","title","showChips","iconType","buttons","chipsLabel","resolveErrorTemplate","type","overrides","templates"],"sources":["../../../src/errors/errorTemplates.ts"],"sourcesContent":["import type { ConversationErrorType } from './conversationErrorTypes';\n\n/** Action identifiers for error template buttons — resolved to callbacks by the rendering component */\nexport type ErrorActionType = 'retry' | 'newConversation' | 'reload';\n\n/** Icon identifiers for error templates — resolved to SVG components by the rendering component */\nexport type ErrorIconType =\n | 'error-500'\n | 'timeout'\n | 'streaming-error'\n | 'not-found'\n | 'forbidden'\n | 'partial-load';\n\nexport interface ErrorTemplateButton {\n text: string;\n /** URL for navigation (renders as a link) */\n href?: string;\n /** Action identifier — component resolves to a callback */\n action?: ErrorActionType;\n variant: 'cta' | 'link';\n}\n\nexport interface ErrorTemplate {\n title: string;\n subtitle?: string;\n /** Icon identifier — component resolves to an SVG */\n iconType?: ErrorIconType;\n buttons?: ErrorTemplateButton[];\n showChips?: boolean;\n chipsLabel?: string;\n}\n\nexport type ErrorTemplateOverrides = Partial<\n Record<ConversationErrorType, ErrorTemplate>\n>;\n\nconst retryAndContactButtons: ErrorTemplateButton[] = [\n { text: 'Try Again', action: 'retry', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n];\n\nexport const DEFAULT_ERROR_TEMPLATES: Record<\n ConversationErrorType,\n ErrorTemplate\n> = {\n 'conversation-llm-error-text': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-llm-empty-response': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-500': {\n iconType: 'error-500',\n title: \"This page isn't available right now.\",\n buttons: retryAndContactButtons,\n },\n 'conversation-generic-network-error': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-timeout': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-streaming-error': {\n iconType: 'streaming-error',\n title: 'The connection dropped. Please try again.',\n buttons: retryAndContactButtons,\n },\n 'conversation-404': {\n iconType: 'not-found',\n title: 'Page not found.\\nIt happens! Let\\u2019s get you back on track',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-403': {\n iconType: 'forbidden',\n title:\n 'Welcome back.\\nFor privacy, we couldn\\u2019t restore previous content. Ask anything to continue.',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-partial-load': {\n iconType: 'partial-load',\n title: 'Some content didn\\u2019t load',\n buttons: retryAndContactButtons,\n },\n 'history-load-error': {\n iconType: 'streaming-error',\n title: 'We couldn\\u2019t load this conversation.',\n buttons: [\n { text: 'New Conversation', action: 'newConversation', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n ],\n },\n};\n\n/** Resolves the error template for a given type, merging client overrides on top of defaults */\nexport const resolveErrorTemplate = (\n type: string,\n overrides?: ErrorTemplateOverrides,\n): ErrorTemplate => {\n const templates = overrides\n ? { ...DEFAULT_ERROR_TEMPLATES, ...overrides }\n : DEFAULT_ERROR_TEMPLATES;\n return (\n templates[type as ConversationErrorType] ??\n templates['conversation-llm-error-text']\n );\n};\n"],"mappings":";;;;AAEA;;AAGA;;
|
|
1
|
+
{"version":3,"names":["retryAndContactButtons","text","action","variant","DEFAULT_ERROR_TEMPLATES","exports","title","showChips","iconType","buttons","chipsLabel","resolveErrorTemplate","type","overrides","templates"],"sources":["../../../src/errors/errorTemplates.ts"],"sourcesContent":["import type { ConversationErrorType } from './conversationErrorTypes';\n\n/** Action identifiers for error template buttons — resolved to callbacks by the rendering component */\nexport type ErrorActionType = 'retry' | 'newConversation' | 'reload';\n\n/** Icon identifiers for error templates — resolved to SVG components by the rendering component */\nexport type ErrorIconType =\n | 'error-500'\n | 'timeout'\n | 'streaming-error'\n | 'not-found'\n | 'forbidden'\n | 'partial-load'\n | 'quota-exceeded';\n\nexport interface ErrorTemplateButton {\n text: string;\n /** URL for navigation (renders as a link) */\n href?: string;\n /** Action identifier — component resolves to a callback */\n action?: ErrorActionType;\n variant: 'cta' | 'link';\n}\n\nexport interface ErrorTemplate {\n title: string;\n subtitle?: string;\n /** Icon identifier — component resolves to an SVG */\n iconType?: ErrorIconType;\n buttons?: ErrorTemplateButton[];\n showChips?: boolean;\n chipsLabel?: string;\n}\n\nexport type ErrorTemplateOverrides = Partial<\n Record<ConversationErrorType, ErrorTemplate>\n>;\n\nconst retryAndContactButtons: ErrorTemplateButton[] = [\n { text: 'Try Again', action: 'retry', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n];\n\nexport const DEFAULT_ERROR_TEMPLATES: Record<\n ConversationErrorType,\n ErrorTemplate\n> = {\n 'conversation-llm-error-text': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-llm-empty-response': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-500': {\n iconType: 'error-500',\n title: \"This page isn't available right now.\",\n buttons: retryAndContactButtons,\n },\n 'conversation-generic-network-error': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-timeout': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-streaming-error': {\n iconType: 'streaming-error',\n title: 'The connection dropped. Please try again.',\n buttons: retryAndContactButtons,\n },\n 'conversation-404': {\n iconType: 'not-found',\n title: 'Page not found.\\nIt happens! Let\\u2019s get you back on track',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-403': {\n iconType: 'forbidden',\n title:\n 'Welcome back.\\nFor privacy, we couldn\\u2019t restore previous content. Ask anything to continue.',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-429': {\n iconType: 'quota-exceeded',\n title: 'This service is currently out of quota.\\nPlease try again later.',\n buttons: [{ text: 'Contact Us', variant: 'link' }],\n },\n 'conversation-partial-load': {\n iconType: 'partial-load',\n title: 'Some content didn\\u2019t load',\n buttons: retryAndContactButtons,\n },\n 'history-load-error': {\n iconType: 'streaming-error',\n title: 'We couldn\\u2019t load this conversation.',\n buttons: [\n { text: 'New Conversation', action: 'newConversation', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n ],\n },\n};\n\n/** Resolves the error template for a given type, merging client overrides on top of defaults */\nexport const resolveErrorTemplate = (\n type: string,\n overrides?: ErrorTemplateOverrides,\n): ErrorTemplate => {\n const templates = overrides\n ? { ...DEFAULT_ERROR_TEMPLATES, ...overrides }\n : DEFAULT_ERROR_TEMPLATES;\n return (\n templates[type as ConversationErrorType] ??\n templates['conversation-llm-error-text']\n );\n};\n"],"mappings":";;;;AAEA;;AAGA;;AAiCA,MAAMA,sBAA6C,GAAG,CACpD;EAAEC,IAAI,EAAE,WAAW;EAAEC,MAAM,EAAE,OAAO;EAAEC,OAAO,EAAE;AAAM,CAAC,EACtD;EAAEF,IAAI,EAAE,YAAY;EAAEE,OAAO,EAAE;AAAO,CAAC,CACxC;AAEM,MAAMC,uBAGZ,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACF,6BAA6B,EAAE;IAC7BE,KAAK,EACH,wFAAwF;IAC1FC,SAAS,EAAE;EACb,CAAC;EACD,iCAAiC,EAAE;IACjCD,KAAK,EACH,wFAAwF;IAC1FC,SAAS,EAAE;EACb,CAAC;EACD,kBAAkB,EAAE;IAClBC,QAAQ,EAAE,WAAW;IACrBF,KAAK,EAAE,sCAAsC;IAC7CG,OAAO,EAAET;EACX,CAAC;EACD,oCAAoC,EAAE;IACpCQ,QAAQ,EAAE,S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CT,uBAAuB;EAC3B,OACEU,SAAS,CAACF,IAAI,CAA0B,IACxCE,SAAS,CAAC,6BAA6B,CAAC;AAE5C,CAAC;AAACT,OAAA,CAAAM,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -6,6 +6,9 @@ const ERROR_PATTERNS = [{
|
|
|
6
6
|
}, {
|
|
7
7
|
pattern: /Error: conversation-403/i,
|
|
8
8
|
type: 'conversation-403'
|
|
9
|
+
}, {
|
|
10
|
+
pattern: /Error: conversation-429/i,
|
|
11
|
+
type: 'conversation-429'
|
|
9
12
|
}, {
|
|
10
13
|
pattern: /Error: conversation-500/i,
|
|
11
14
|
type: 'conversation-500'
|
|
@@ -52,6 +55,11 @@ export class ErrorSectionDefinition {
|
|
|
52
55
|
expected: {
|
|
53
56
|
type: 'conversation-500'
|
|
54
57
|
}
|
|
58
|
+
}, {
|
|
59
|
+
markdown: 'Error: conversation-429',
|
|
60
|
+
expected: {
|
|
61
|
+
type: 'conversation-429'
|
|
62
|
+
}
|
|
55
63
|
}]);
|
|
56
64
|
}
|
|
57
65
|
parse(parts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["bodyText","ERROR_PATTERNS","pattern","type","ErrorSectionDefinition","constructor","_defineProperty","markdown","expected","parse","parts","text","test"],"sources":["../../../../src/component/componentDefinitions/ErrorSectionDefinition.ts"],"sourcesContent":["import { bodyText } from './parse-utils';\nimport type { Part } from '../../parts/parts';\nimport type {\n ErrorCompProps,\n ErrorSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\nimport type { ConversationErrorType } from '../../errors/conversationErrorTypes';\n\ninterface ErrorPattern {\n pattern: RegExp;\n type: ConversationErrorType;\n}\n\nconst ERROR_PATTERNS: ErrorPattern[] = [\n { pattern: /Error: conversation-404/i, type: 'conversation-404' },\n { pattern: /Error: conversation-403/i, type: 'conversation-403' },\n { pattern: /Error: conversation-500/i, type: 'conversation-500' },\n {\n pattern: /Error: conversation-generic-network-error/i,\n type: 'conversation-generic-network-error',\n },\n { pattern: /Error: conversation-timeout/i, type: 'conversation-timeout' },\n {\n pattern: /Error: conversation-partial-load/i,\n type: 'conversation-partial-load',\n },\n {\n pattern: /Error: conversation-streaming-error/i,\n type: 'conversation-streaming-error',\n },\n {\n pattern: /Error: conversation-llm-empty-response/i,\n type: 'conversation-llm-empty-response',\n },\n { pattern: /Error: history-load-error/i, type: 'history-load-error' },\n { pattern: /^error/i, type: 'conversation-llm-error-text' },\n { pattern: /Error/i, type: 'conversation-llm-error-text' },\n];\n\nexport class ErrorSectionDefinition\n implements SectionDefinition<ErrorSectionComponent>\n{\n sectionType = 'error' as const;\n patterns = ['t'];\n maxConsumedNodes = 1;\n\n defaults: ErrorCompProps = {\n type: 'conversation-llm-error-text',\n };\n\n fixtures: SectionFixture<ErrorCompProps>[] = [\n {\n markdown: 'Error: conversation-404',\n expected: { type: 'conversation-404' },\n },\n {\n markdown: 'Error: conversation-500',\n expected: { type: 'conversation-500' },\n },\n ];\n\n parse(parts: Part[]): ErrorCompProps | null {\n const text = bodyText(parts);\n if (!text) {\n return null;\n }\n\n for (const { pattern, type } of ERROR_PATTERNS) {\n if (pattern.test(text)) {\n return { type };\n }\n }\n\n return null;\n }\n}\n"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,eAAe;AAexC,MAAMC,cAA8B,GAAG,CACrC;EAAEC,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EACED,OAAO,EAAE,4CAA4C;EACrDC,IAAI,EAAE;AACR,CAAC,EACD;EAAED,OAAO,EAAE,8BAA8B;EAAEC,IAAI,EAAE;AAAuB,CAAC,EACzE;EACED,OAAO,EAAE,mCAAmC;EAC5CC,IAAI,EAAE;AACR,CAAC,EACD;EACED,OAAO,EAAE,sCAAsC;EAC/CC,IAAI,EAAE;AACR,CAAC,EACD;EACED,OAAO,EAAE,yCAAyC;EAClDC,IAAI,EAAE;AACR,CAAC,EACD;EAAED,OAAO,EAAE,4BAA4B;EAAEC,IAAI,EAAE;AAAqB,CAAC,EACrE;EAAED,OAAO,EAAE,SAAS;EAAEC,IAAI,EAAE;AAA8B,CAAC,EAC3D;EAAED,OAAO,EAAE,QAAQ;EAAEC,IAAI,EAAE;AAA8B,CAAC,CAC3D;AAED,OAAO,MAAMC,sBAAsB,CAEnC;EAAAC,YAAA;IAAAC,eAAA,sBACgB,OAAO;IAAAA,eAAA,mBACV,CAAC,GAAG,CAAC;IAAAA,eAAA,2BACG,CAAC;IAAAA,eAAA,mBAEO;MACzBH,IAAI,EAAE;IACR,CAAC;IAAAG,eAAA,mBAE4C,CAC3C;MACEC,QAAQ,EAAE,yBAAyB;MACnCC,QAAQ,EAAE;QAAEL,IAAI,EAAE;MAAmB;IACvC,CAAC,EACD;MACEI,QAAQ,EAAE,yBAAyB;MACnCC,QAAQ,EAAE;QAAEL,IAAI,EAAE;MAAmB;IACvC,CAAC,CACF;EAAA;EAEDM,KAAKA,CAACC,KAAa,EAAyB;IAC1C,MAAMC,IAAI,GAAGX,QAAQ,CAACU,KAAK,CAAC;IAC5B,IAAI,CAACC,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IAEA,KAAK,MAAM;MAAET,OAAO;MAAEC;IAAK,CAAC,IAAIF,cAAc,EAAE;MAC9C,IAAIC,OAAO,CAACU,IAAI,CAACD,IAAI,CAAC,EAAE;QACtB,OAAO;UAAER;QAAK,CAAC;MACjB;IACF;IAEA,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["bodyText","ERROR_PATTERNS","pattern","type","ErrorSectionDefinition","constructor","_defineProperty","markdown","expected","parse","parts","text","test"],"sources":["../../../../src/component/componentDefinitions/ErrorSectionDefinition.ts"],"sourcesContent":["import { bodyText } from './parse-utils';\nimport type { Part } from '../../parts/parts';\nimport type {\n ErrorCompProps,\n ErrorSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\nimport type { ConversationErrorType } from '../../errors/conversationErrorTypes';\n\ninterface ErrorPattern {\n pattern: RegExp;\n type: ConversationErrorType;\n}\n\nconst ERROR_PATTERNS: ErrorPattern[] = [\n { pattern: /Error: conversation-404/i, type: 'conversation-404' },\n { pattern: /Error: conversation-403/i, type: 'conversation-403' },\n { pattern: /Error: conversation-429/i, type: 'conversation-429' },\n { pattern: /Error: conversation-500/i, type: 'conversation-500' },\n {\n pattern: /Error: conversation-generic-network-error/i,\n type: 'conversation-generic-network-error',\n },\n { pattern: /Error: conversation-timeout/i, type: 'conversation-timeout' },\n {\n pattern: /Error: conversation-partial-load/i,\n type: 'conversation-partial-load',\n },\n {\n pattern: /Error: conversation-streaming-error/i,\n type: 'conversation-streaming-error',\n },\n {\n pattern: /Error: conversation-llm-empty-response/i,\n type: 'conversation-llm-empty-response',\n },\n { pattern: /Error: history-load-error/i, type: 'history-load-error' },\n { pattern: /^error/i, type: 'conversation-llm-error-text' },\n { pattern: /Error/i, type: 'conversation-llm-error-text' },\n];\n\nexport class ErrorSectionDefinition\n implements SectionDefinition<ErrorSectionComponent>\n{\n sectionType = 'error' as const;\n patterns = ['t'];\n maxConsumedNodes = 1;\n\n defaults: ErrorCompProps = {\n type: 'conversation-llm-error-text',\n };\n\n fixtures: SectionFixture<ErrorCompProps>[] = [\n {\n markdown: 'Error: conversation-404',\n expected: { type: 'conversation-404' },\n },\n {\n markdown: 'Error: conversation-500',\n expected: { type: 'conversation-500' },\n },\n {\n markdown: 'Error: conversation-429',\n expected: { type: 'conversation-429' },\n },\n ];\n\n parse(parts: Part[]): ErrorCompProps | null {\n const text = bodyText(parts);\n if (!text) {\n return null;\n }\n\n for (const { pattern, type } of ERROR_PATTERNS) {\n if (pattern.test(text)) {\n return { type };\n }\n }\n\n return null;\n }\n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C,EACD;MACEI,QAAQ,EAAE,yBAAyB;MACnCC,QAAQ,EAAE;QAAEL,IAAI,EAAE;MAAmB;IACvC,CAAC,CACF;EAAA;EAEDM,KAAKA,CAACC,KAAa,EAAyB;IAC1C,MAAMC,IAAI,GAAGX,QAAQ,CAACU,KAAK,CAAC;IAC5B,IAAI,CAACC,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IAEA,KAAK,MAAM;MAAET,OAAO;MAAEC;IAAK,CAAC,IAAIF,cAAc,EAAE;MAC9C,IAAIC,OAAO,CAACU,IAAI,CAACD,IAAI,CAAC,EAAE;QACtB,OAAO;UAAER;QAAK,CAAC;MACjB;IACF;IAEA,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
export const ERROR_MARKDOWN = {
|
|
14
14
|
'conversation-404': 'Error: conversation-404',
|
|
15
15
|
'conversation-403': 'Error: conversation-403',
|
|
16
|
+
'conversation-429': 'Error: conversation-429',
|
|
16
17
|
'conversation-500': 'Error: conversation-500',
|
|
17
18
|
'conversation-generic-network-error': 'Error: conversation-generic-network-error',
|
|
18
19
|
'conversation-timeout': 'Error: conversation-timeout',
|
|
@@ -31,6 +32,9 @@ export const getErrorTypeFromStatus = status => {
|
|
|
31
32
|
if (status === 403) {
|
|
32
33
|
return 'conversation-403';
|
|
33
34
|
}
|
|
35
|
+
if (status === 429) {
|
|
36
|
+
return 'conversation-429';
|
|
37
|
+
}
|
|
34
38
|
if (status >= 500) {
|
|
35
39
|
return 'conversation-500';
|
|
36
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ERROR_MARKDOWN","getErrorTypeFromStatus","status","createErrorMarkdown","type","STREAMING_TIMEOUT_MS"],"sources":["../../../src/errors/conversationErrorTypes.ts"],"sourcesContent":["/**\n * Conversation Error Types\n *\n * Canonical error type definitions and utilities for the error handling pipeline.\n * Maps HTTP status codes and error conditions to typed error identifiers.\n *\n * Prefix conventions:\n * conversation- → errors during conversation streaming flow\n * history- → errors during conversation history loading\n */\n\nexport type ConversationErrorType =\n | 'conversation-llm-error-text'\n | 'conversation-llm-empty-response'\n | 'conversation-500'\n | 'conversation-generic-network-error'\n | 'conversation-timeout'\n | 'conversation-streaming-error'\n | 'conversation-404'\n | 'conversation-403'\n | 'conversation-partial-load'\n | 'history-load-error';\n\n/** Error markdown strings that ErrorSectionDefinition recognizes */\nexport const ERROR_MARKDOWN: Record<ConversationErrorType, string> = {\n 'conversation-404': 'Error: conversation-404',\n 'conversation-403': 'Error: conversation-403',\n 'conversation-500': 'Error: conversation-500',\n 'conversation-generic-network-error':\n 'Error: conversation-generic-network-error',\n 'conversation-timeout': 'Error: conversation-timeout',\n 'conversation-streaming-error': 'Error: conversation-streaming-error',\n 'conversation-partial-load': 'Error: conversation-partial-load',\n 'conversation-llm-empty-response': 'Error: conversation-llm-empty-response',\n 'conversation-llm-error-text': 'Error',\n 'history-load-error': 'Error: history-load-error',\n};\n\n/** Maps HTTP status code to error type */\nexport const getErrorTypeFromStatus = (\n status: number,\n): ConversationErrorType => {\n if (status === 404) {\n return 'conversation-404';\n }\n if (status === 403) {\n return 'conversation-403';\n }\n if (status >= 500) {\n return 'conversation-500';\n }\n if (status >= 400) {\n return 'conversation-generic-network-error';\n }\n return 'conversation-llm-error-text';\n};\n\n/** Creates error markdown string for the given error type */\nexport const createErrorMarkdown = (type: ConversationErrorType): string => {\n return ERROR_MARKDOWN[type] || ERROR_MARKDOWN['conversation-llm-error-text'];\n};\n\n/** Streaming timeout in milliseconds (60 seconds) */\nexport const STREAMING_TIMEOUT_MS = 60000;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["ERROR_MARKDOWN","getErrorTypeFromStatus","status","createErrorMarkdown","type","STREAMING_TIMEOUT_MS"],"sources":["../../../src/errors/conversationErrorTypes.ts"],"sourcesContent":["/**\n * Conversation Error Types\n *\n * Canonical error type definitions and utilities for the error handling pipeline.\n * Maps HTTP status codes and error conditions to typed error identifiers.\n *\n * Prefix conventions:\n * conversation- → errors during conversation streaming flow\n * history- → errors during conversation history loading\n */\n\nexport type ConversationErrorType =\n | 'conversation-llm-error-text'\n | 'conversation-llm-empty-response'\n | 'conversation-500'\n | 'conversation-generic-network-error'\n | 'conversation-timeout'\n | 'conversation-streaming-error'\n | 'conversation-404'\n | 'conversation-403'\n | 'conversation-429'\n | 'conversation-partial-load'\n | 'history-load-error';\n\n/** Error markdown strings that ErrorSectionDefinition recognizes */\nexport const ERROR_MARKDOWN: Record<ConversationErrorType, string> = {\n 'conversation-404': 'Error: conversation-404',\n 'conversation-403': 'Error: conversation-403',\n 'conversation-429': 'Error: conversation-429',\n 'conversation-500': 'Error: conversation-500',\n 'conversation-generic-network-error':\n 'Error: conversation-generic-network-error',\n 'conversation-timeout': 'Error: conversation-timeout',\n 'conversation-streaming-error': 'Error: conversation-streaming-error',\n 'conversation-partial-load': 'Error: conversation-partial-load',\n 'conversation-llm-empty-response': 'Error: conversation-llm-empty-response',\n 'conversation-llm-error-text': 'Error',\n 'history-load-error': 'Error: history-load-error',\n};\n\n/** Maps HTTP status code to error type */\nexport const getErrorTypeFromStatus = (\n status: number,\n): ConversationErrorType => {\n if (status === 404) {\n return 'conversation-404';\n }\n if (status === 403) {\n return 'conversation-403';\n }\n if (status === 429) {\n return 'conversation-429';\n }\n if (status >= 500) {\n return 'conversation-500';\n }\n if (status >= 400) {\n return 'conversation-generic-network-error';\n }\n return 'conversation-llm-error-text';\n};\n\n/** Creates error markdown string for the given error type */\nexport const createErrorMarkdown = (type: ConversationErrorType): string => {\n return ERROR_MARKDOWN[type] || ERROR_MARKDOWN['conversation-llm-error-text'];\n};\n\n/** Streaming timeout in milliseconds (60 seconds) */\nexport const STREAMING_TIMEOUT_MS = 60000;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA,OAAO,MAAMA,cAAqD,GAAG;EACnE,kBAAkB,EAAE,yBAAyB;EAC7C,kBAAkB,EAAE,yBAAyB;EAC7C,kBAAkB,EAAE,yBAAyB;EAC7C,kBAAkB,EAAE,yBAAyB;EAC7C,oCAAoC,EAClC,2CAA2C;EAC7C,sBAAsB,EAAE,6BAA6B;EACrD,8BAA8B,EAAE,qCAAqC;EACrE,2BAA2B,EAAE,kCAAkC;EAC/D,iCAAiC,EAAE,wCAAwC;EAC3E,6BAA6B,EAAE,OAAO;EACtC,oBAAoB,EAAE;AACxB,CAAC;;AAED;AACA,OAAO,MAAMC,sBAAsB,GACjCC,MAAc,IACY;EAC1B,IAAIA,MAAM,KAAK,GAAG,EAAE;IAClB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,KAAK,GAAG,EAAE;IAClB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,KAAK,GAAG,EAAE;IAClB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,IAAI,GAAG,EAAE;IACjB,OAAO,kBAAkB;EAC3B;EACA,IAAIA,MAAM,IAAI,GAAG,EAAE;IACjB,OAAO,oCAAoC;EAC7C;EACA,OAAO,6BAA6B;AACtC,CAAC;;AAED;AACA,OAAO,MAAMC,mBAAmB,GAAIC,IAA2B,IAAa;EAC1E,OAAOJ,cAAc,CAACI,IAAI,CAAC,IAAIJ,cAAc,CAAC,6BAA6B,CAAC;AAC9E,CAAC;;AAED;AACA,OAAO,MAAMK,oBAAoB,GAAG,KAAK","ignoreList":[]}
|
|
@@ -51,6 +51,14 @@ export const DEFAULT_ERROR_TEMPLATES = {
|
|
|
51
51
|
showChips: true,
|
|
52
52
|
chipsLabel: 'Some ideas to get you started:'
|
|
53
53
|
},
|
|
54
|
+
'conversation-429': {
|
|
55
|
+
iconType: 'quota-exceeded',
|
|
56
|
+
title: 'This service is currently out of quota.\nPlease try again later.',
|
|
57
|
+
buttons: [{
|
|
58
|
+
text: 'Contact Us',
|
|
59
|
+
variant: 'link'
|
|
60
|
+
}]
|
|
61
|
+
},
|
|
54
62
|
'conversation-partial-load': {
|
|
55
63
|
iconType: 'partial-load',
|
|
56
64
|
title: 'Some content didn\u2019t load',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["retryAndContactButtons","text","action","variant","DEFAULT_ERROR_TEMPLATES","title","showChips","iconType","buttons","chipsLabel","resolveErrorTemplate","type","overrides","templates"],"sources":["../../../src/errors/errorTemplates.ts"],"sourcesContent":["import type { ConversationErrorType } from './conversationErrorTypes';\n\n/** Action identifiers for error template buttons — resolved to callbacks by the rendering component */\nexport type ErrorActionType = 'retry' | 'newConversation' | 'reload';\n\n/** Icon identifiers for error templates — resolved to SVG components by the rendering component */\nexport type ErrorIconType =\n | 'error-500'\n | 'timeout'\n | 'streaming-error'\n | 'not-found'\n | 'forbidden'\n | 'partial-load';\n\nexport interface ErrorTemplateButton {\n text: string;\n /** URL for navigation (renders as a link) */\n href?: string;\n /** Action identifier — component resolves to a callback */\n action?: ErrorActionType;\n variant: 'cta' | 'link';\n}\n\nexport interface ErrorTemplate {\n title: string;\n subtitle?: string;\n /** Icon identifier — component resolves to an SVG */\n iconType?: ErrorIconType;\n buttons?: ErrorTemplateButton[];\n showChips?: boolean;\n chipsLabel?: string;\n}\n\nexport type ErrorTemplateOverrides = Partial<\n Record<ConversationErrorType, ErrorTemplate>\n>;\n\nconst retryAndContactButtons: ErrorTemplateButton[] = [\n { text: 'Try Again', action: 'retry', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n];\n\nexport const DEFAULT_ERROR_TEMPLATES: Record<\n ConversationErrorType,\n ErrorTemplate\n> = {\n 'conversation-llm-error-text': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-llm-empty-response': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-500': {\n iconType: 'error-500',\n title: \"This page isn't available right now.\",\n buttons: retryAndContactButtons,\n },\n 'conversation-generic-network-error': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-timeout': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-streaming-error': {\n iconType: 'streaming-error',\n title: 'The connection dropped. Please try again.',\n buttons: retryAndContactButtons,\n },\n 'conversation-404': {\n iconType: 'not-found',\n title: 'Page not found.\\nIt happens! Let\\u2019s get you back on track',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-403': {\n iconType: 'forbidden',\n title:\n 'Welcome back.\\nFor privacy, we couldn\\u2019t restore previous content. Ask anything to continue.',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-partial-load': {\n iconType: 'partial-load',\n title: 'Some content didn\\u2019t load',\n buttons: retryAndContactButtons,\n },\n 'history-load-error': {\n iconType: 'streaming-error',\n title: 'We couldn\\u2019t load this conversation.',\n buttons: [\n { text: 'New Conversation', action: 'newConversation', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n ],\n },\n};\n\n/** Resolves the error template for a given type, merging client overrides on top of defaults */\nexport const resolveErrorTemplate = (\n type: string,\n overrides?: ErrorTemplateOverrides,\n): ErrorTemplate => {\n const templates = overrides\n ? { ...DEFAULT_ERROR_TEMPLATES, ...overrides }\n : DEFAULT_ERROR_TEMPLATES;\n return (\n templates[type as ConversationErrorType] ??\n templates['conversation-llm-error-text']\n );\n};\n"],"mappings":"AAEA;;AAGA;;
|
|
1
|
+
{"version":3,"names":["retryAndContactButtons","text","action","variant","DEFAULT_ERROR_TEMPLATES","title","showChips","iconType","buttons","chipsLabel","resolveErrorTemplate","type","overrides","templates"],"sources":["../../../src/errors/errorTemplates.ts"],"sourcesContent":["import type { ConversationErrorType } from './conversationErrorTypes';\n\n/** Action identifiers for error template buttons — resolved to callbacks by the rendering component */\nexport type ErrorActionType = 'retry' | 'newConversation' | 'reload';\n\n/** Icon identifiers for error templates — resolved to SVG components by the rendering component */\nexport type ErrorIconType =\n | 'error-500'\n | 'timeout'\n | 'streaming-error'\n | 'not-found'\n | 'forbidden'\n | 'partial-load'\n | 'quota-exceeded';\n\nexport interface ErrorTemplateButton {\n text: string;\n /** URL for navigation (renders as a link) */\n href?: string;\n /** Action identifier — component resolves to a callback */\n action?: ErrorActionType;\n variant: 'cta' | 'link';\n}\n\nexport interface ErrorTemplate {\n title: string;\n subtitle?: string;\n /** Icon identifier — component resolves to an SVG */\n iconType?: ErrorIconType;\n buttons?: ErrorTemplateButton[];\n showChips?: boolean;\n chipsLabel?: string;\n}\n\nexport type ErrorTemplateOverrides = Partial<\n Record<ConversationErrorType, ErrorTemplate>\n>;\n\nconst retryAndContactButtons: ErrorTemplateButton[] = [\n { text: 'Try Again', action: 'retry', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n];\n\nexport const DEFAULT_ERROR_TEMPLATES: Record<\n ConversationErrorType,\n ErrorTemplate\n> = {\n 'conversation-llm-error-text': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-llm-empty-response': {\n title:\n \"I couldn't find information about what you asked.\\nTry asking about a different topic.\",\n showChips: true,\n },\n 'conversation-500': {\n iconType: 'error-500',\n title: \"This page isn't available right now.\",\n buttons: retryAndContactButtons,\n },\n 'conversation-generic-network-error': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-timeout': {\n iconType: 'timeout',\n title: 'Something went wrong on our side.\\nPlease try again in a moment.',\n buttons: retryAndContactButtons,\n },\n 'conversation-streaming-error': {\n iconType: 'streaming-error',\n title: 'The connection dropped. Please try again.',\n buttons: retryAndContactButtons,\n },\n 'conversation-404': {\n iconType: 'not-found',\n title: 'Page not found.\\nIt happens! Let\\u2019s get you back on track',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-403': {\n iconType: 'forbidden',\n title:\n 'Welcome back.\\nFor privacy, we couldn\\u2019t restore previous content. Ask anything to continue.',\n showChips: true,\n chipsLabel: 'Some ideas to get you started:',\n },\n 'conversation-429': {\n iconType: 'quota-exceeded',\n title: 'This service is currently out of quota.\\nPlease try again later.',\n buttons: [{ text: 'Contact Us', variant: 'link' }],\n },\n 'conversation-partial-load': {\n iconType: 'partial-load',\n title: 'Some content didn\\u2019t load',\n buttons: retryAndContactButtons,\n },\n 'history-load-error': {\n iconType: 'streaming-error',\n title: 'We couldn\\u2019t load this conversation.',\n buttons: [\n { text: 'New Conversation', action: 'newConversation', variant: 'cta' },\n { text: 'Contact Us', variant: 'link' },\n ],\n },\n};\n\n/** Resolves the error template for a given type, merging client overrides on top of defaults */\nexport const resolveErrorTemplate = (\n type: string,\n overrides?: ErrorTemplateOverrides,\n): ErrorTemplate => {\n const templates = overrides\n ? { ...DEFAULT_ERROR_TEMPLATES, ...overrides }\n : DEFAULT_ERROR_TEMPLATES;\n return (\n templates[type as ConversationErrorType] ??\n templates['conversation-llm-error-text']\n );\n};\n"],"mappings":"AAEA;;AAGA;;AAiCA,MAAMA,sBAA6C,GAAG,CACpD;EAAEC,IAAI,EAAE,WAAW;EAAEC,MAAM,EAAE,OAAO;EAAEC,OAAO,EAAE;AAAM,CAAC,EACtD;EAAEF,IAAI,EAAE,YAAY;EAAEE,OAAO,EAAE;AAAO,CAAC,CACxC;AAED,OAAO,MAAMC,uBAGZ,GAAG;EACF,6BAA6B,EAAE;IAC7BC,KAAK,EACH,wFAAwF;IAC1FC,SAAS,EAAE;EACb,CAAC;EACD,iCAAiC,EAAE;IACjCD,KAAK,EACH,wFAAwF;IAC1FC,SAAS,EAAE;EACb,CAAC;EACD,kBAAkB,EAAE;IAClBC,QAAQ,EAAE,WAAW;IACrBF,KAAK,EAAE,sCAAsC;IAC7CG,OAAO,EAAER;EACX,CAAC;EACD,oCAAoC,EAAE;IACpCO,QAAQ,EAAE,S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AC5CR,uBAAuB;EAC3B,OACES,SAAS,CAACF,IAAI,CAA0B,IACxCE,SAAS,CAAC,6BAA6B,CAAC;AAE5C,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorSectionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/ErrorSectionDefinition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorSectionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/ErrorSectionDefinition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAmC/D,qBAAa,sBACX,YAAW,iBAAiB,CAAC,qBAAqB,CAAC;IAEnD,WAAW,UAAoB;IAC/B,QAAQ,WAAS;IACjB,gBAAgB,SAAK;IAErB,QAAQ,EAAE,cAAc,CAEtB;IAEF,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,EAAE,CAaxC;IAEF,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,cAAc,GAAG,IAAI;CAc5C"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* conversation- → errors during conversation streaming flow
|
|
9
9
|
* history- → errors during conversation history loading
|
|
10
10
|
*/
|
|
11
|
-
export type ConversationErrorType = 'conversation-llm-error-text' | 'conversation-llm-empty-response' | 'conversation-500' | 'conversation-generic-network-error' | 'conversation-timeout' | 'conversation-streaming-error' | 'conversation-404' | 'conversation-403' | 'conversation-partial-load' | 'history-load-error';
|
|
11
|
+
export type ConversationErrorType = 'conversation-llm-error-text' | 'conversation-llm-empty-response' | 'conversation-500' | 'conversation-generic-network-error' | 'conversation-timeout' | 'conversation-streaming-error' | 'conversation-404' | 'conversation-403' | 'conversation-429' | 'conversation-partial-load' | 'history-load-error';
|
|
12
12
|
/** Error markdown strings that ErrorSectionDefinition recognizes */
|
|
13
13
|
export declare const ERROR_MARKDOWN: Record<ConversationErrorType, string>;
|
|
14
14
|
/** Maps HTTP status code to error type */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversationErrorTypes.d.ts","sourceRoot":"","sources":["../../../src/errors/conversationErrorTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,qBAAqB,GAC7B,6BAA6B,GAC7B,iCAAiC,GACjC,kBAAkB,GAClB,oCAAoC,GACpC,sBAAsB,GACtB,8BAA8B,GAC9B,kBAAkB,GAClB,kBAAkB,GAClB,2BAA2B,GAC3B,oBAAoB,CAAC;AAEzB,oEAAoE;AACpE,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"conversationErrorTypes.d.ts","sourceRoot":"","sources":["../../../src/errors/conversationErrorTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,qBAAqB,GAC7B,6BAA6B,GAC7B,iCAAiC,GACjC,kBAAkB,GAClB,oCAAoC,GACpC,sBAAsB,GACtB,8BAA8B,GAC9B,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,2BAA2B,GAC3B,oBAAoB,CAAC;AAEzB,oEAAoE;AACpE,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAahE,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,WACzB,MAAM,KACb,qBAiBF,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,SAAU,qBAAqB,KAAG,MAEjE,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,QAAQ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { ConversationErrorType } from './conversationErrorTypes';
|
|
|
2
2
|
/** Action identifiers for error template buttons — resolved to callbacks by the rendering component */
|
|
3
3
|
export type ErrorActionType = 'retry' | 'newConversation' | 'reload';
|
|
4
4
|
/** Icon identifiers for error templates — resolved to SVG components by the rendering component */
|
|
5
|
-
export type ErrorIconType = 'error-500' | 'timeout' | 'streaming-error' | 'not-found' | 'forbidden' | 'partial-load';
|
|
5
|
+
export type ErrorIconType = 'error-500' | 'timeout' | 'streaming-error' | 'not-found' | 'forbidden' | 'partial-load' | 'quota-exceeded';
|
|
6
6
|
export interface ErrorTemplateButton {
|
|
7
7
|
text: string;
|
|
8
8
|
/** URL for navigation (renders as a link) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorTemplates.d.ts","sourceRoot":"","sources":["../../../src/errors/errorTemplates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,uGAAuG;AACvG,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,iBAAiB,GAAG,QAAQ,CAAC;AAErE,mGAAmG;AACnG,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,WAAW,GACX,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"errorTemplates.d.ts","sourceRoot":"","sources":["../../../src/errors/errorTemplates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,uGAAuG;AACvG,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,iBAAiB,GAAG,QAAQ,CAAC;AAErE,mGAAmG;AACnG,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,WAAW,GACX,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,MAAM,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAC7C,CAAC;AAOF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,qBAAqB,EACrB,aAAa,CA+Dd,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,oBAAoB,SACzB,MAAM,cACA,sBAAsB,KACjC,aAQF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/web5-core",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.63.
|
|
4
|
+
"version": "1.63.29",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tsachis",
|
|
7
7
|
"email": "tsachis@wix.com"
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"wallaby": {
|
|
101
101
|
"autoDetect": true
|
|
102
102
|
},
|
|
103
|
-
"falconPackageHash": "
|
|
103
|
+
"falconPackageHash": "836f03a5a81dadced3a2ec88f55057ba79b7f97c5142e8587682ece3"
|
|
104
104
|
}
|