@genesislcap/ai-assistant 14.457.1 → 14.458.1-GENC-0.1
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/ai-assistant.api.json +37 -10
- package/dist/ai-assistant.d.ts +36 -4
- package/dist/dts/components/waves-indicator.d.ts +30 -0
- package/dist/dts/components/waves-indicator.d.ts.map +1 -0
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/main/main.types.d.ts +34 -4
- package/dist/dts/main/main.types.d.ts.map +1 -1
- package/dist/dts/utils/animation-exclusivity.d.ts +23 -0
- package/dist/dts/utils/animation-exclusivity.d.ts.map +1 -0
- package/dist/dts/utils/animation-exclusivity.test.d.ts +2 -0
- package/dist/dts/utils/animation-exclusivity.test.d.ts.map +1 -0
- package/dist/esm/components/waves-indicator.js +180 -0
- package/dist/esm/main/main.js +9 -6
- package/dist/esm/main/main.styles.js +38 -6
- package/dist/esm/main/main.template.js +23 -16
- package/dist/esm/main/main.types.js +34 -3
- package/dist/esm/utils/animation-exclusivity.js +33 -0
- package/dist/esm/utils/animation-exclusivity.test.js +41 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
- package/src/components/waves-indicator.ts +212 -0
- package/src/main/main.styles.ts +38 -6
- package/src/main/main.template.ts +24 -17
- package/src/main/main.ts +11 -5
- package/src/main/main.types.ts +42 -5
- package/src/utils/animation-exclusivity.test.ts +53 -0
- package/src/utils/animation-exclusivity.ts +40 -0
|
@@ -1528,12 +1528,12 @@
|
|
|
1528
1528
|
"members": [
|
|
1529
1529
|
{
|
|
1530
1530
|
"kind": "PropertySignature",
|
|
1531
|
-
"canonicalReference": "@genesislcap/ai-assistant!AiAssistantAnimationDef#
|
|
1532
|
-
"docComment": "/**\n *
|
|
1531
|
+
"canonicalReference": "@genesislcap/ai-assistant!AiAssistantAnimationDef#category:member",
|
|
1532
|
+
"docComment": "/**\n * Group heading the option is listed under in the settings multiselect.\n */\n",
|
|
1533
1533
|
"excerptTokens": [
|
|
1534
1534
|
{
|
|
1535
1535
|
"kind": "Content",
|
|
1536
|
-
"text": "
|
|
1536
|
+
"text": "category: "
|
|
1537
1537
|
},
|
|
1538
1538
|
{
|
|
1539
1539
|
"kind": "Content",
|
|
@@ -1547,7 +1547,7 @@
|
|
|
1547
1547
|
"isReadonly": false,
|
|
1548
1548
|
"isOptional": false,
|
|
1549
1549
|
"releaseTag": "Beta",
|
|
1550
|
-
"name": "
|
|
1550
|
+
"name": "category",
|
|
1551
1551
|
"propertyTypeTokenRange": {
|
|
1552
1552
|
"startIndex": 1,
|
|
1553
1553
|
"endIndex": 2
|
|
@@ -1555,12 +1555,12 @@
|
|
|
1555
1555
|
},
|
|
1556
1556
|
{
|
|
1557
1557
|
"kind": "PropertySignature",
|
|
1558
|
-
"canonicalReference": "@genesislcap/ai-assistant!AiAssistantAnimationDef#
|
|
1559
|
-
"docComment": "/**\n * Short description shown
|
|
1558
|
+
"canonicalReference": "@genesislcap/ai-assistant!AiAssistantAnimationDef#description:member",
|
|
1559
|
+
"docComment": "/**\n * Short description shown beneath the label in the categorized multiselect.\n */\n",
|
|
1560
1560
|
"excerptTokens": [
|
|
1561
1561
|
{
|
|
1562
1562
|
"kind": "Content",
|
|
1563
|
-
"text": "
|
|
1563
|
+
"text": "description: "
|
|
1564
1564
|
},
|
|
1565
1565
|
{
|
|
1566
1566
|
"kind": "Content",
|
|
@@ -1574,7 +1574,34 @@
|
|
|
1574
1574
|
"isReadonly": false,
|
|
1575
1575
|
"isOptional": false,
|
|
1576
1576
|
"releaseTag": "Beta",
|
|
1577
|
-
"name": "
|
|
1577
|
+
"name": "description",
|
|
1578
|
+
"propertyTypeTokenRange": {
|
|
1579
|
+
"startIndex": 1,
|
|
1580
|
+
"endIndex": 2
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
"kind": "PropertySignature",
|
|
1585
|
+
"canonicalReference": "@genesislcap/ai-assistant!AiAssistantAnimationDef#label:member",
|
|
1586
|
+
"docComment": "/**\n * Display label shown in the settings multiselect.\n */\n",
|
|
1587
|
+
"excerptTokens": [
|
|
1588
|
+
{
|
|
1589
|
+
"kind": "Content",
|
|
1590
|
+
"text": "label: "
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
"kind": "Content",
|
|
1594
|
+
"text": "string"
|
|
1595
|
+
},
|
|
1596
|
+
{
|
|
1597
|
+
"kind": "Content",
|
|
1598
|
+
"text": ";"
|
|
1599
|
+
}
|
|
1600
|
+
],
|
|
1601
|
+
"isReadonly": false,
|
|
1602
|
+
"isOptional": false,
|
|
1603
|
+
"releaseTag": "Beta",
|
|
1604
|
+
"name": "label",
|
|
1578
1605
|
"propertyTypeTokenRange": {
|
|
1579
1606
|
"startIndex": 1,
|
|
1580
1607
|
"endIndex": 2
|
|
@@ -2503,7 +2530,7 @@
|
|
|
2503
2530
|
{
|
|
2504
2531
|
"kind": "Variable",
|
|
2505
2532
|
"canonicalReference": "@genesislcap/ai-assistant!ANIMATION_DEFS:var",
|
|
2506
|
-
"docComment": "/**\n * Registry of all available animations with their display metadata. Adding an entry here automatically extends the {@link AiAssistantAnimation} type.\n *\n * @beta\n */\n",
|
|
2533
|
+
"docComment": "/**\n * Registry of all available animations with their display metadata. Adding an entry here automatically extends the {@link AiAssistantAnimation} type.\n *\n * @remarks\n *\n * `loading` (dots) and `waves` are two interchangeable styles of the same \"is the assistant working\" indicator and are therefore grouped under the same {@link AiAssistantAnimationDef.category}. They are mutually exclusive — see `LOADING_STYLE_ANIMATIONS`.\n *\n * @beta\n */\n",
|
|
2507
2534
|
"excerptTokens": [
|
|
2508
2535
|
{
|
|
2509
2536
|
"kind": "Content",
|
|
@@ -2511,7 +2538,7 @@
|
|
|
2511
2538
|
},
|
|
2512
2539
|
{
|
|
2513
2540
|
"kind": "Content",
|
|
2514
|
-
"text": "{\n loading: {\n label: string;\n
|
|
2541
|
+
"text": "{\n loading: {\n label: string;\n description: string;\n category: string;\n };\n waves: {\n label: string;\n description: string;\n category: string;\n };\n halo: {\n label: string;\n description: string;\n category: string;\n };\n}"
|
|
2515
2542
|
}
|
|
2516
2543
|
],
|
|
2517
2544
|
"fileUrlPath": "src/main/main.types.ts",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -280,8 +280,10 @@ export declare type AiAssistantAnimation = keyof typeof ANIMATION_DEFS;
|
|
|
280
280
|
export declare interface AiAssistantAnimationDef {
|
|
281
281
|
/** Display label shown in the settings multiselect. */
|
|
282
282
|
label: string;
|
|
283
|
-
/** Short description shown
|
|
284
|
-
|
|
283
|
+
/** Short description shown beneath the label in the categorized multiselect. */
|
|
284
|
+
description: string;
|
|
285
|
+
/** Group heading the option is listed under in the settings multiselect. */
|
|
286
|
+
category: string;
|
|
285
287
|
}
|
|
286
288
|
|
|
287
289
|
/**
|
|
@@ -438,16 +440,29 @@ declare interface AllAgentSummary {
|
|
|
438
440
|
* Registry of all available animations with their display metadata.
|
|
439
441
|
* Adding an entry here automatically extends the {@link AiAssistantAnimation} type.
|
|
440
442
|
*
|
|
443
|
+
* @remarks
|
|
444
|
+
* `loading` (dots) and `waves` are two interchangeable styles of the same
|
|
445
|
+
* "is the assistant working" indicator and are therefore grouped under the same
|
|
446
|
+
* {@link AiAssistantAnimationDef.category}. They are mutually exclusive — see
|
|
447
|
+
* `LOADING_STYLE_ANIMATIONS`.
|
|
448
|
+
*
|
|
441
449
|
* @beta
|
|
442
450
|
*/
|
|
443
451
|
export declare const ANIMATION_DEFS: {
|
|
444
452
|
loading: {
|
|
445
453
|
label: string;
|
|
446
|
-
|
|
454
|
+
description: string;
|
|
455
|
+
category: string;
|
|
456
|
+
};
|
|
457
|
+
waves: {
|
|
458
|
+
label: string;
|
|
459
|
+
description: string;
|
|
460
|
+
category: string;
|
|
447
461
|
};
|
|
448
462
|
halo: {
|
|
449
463
|
label: string;
|
|
450
|
-
|
|
464
|
+
description: string;
|
|
465
|
+
category: string;
|
|
451
466
|
};
|
|
452
467
|
};
|
|
453
468
|
|
|
@@ -1097,6 +1112,15 @@ export declare function createToolFold(config: {
|
|
|
1097
1112
|
exclusive?: boolean;
|
|
1098
1113
|
}): ToolFoldResult;
|
|
1099
1114
|
|
|
1115
|
+
/**
|
|
1116
|
+
* Animations enabled by default when a consumer opts into the animations
|
|
1117
|
+
* feature without specifying an explicit `enabled` list. Keeps the dots loading
|
|
1118
|
+
* style (the long-standing default); the waves style is opt-in.
|
|
1119
|
+
*
|
|
1120
|
+
* @internal
|
|
1121
|
+
*/
|
|
1122
|
+
export declare const DEFAULT_ANIMATIONS: AiAssistantAnimation[];
|
|
1123
|
+
|
|
1100
1124
|
/**
|
|
1101
1125
|
* Identity helper that infers the narrowest possible type for an agent config,
|
|
1102
1126
|
* preserving string literal types (including `name`) without requiring `as const`.
|
|
@@ -1806,6 +1830,14 @@ declare interface InputOverride {
|
|
|
1806
1830
|
mode: ChatInputDuringExecutionMode;
|
|
1807
1831
|
}
|
|
1808
1832
|
|
|
1833
|
+
/**
|
|
1834
|
+
* The interchangeable "assistant is working" loading-indicator styles. At most
|
|
1835
|
+
* one of these may be enabled at a time — enabling one disables the other.
|
|
1836
|
+
*
|
|
1837
|
+
* @internal
|
|
1838
|
+
*/
|
|
1839
|
+
export declare const LOADING_STYLE_ANIMATIONS: readonly ["loading", "waves"];
|
|
1840
|
+
|
|
1809
1841
|
/**
|
|
1810
1842
|
* Opts an agent in to manual selection from the assistant's agent picker.
|
|
1811
1843
|
*
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GenesisElement } from '@genesislcap/web-core';
|
|
2
|
+
/**
|
|
3
|
+
* Animated "waves inside a circle" loading indicator — coloured sine waves that
|
|
4
|
+
* slosh like glowing liquid inside a circular window, ringed by a rotating
|
|
5
|
+
* gradient halo (the same effect as `<ai-halo-overlay>`).
|
|
6
|
+
*
|
|
7
|
+
* Visual sibling of the dots loading indicator; the two are interchangeable
|
|
8
|
+
* styles of the same "assistant is working" state.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```html
|
|
12
|
+
* <ai-waves-indicator size="56"></ai-waves-indicator>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
export declare class AiWavesIndicator extends GenesisElement {
|
|
18
|
+
/** Diameter of the circular window in px. Default: 56. */
|
|
19
|
+
size: number;
|
|
20
|
+
sizeChanged(): void;
|
|
21
|
+
private frame;
|
|
22
|
+
private animFrame?;
|
|
23
|
+
private wavePaths?;
|
|
24
|
+
connectedCallback(): void;
|
|
25
|
+
disconnectedCallback(): void;
|
|
26
|
+
private tick;
|
|
27
|
+
/** Trace one wave's polyline `d` attribute for the given frame. */
|
|
28
|
+
private static buildWavePath;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=waves-indicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waves-indicator.d.ts","sourceRoot":"","sources":["../../../src/components/waves-indicator.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,cAAc,EAAQ,MAAM,uBAAuB,CAAC;AAwFvF;;;;;;;;;;;;;;GAcG;AACH,qBAkDa,gBAAiB,SAAQ,cAAc;IAClD,0DAA0D;IACC,IAAI,EAAE,MAAM,CAAsB;IAE7F,WAAW;IAQX,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC,iBAAiB;IAKjB,oBAAoB;IAQpB,OAAO,CAAC,IAAI;IAYZ,mEAAmE;IACnE,OAAO,CAAC,MAAM,CAAC,aAAa;CAY7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,6BA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
|
+
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,iDAu2BlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EAAuC,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EAAuC,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAwJpD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CAikBpC,CAAC"}
|
|
@@ -54,23 +54,38 @@ export type SuggestionsState = {
|
|
|
54
54
|
export interface AiAssistantAnimationDef {
|
|
55
55
|
/** Display label shown in the settings multiselect. */
|
|
56
56
|
label: string;
|
|
57
|
-
/** Short description shown
|
|
58
|
-
|
|
57
|
+
/** Short description shown beneath the label in the categorized multiselect. */
|
|
58
|
+
description: string;
|
|
59
|
+
/** Group heading the option is listed under in the settings multiselect. */
|
|
60
|
+
category: string;
|
|
59
61
|
}
|
|
60
62
|
/**
|
|
61
63
|
* Registry of all available animations with their display metadata.
|
|
62
64
|
* Adding an entry here automatically extends the {@link AiAssistantAnimation} type.
|
|
63
65
|
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* `loading` (dots) and `waves` are two interchangeable styles of the same
|
|
68
|
+
* "is the assistant working" indicator and are therefore grouped under the same
|
|
69
|
+
* {@link AiAssistantAnimationDef.category}. They are mutually exclusive — see
|
|
70
|
+
* `LOADING_STYLE_ANIMATIONS`.
|
|
71
|
+
*
|
|
64
72
|
* @beta
|
|
65
73
|
*/
|
|
66
74
|
export declare const ANIMATION_DEFS: {
|
|
67
75
|
loading: {
|
|
68
76
|
label: string;
|
|
69
|
-
|
|
77
|
+
description: string;
|
|
78
|
+
category: string;
|
|
79
|
+
};
|
|
80
|
+
waves: {
|
|
81
|
+
label: string;
|
|
82
|
+
description: string;
|
|
83
|
+
category: string;
|
|
70
84
|
};
|
|
71
85
|
halo: {
|
|
72
86
|
label: string;
|
|
73
|
-
|
|
87
|
+
description: string;
|
|
88
|
+
category: string;
|
|
74
89
|
};
|
|
75
90
|
};
|
|
76
91
|
/**
|
|
@@ -85,4 +100,19 @@ export type AiAssistantAnimation = keyof typeof ANIMATION_DEFS;
|
|
|
85
100
|
* @internal
|
|
86
101
|
*/
|
|
87
102
|
export declare const ALL_ANIMATIONS: AiAssistantAnimation[];
|
|
103
|
+
/**
|
|
104
|
+
* The interchangeable "assistant is working" loading-indicator styles. At most
|
|
105
|
+
* one of these may be enabled at a time — enabling one disables the other.
|
|
106
|
+
*
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
export declare const LOADING_STYLE_ANIMATIONS: readonly ["loading", "waves"];
|
|
110
|
+
/**
|
|
111
|
+
* Animations enabled by default when a consumer opts into the animations
|
|
112
|
+
* feature without specifying an explicit `enabled` list. Keeps the dots loading
|
|
113
|
+
* style (the long-standing default); the waves style is opt-in.
|
|
114
|
+
*
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
export declare const DEFAULT_ANIMATIONS: AiAssistantAnimation[];
|
|
88
118
|
//# sourceMappingURL=main.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.types.d.ts","sourceRoot":"","sources":["../../../src/main/main.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,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,EAAE,QAAQ,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,GAC3C;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;CAkBwB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,cAAc,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAkC,oBAAoB,EAAE,CAAC;AAEpF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,+BAGe,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,oBAAoB,EAAwB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AiAssistantAnimation } from '../main/main.types';
|
|
2
|
+
/**
|
|
3
|
+
* Enforces that at most one loading-indicator style (dots vs. waves) is enabled
|
|
4
|
+
* at a time. The two are alternative presentations of the same "assistant is
|
|
5
|
+
* working" state, so selecting one must deselect the other.
|
|
6
|
+
*
|
|
7
|
+
* The settings control is a multiselect (checkboxes), which permits selecting
|
|
8
|
+
* both; this resolver makes the loading-style group behave like a radio group
|
|
9
|
+
* by dropping the previously-selected style whenever a new one is added.
|
|
10
|
+
*
|
|
11
|
+
* @param next - The freshly-selected animation list (e.g. emitted by the
|
|
12
|
+
* multiselect, or read from consumer config).
|
|
13
|
+
* @param previous - The animation list in effect before this change. Used to
|
|
14
|
+
* work out which loading style was just added so the other can be dropped.
|
|
15
|
+
* Pass `[]` when resolving an initial/config value with no prior state.
|
|
16
|
+
* @returns `next` with at most one loading style retained. When both are
|
|
17
|
+
* present and neither is newly added (e.g. a misconfigured `enabled` list),
|
|
18
|
+
* the first entry of `LOADING_STYLE_ANIMATIONS` (dots) wins.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveExclusiveLoadingStyle(next: AiAssistantAnimation[], previous?: AiAssistantAnimation[]): AiAssistantAnimation[];
|
|
23
|
+
//# sourceMappingURL=animation-exclusivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation-exclusivity.d.ts","sourceRoot":"","sources":["../../../src/utils/animation-exclusivity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,oBAAoB,EAAE,EAC5B,QAAQ,GAAE,oBAAoB,EAAO,GACpC,oBAAoB,EAAE,CAaxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation-exclusivity.test.d.ts","sourceRoot":"","sources":["../../../src/utils/animation-exclusivity.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var AiWavesIndicator_1;
|
|
2
|
+
import { __decorate } from "tslib";
|
|
3
|
+
import { avoidTreeShaking } from '@genesislcap/foundation-utils';
|
|
4
|
+
import { attr, css, customElement, GenesisElement, html } from '@genesislcap/web-core';
|
|
5
|
+
import { AI_COLOUR_AMBER, AI_COLOUR_CYAN, AI_COLOUR_PINK, AI_COLOUR_VIOLET, } from '../styles/ai-colours';
|
|
6
|
+
import { AiHaloOverlay } from './halo-overlay';
|
|
7
|
+
const WAVES_DEFAULT_SIZE = 56;
|
|
8
|
+
/** CSS-ready form of `WAVES_DEFAULT_SIZE` (the `css` tag rejects raw numbers). */
|
|
9
|
+
const WAVES_DEFAULT_SIZE_CSS = `${WAVES_DEFAULT_SIZE}px`;
|
|
10
|
+
/** SVG coordinate space the waves are drawn in (square; the circle fills it). */
|
|
11
|
+
const VIEWBOX = 120;
|
|
12
|
+
const CENTRE = VIEWBOX / 2;
|
|
13
|
+
/** Horizontal sampling step when tracing each wave path. Lower = smoother. */
|
|
14
|
+
const SAMPLE_STEP = 6;
|
|
15
|
+
const WAVES = [
|
|
16
|
+
{
|
|
17
|
+
colour: AI_COLOUR_AMBER,
|
|
18
|
+
amplitude: 11,
|
|
19
|
+
frequency: 0.085,
|
|
20
|
+
phaseSpeed: 0.05,
|
|
21
|
+
verticalOffset: -6,
|
|
22
|
+
slosh: 6,
|
|
23
|
+
sloshFrequency: 0.018,
|
|
24
|
+
sloshSpeed: 0.021,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
colour: AI_COLOUR_PINK,
|
|
28
|
+
amplitude: 14,
|
|
29
|
+
frequency: 0.07,
|
|
30
|
+
phaseSpeed: -0.043,
|
|
31
|
+
verticalOffset: -2,
|
|
32
|
+
slosh: 7,
|
|
33
|
+
sloshFrequency: 0.022,
|
|
34
|
+
sloshSpeed: -0.017,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
colour: AI_COLOUR_CYAN,
|
|
38
|
+
amplitude: 13,
|
|
39
|
+
frequency: 0.095,
|
|
40
|
+
phaseSpeed: 0.037,
|
|
41
|
+
verticalOffset: 2,
|
|
42
|
+
slosh: 5,
|
|
43
|
+
sloshFrequency: 0.015,
|
|
44
|
+
sloshSpeed: 0.025,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
colour: AI_COLOUR_VIOLET,
|
|
48
|
+
amplitude: 10,
|
|
49
|
+
frequency: 0.06,
|
|
50
|
+
phaseSpeed: -0.055,
|
|
51
|
+
verticalOffset: 6,
|
|
52
|
+
slosh: 8,
|
|
53
|
+
sloshFrequency: 0.025,
|
|
54
|
+
sloshSpeed: -0.013,
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
const wavePathsMarkup = WAVES.map((w, i) => `<path class="wave" data-wave="${i}" stroke="${w.colour}" />`).join('');
|
|
58
|
+
/**
|
|
59
|
+
* Animated "waves inside a circle" loading indicator — coloured sine waves that
|
|
60
|
+
* slosh like glowing liquid inside a circular window, ringed by a rotating
|
|
61
|
+
* gradient halo (the same effect as `<ai-halo-overlay>`).
|
|
62
|
+
*
|
|
63
|
+
* Visual sibling of the dots loading indicator; the two are interchangeable
|
|
64
|
+
* styles of the same "assistant is working" state.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```html
|
|
68
|
+
* <ai-waves-indicator size="56"></ai-waves-indicator>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @beta
|
|
72
|
+
*/
|
|
73
|
+
let AiWavesIndicator = AiWavesIndicator_1 = class AiWavesIndicator extends GenesisElement {
|
|
74
|
+
constructor() {
|
|
75
|
+
super(...arguments);
|
|
76
|
+
/** Diameter of the circular window in px. Default: 56. */
|
|
77
|
+
this.size = WAVES_DEFAULT_SIZE;
|
|
78
|
+
// A rAF loop drives the wave paths for the same reason `<ai-halo-overlay>`
|
|
79
|
+
// hand-drives its rotation: a pure-CSS approach can't produce per-frame sine
|
|
80
|
+
// geometry, and SMIL/`<animate>` can't express the combined travel + slosh.
|
|
81
|
+
this.frame = 0;
|
|
82
|
+
}
|
|
83
|
+
sizeChanged() {
|
|
84
|
+
this.style.setProperty('--waves-size', `${this.size}px`);
|
|
85
|
+
}
|
|
86
|
+
connectedCallback() {
|
|
87
|
+
super.connectedCallback();
|
|
88
|
+
this.tick();
|
|
89
|
+
}
|
|
90
|
+
disconnectedCallback() {
|
|
91
|
+
super.disconnectedCallback();
|
|
92
|
+
if (this.animFrame !== undefined) {
|
|
93
|
+
cancelAnimationFrame(this.animFrame);
|
|
94
|
+
this.animFrame = undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
tick() {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
if (!this.wavePaths) {
|
|
100
|
+
const paths = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.wave');
|
|
101
|
+
if (paths === null || paths === void 0 ? void 0 : paths.length)
|
|
102
|
+
this.wavePaths = Array.from(paths);
|
|
103
|
+
}
|
|
104
|
+
(_b = this.wavePaths) === null || _b === void 0 ? void 0 : _b.forEach((path, i) => {
|
|
105
|
+
path.setAttribute('d', AiWavesIndicator_1.buildWavePath(WAVES[i], this.frame));
|
|
106
|
+
});
|
|
107
|
+
this.frame += 1;
|
|
108
|
+
this.animFrame = requestAnimationFrame(() => this.tick());
|
|
109
|
+
}
|
|
110
|
+
/** Trace one wave's polyline `d` attribute for the given frame. */
|
|
111
|
+
static buildWavePath(cfg, frame) {
|
|
112
|
+
const segments = [];
|
|
113
|
+
for (let x = 0; x <= VIEWBOX; x += SAMPLE_STEP) {
|
|
114
|
+
const y = CENTRE +
|
|
115
|
+
cfg.verticalOffset +
|
|
116
|
+
cfg.amplitude * Math.sin(x * cfg.frequency + frame * cfg.phaseSpeed) +
|
|
117
|
+
cfg.slosh * Math.sin(x * cfg.sloshFrequency + frame * cfg.sloshSpeed);
|
|
118
|
+
segments.push(`${x},${y.toFixed(2)}`);
|
|
119
|
+
}
|
|
120
|
+
return `M ${segments.join(' L ')}`;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
__decorate([
|
|
124
|
+
attr({ converter: { fromView: Number, toView: String } })
|
|
125
|
+
], AiWavesIndicator.prototype, "size", void 0);
|
|
126
|
+
AiWavesIndicator = AiWavesIndicator_1 = __decorate([
|
|
127
|
+
customElement({
|
|
128
|
+
name: 'ai-waves-indicator',
|
|
129
|
+
template: html `
|
|
130
|
+
<div class="window" role="img" aria-label="Assistant is working">
|
|
131
|
+
<svg class="waves" viewBox="0 0 ${VIEWBOX} ${VIEWBOX}" preserveAspectRatio="none">
|
|
132
|
+
<defs>
|
|
133
|
+
<filter id="wave-glow" x="-20%" y="-20%" width="140%" height="140%">
|
|
134
|
+
<feGaussianBlur stdDeviation="1.6" result="blur" />
|
|
135
|
+
<feMerge>
|
|
136
|
+
<feMergeNode in="blur" />
|
|
137
|
+
<feMergeNode in="SourceGraphic" />
|
|
138
|
+
</feMerge>
|
|
139
|
+
</filter>
|
|
140
|
+
</defs>
|
|
141
|
+
<g filter="url(#wave-glow)">${wavePathsMarkup}</g>
|
|
142
|
+
</svg>
|
|
143
|
+
<ai-halo-overlay active border-size="2" glow-opacity="0.5" glow-spread="55"></ai-halo-overlay>
|
|
144
|
+
</div>
|
|
145
|
+
`,
|
|
146
|
+
styles: css `
|
|
147
|
+
:host {
|
|
148
|
+
display: inline-block;
|
|
149
|
+
width: var(--waves-size, ${WAVES_DEFAULT_SIZE_CSS});
|
|
150
|
+
height: var(--waves-size, ${WAVES_DEFAULT_SIZE_CSS});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.window {
|
|
154
|
+
position: relative;
|
|
155
|
+
width: 100%;
|
|
156
|
+
height: 100%;
|
|
157
|
+
border-radius: 50%;
|
|
158
|
+
overflow: hidden;
|
|
159
|
+
background: radial-gradient(circle at 50% 32%, #2b3140 0%, #11141c 55%, #05070c 100%);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.waves {
|
|
163
|
+
position: absolute;
|
|
164
|
+
inset: 0;
|
|
165
|
+
width: 100%;
|
|
166
|
+
height: 100%;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.wave {
|
|
170
|
+
fill: none;
|
|
171
|
+
stroke-width: 2;
|
|
172
|
+
stroke-linecap: round;
|
|
173
|
+
stroke-linejoin: round;
|
|
174
|
+
}
|
|
175
|
+
`,
|
|
176
|
+
})
|
|
177
|
+
], AiWavesIndicator);
|
|
178
|
+
export { AiWavesIndicator };
|
|
179
|
+
// Ensure the halo overlay used for the ring is registered alongside this component.
|
|
180
|
+
avoidTreeShaking(AiHaloOverlay);
|
package/dist/esm/main/main.js
CHANGED
|
@@ -35,19 +35,21 @@ import { AiChatInteractionWrapper } from '../components/chat-interaction-wrapper
|
|
|
35
35
|
import { AiChatMarkdown } from '../components/chat-markdown/chat-markdown';
|
|
36
36
|
import { AiHaloOverlay } from '../components/halo-overlay';
|
|
37
37
|
import { OrchestratingDriver } from '../components/orchestrating-driver/orchestrating-driver';
|
|
38
|
+
import { AiWavesIndicator } from '../components/waves-indicator';
|
|
38
39
|
import { recordMetaEvent, getMetaEvents, DEBUG_LOG_README, } from '../state/debug-event-log';
|
|
39
40
|
import { getOrCreateDriver, getDriver, deleteDriver } from '../state/driver-registry';
|
|
40
41
|
import { getSessionStore, hasSessionStore } from '../state/session-store';
|
|
41
42
|
import { AI_COLOUR_AMBER, AI_COLOUR_CYAN, AI_COLOUR_PINK, AI_COLOUR_VIOLET, } from '../styles/ai-colours';
|
|
42
43
|
import { ChatSuggestions } from '../suggestions/chat-suggestions';
|
|
43
44
|
import { AnimatedPanelToggle } from '../utils/animated-panel-toggle';
|
|
45
|
+
import { resolveExclusiveLoadingStyle } from '../utils/animation-exclusivity';
|
|
44
46
|
import { logger } from '../utils/logger';
|
|
45
47
|
import { filterVisibleMessages, trailingInteractionRow } from '../utils/message-partition';
|
|
46
48
|
import { sumCosts } from '../utils/sum-costs';
|
|
47
49
|
import { expandToolTree } from '../utils/tool-fold';
|
|
48
50
|
import { styles } from './main.styles';
|
|
49
51
|
import { FoundationAiAssistantTemplate } from './main.template';
|
|
50
|
-
import {
|
|
52
|
+
import { DEFAULT_ANIMATIONS } from './main.types';
|
|
51
53
|
/** Context window sizes (in tokens) for known models. */
|
|
52
54
|
/**
|
|
53
55
|
* Pin tint palette, cycled by agent position. Matches the four brand colours
|
|
@@ -90,7 +92,7 @@ const COMPOSER_MAX_HEIGHT_PX = 400;
|
|
|
90
92
|
/** Keep at least this much of the message list visible while growing the composer. */
|
|
91
93
|
const COMPOSER_MIN_MESSAGES_PX = 80;
|
|
92
94
|
// Register supporting components when the main component module is imported.
|
|
93
|
-
avoidTreeShaking(AiChatMarkdown, AiChatInteractionWrapper, AiHaloOverlay, AiChatBubble, AiActivityHalo, ChatSuggestions, AgentPicker);
|
|
95
|
+
avoidTreeShaking(AiChatMarkdown, AiChatInteractionWrapper, AiHaloOverlay, AiWavesIndicator, AiChatBubble, AiActivityHalo, ChatSuggestions, AgentPicker);
|
|
94
96
|
/**
|
|
95
97
|
* Recursively strips non-serializable fields from an agent before storing in Redux:
|
|
96
98
|
* - `toolHandlers` (functions),
|
|
@@ -911,8 +913,7 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
911
913
|
this.showToolCalls = ui.showToolCalls === true;
|
|
912
914
|
this.showThinkingSteps = ui.showThinkingSteps === true;
|
|
913
915
|
this.showAgentSwitchIndicator = ui.showAgentSwitchIndicator === true;
|
|
914
|
-
this.enabledAnimations =
|
|
915
|
-
(_c = (_b = ui.animations) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : (ui.animations ? [...ALL_ANIMATIONS] : []);
|
|
916
|
+
this.enabledAnimations = resolveExclusiveLoadingStyle((_c = (_b = ui.animations) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : (ui.animations ? [...DEFAULT_ANIMATIONS] : []));
|
|
916
917
|
const defaultAgent = (_d = this.chatConfig.picker) === null || _d === void 0 ? void 0 : _d.defaultAgent;
|
|
917
918
|
if (defaultAgent && ((_e = this.agents) !== null && _e !== void 0 ? _e : []).some((a) => a.name === defaultAgent)) {
|
|
918
919
|
this.pinnedAgentName = defaultAgent;
|
|
@@ -1334,7 +1335,9 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
1334
1335
|
this.showAgentSwitchIndicator = !this.showAgentSwitchIndicator;
|
|
1335
1336
|
}
|
|
1336
1337
|
setEnabledAnimations(animations) {
|
|
1337
|
-
|
|
1338
|
+
// The dots and waves loading styles are mutually exclusive — enabling one
|
|
1339
|
+
// disables the other (see resolveExclusiveLoadingStyle).
|
|
1340
|
+
this.enabledAnimations = resolveExclusiveLoadingStyle(animations, this.enabledAnimations);
|
|
1338
1341
|
}
|
|
1339
1342
|
getDebugLog() {
|
|
1340
1343
|
var _a, _b, _c, _d, _e, _f, _j, _k, _l, _m, _o, _p, _q;
|
|
@@ -1822,7 +1825,7 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
1822
1825
|
FoundationAiAssistant.SCROLL_BOTTOM_THRESHOLD_PX = 50;
|
|
1823
1826
|
/** Context-usage percentage that fires the one-shot `context.threshold-crossed` event. */
|
|
1824
1827
|
FoundationAiAssistant.CONTEXT_USAGE_WARN_PERCENT = 80;
|
|
1825
|
-
FoundationAiAssistant.DEFAULT_LOADING_DELAY_S =
|
|
1828
|
+
FoundationAiAssistant.DEFAULT_LOADING_DELAY_S = 0;
|
|
1826
1829
|
FoundationAiAssistant.DEFAULT_SUGGESTION_COUNT = 3;
|
|
1827
1830
|
FoundationAiAssistant.MS_PER_SECOND = 1000;
|
|
1828
1831
|
__decorate([
|