@genesislcap/ai-assistant 14.457.0 → 14.457.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 +233 -0
- package/dist/ai-assistant.d.ts +31 -0
- package/dist/dts/main/main.d.ts +28 -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/esm/main/main.js +48 -0
- package/dist/esm/main/main.styles.js +23 -4
- package/dist/esm/main/main.template.js +41 -33
- package/package.json +16 -16
- package/src/main/main.styles.ts +23 -4
- package/src/main/main.template.ts +47 -45
- package/src/main/main.ts +57 -0
|
@@ -4576,6 +4576,67 @@
|
|
|
4576
4576
|
"isProtected": false,
|
|
4577
4577
|
"isAbstract": false
|
|
4578
4578
|
},
|
|
4579
|
+
{
|
|
4580
|
+
"kind": "Property",
|
|
4581
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#assistantIcon:member",
|
|
4582
|
+
"docComment": "/**\n * Inline SVG markup overriding the default assistant \"sparkle\" avatar. The markup is sanitized (SVG profile) before rendering and uses the avatar's theme colour via `currentColor`. For a raster/photo avatar set `imageSrc` instead, which takes precedence. Set to `genesisIconSvg` to restore the Genesis G-mark.\n */\n",
|
|
4583
|
+
"excerptTokens": [
|
|
4584
|
+
{
|
|
4585
|
+
"kind": "Content",
|
|
4586
|
+
"text": "assistantIcon?: "
|
|
4587
|
+
},
|
|
4588
|
+
{
|
|
4589
|
+
"kind": "Content",
|
|
4590
|
+
"text": "string"
|
|
4591
|
+
},
|
|
4592
|
+
{
|
|
4593
|
+
"kind": "Content",
|
|
4594
|
+
"text": ";"
|
|
4595
|
+
}
|
|
4596
|
+
],
|
|
4597
|
+
"isReadonly": false,
|
|
4598
|
+
"isOptional": true,
|
|
4599
|
+
"releaseTag": "Beta",
|
|
4600
|
+
"name": "assistantIcon",
|
|
4601
|
+
"propertyTypeTokenRange": {
|
|
4602
|
+
"startIndex": 1,
|
|
4603
|
+
"endIndex": 2
|
|
4604
|
+
},
|
|
4605
|
+
"isStatic": false,
|
|
4606
|
+
"isProtected": false,
|
|
4607
|
+
"isAbstract": false
|
|
4608
|
+
},
|
|
4609
|
+
{
|
|
4610
|
+
"kind": "Method",
|
|
4611
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#assistantIconChanged:member(1)",
|
|
4612
|
+
"docComment": "",
|
|
4613
|
+
"excerptTokens": [
|
|
4614
|
+
{
|
|
4615
|
+
"kind": "Content",
|
|
4616
|
+
"text": "protected assistantIconChanged(): "
|
|
4617
|
+
},
|
|
4618
|
+
{
|
|
4619
|
+
"kind": "Content",
|
|
4620
|
+
"text": "void"
|
|
4621
|
+
},
|
|
4622
|
+
{
|
|
4623
|
+
"kind": "Content",
|
|
4624
|
+
"text": ";"
|
|
4625
|
+
}
|
|
4626
|
+
],
|
|
4627
|
+
"isStatic": false,
|
|
4628
|
+
"returnTypeTokenRange": {
|
|
4629
|
+
"startIndex": 1,
|
|
4630
|
+
"endIndex": 2
|
|
4631
|
+
},
|
|
4632
|
+
"releaseTag": "Beta",
|
|
4633
|
+
"isProtected": true,
|
|
4634
|
+
"overloadIndex": 1,
|
|
4635
|
+
"parameters": [],
|
|
4636
|
+
"isOptional": false,
|
|
4637
|
+
"isAbstract": false,
|
|
4638
|
+
"name": "assistantIconChanged"
|
|
4639
|
+
},
|
|
4579
4640
|
{
|
|
4580
4641
|
"kind": "Property",
|
|
4581
4642
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#attachmentErrors:member",
|
|
@@ -7485,6 +7546,97 @@
|
|
|
7485
7546
|
"isAbstract": false,
|
|
7486
7547
|
"name": "triggerFileInput"
|
|
7487
7548
|
},
|
|
7549
|
+
{
|
|
7550
|
+
"kind": "Property",
|
|
7551
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#userIcon:member",
|
|
7552
|
+
"docComment": "/**\n * Inline SVG markup overriding the default user \"person\" avatar. The markup is sanitized (SVG profile) before rendering and uses the avatar's theme colour via `currentColor`. For a raster/photo avatar set `userImageSrc` instead, which takes precedence.\n */\n",
|
|
7553
|
+
"excerptTokens": [
|
|
7554
|
+
{
|
|
7555
|
+
"kind": "Content",
|
|
7556
|
+
"text": "userIcon?: "
|
|
7557
|
+
},
|
|
7558
|
+
{
|
|
7559
|
+
"kind": "Content",
|
|
7560
|
+
"text": "string"
|
|
7561
|
+
},
|
|
7562
|
+
{
|
|
7563
|
+
"kind": "Content",
|
|
7564
|
+
"text": ";"
|
|
7565
|
+
}
|
|
7566
|
+
],
|
|
7567
|
+
"isReadonly": false,
|
|
7568
|
+
"isOptional": true,
|
|
7569
|
+
"releaseTag": "Beta",
|
|
7570
|
+
"name": "userIcon",
|
|
7571
|
+
"propertyTypeTokenRange": {
|
|
7572
|
+
"startIndex": 1,
|
|
7573
|
+
"endIndex": 2
|
|
7574
|
+
},
|
|
7575
|
+
"isStatic": false,
|
|
7576
|
+
"isProtected": false,
|
|
7577
|
+
"isAbstract": false
|
|
7578
|
+
},
|
|
7579
|
+
{
|
|
7580
|
+
"kind": "Method",
|
|
7581
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#userIconChanged:member(1)",
|
|
7582
|
+
"docComment": "",
|
|
7583
|
+
"excerptTokens": [
|
|
7584
|
+
{
|
|
7585
|
+
"kind": "Content",
|
|
7586
|
+
"text": "protected userIconChanged(): "
|
|
7587
|
+
},
|
|
7588
|
+
{
|
|
7589
|
+
"kind": "Content",
|
|
7590
|
+
"text": "void"
|
|
7591
|
+
},
|
|
7592
|
+
{
|
|
7593
|
+
"kind": "Content",
|
|
7594
|
+
"text": ";"
|
|
7595
|
+
}
|
|
7596
|
+
],
|
|
7597
|
+
"isStatic": false,
|
|
7598
|
+
"returnTypeTokenRange": {
|
|
7599
|
+
"startIndex": 1,
|
|
7600
|
+
"endIndex": 2
|
|
7601
|
+
},
|
|
7602
|
+
"releaseTag": "Beta",
|
|
7603
|
+
"isProtected": true,
|
|
7604
|
+
"overloadIndex": 1,
|
|
7605
|
+
"parameters": [],
|
|
7606
|
+
"isOptional": false,
|
|
7607
|
+
"isAbstract": false,
|
|
7608
|
+
"name": "userIconChanged"
|
|
7609
|
+
},
|
|
7610
|
+
{
|
|
7611
|
+
"kind": "Property",
|
|
7612
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#userImageSrc:member",
|
|
7613
|
+
"docComment": "",
|
|
7614
|
+
"excerptTokens": [
|
|
7615
|
+
{
|
|
7616
|
+
"kind": "Content",
|
|
7617
|
+
"text": "userImageSrc?: "
|
|
7618
|
+
},
|
|
7619
|
+
{
|
|
7620
|
+
"kind": "Content",
|
|
7621
|
+
"text": "string"
|
|
7622
|
+
},
|
|
7623
|
+
{
|
|
7624
|
+
"kind": "Content",
|
|
7625
|
+
"text": ";"
|
|
7626
|
+
}
|
|
7627
|
+
],
|
|
7628
|
+
"isReadonly": false,
|
|
7629
|
+
"isOptional": true,
|
|
7630
|
+
"releaseTag": "Beta",
|
|
7631
|
+
"name": "userImageSrc",
|
|
7632
|
+
"propertyTypeTokenRange": {
|
|
7633
|
+
"startIndex": 1,
|
|
7634
|
+
"endIndex": 2
|
|
7635
|
+
},
|
|
7636
|
+
"isStatic": false,
|
|
7637
|
+
"isProtected": false,
|
|
7638
|
+
"isAbstract": false
|
|
7639
|
+
},
|
|
7488
7640
|
{
|
|
7489
7641
|
"kind": "Property",
|
|
7490
7642
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#visibleMessages:member",
|
|
@@ -7822,6 +7974,33 @@
|
|
|
7822
7974
|
"endIndex": 2
|
|
7823
7975
|
}
|
|
7824
7976
|
},
|
|
7977
|
+
{
|
|
7978
|
+
"kind": "Variable",
|
|
7979
|
+
"canonicalReference": "@genesislcap/ai-assistant!genesisIconSvg:var",
|
|
7980
|
+
"docComment": "/**\n * Genesis G-mark — opt-in assistant avatar (the default before the sparkle mark).\n */\n",
|
|
7981
|
+
"excerptTokens": [
|
|
7982
|
+
{
|
|
7983
|
+
"kind": "Content",
|
|
7984
|
+
"text": "genesisIconSvg = "
|
|
7985
|
+
},
|
|
7986
|
+
{
|
|
7987
|
+
"kind": "Content",
|
|
7988
|
+
"text": "\"<svg viewBox=\\\"-4 0 30 26\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M18.7702 23.0437C18.7702 22.4675 18.8526 21.8089 19.0995 21.3149C19.3465 20.7386 19.6758 20.2447 20.0874 19.833C20.4991 19.4214 20.993 19.0921 21.5693 18.8451C22.1456 18.5982 22.7219 18.5158 23.2981 18.5158H25.9326V11.6828H19.1819V14.3172C19.1819 15.5521 18.6879 16.7047 17.8647 17.5279C17.0414 18.3512 15.8888 18.8451 14.7363 18.9275H6.7507V6.99025H16.4651V0.157227H3.54C2.63442 0.157227 1.72884 0.568855 1.07023 1.22746C0.411628 1.88606 0 2.79165 0 3.77955V22.2205C0 23.1261 0.411628 24.0316 1.07023 24.7726C1.72884 25.4312 2.63442 25.8428 3.54 25.8428H18.7702V23.0437Z\\\" fill=\\\"currentColor\\\"/></svg>\""
|
|
7989
|
+
}
|
|
7990
|
+
],
|
|
7991
|
+
"fileUrlPath": "src/main/main.ts",
|
|
7992
|
+
"initializerTokenRange": {
|
|
7993
|
+
"startIndex": 1,
|
|
7994
|
+
"endIndex": 2
|
|
7995
|
+
},
|
|
7996
|
+
"isReadonly": true,
|
|
7997
|
+
"releaseTag": "Public",
|
|
7998
|
+
"name": "genesisIconSvg",
|
|
7999
|
+
"variableTypeTokenRange": {
|
|
8000
|
+
"startIndex": 0,
|
|
8001
|
+
"endIndex": 0
|
|
8002
|
+
}
|
|
8003
|
+
},
|
|
7825
8004
|
{
|
|
7826
8005
|
"kind": "Function",
|
|
7827
8006
|
"canonicalReference": "@genesislcap/ai-assistant!getAiPopoutManager:function(1)",
|
|
@@ -8859,6 +9038,33 @@
|
|
|
8859
9038
|
"endIndex": 0
|
|
8860
9039
|
}
|
|
8861
9040
|
},
|
|
9041
|
+
{
|
|
9042
|
+
"kind": "Variable",
|
|
9043
|
+
"canonicalReference": "@genesislcap/ai-assistant!sparkleIconSvg:var",
|
|
9044
|
+
"docComment": "/**\n * Three-star AI \"sparkle\" mark — the conventional AI signifier; default assistant avatar.\n */\n",
|
|
9045
|
+
"excerptTokens": [
|
|
9046
|
+
{
|
|
9047
|
+
"kind": "Content",
|
|
9048
|
+
"text": "sparkleIconSvg = "
|
|
9049
|
+
},
|
|
9050
|
+
{
|
|
9051
|
+
"kind": "Content",
|
|
9052
|
+
"text": "\"<svg viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M9.5 5 C9.5 11.4 11.1 13 17.5 13 C11.1 13 9.5 14.6 9.5 21 C9.5 14.6 7.9 13 1.5 13 C7.9 13 9.5 11.4 9.5 5 Z\\\" fill=\\\"currentColor\\\"/><path d=\\\"M17 2.5 C17 5.7 17.8 6.5 21 6.5 C17.8 6.5 17 7.3 17 10.5 C17 7.3 16.2 6.5 13 6.5 C16.2 6.5 17 5.7 17 2.5 Z\\\" fill=\\\"currentColor\\\"/><path d=\\\"M17.5 15 C17.5 17 18 17.5 20 17.5 C18 17.5 17.5 18 17.5 20 C17.5 18 17 17.5 15 17.5 C17 17.5 17.5 17 17.5 15 Z\\\" fill=\\\"currentColor\\\"/></svg>\""
|
|
9053
|
+
}
|
|
9054
|
+
],
|
|
9055
|
+
"fileUrlPath": "src/main/main.ts",
|
|
9056
|
+
"initializerTokenRange": {
|
|
9057
|
+
"startIndex": 1,
|
|
9058
|
+
"endIndex": 2
|
|
9059
|
+
},
|
|
9060
|
+
"isReadonly": true,
|
|
9061
|
+
"releaseTag": "Public",
|
|
9062
|
+
"name": "sparkleIconSvg",
|
|
9063
|
+
"variableTypeTokenRange": {
|
|
9064
|
+
"startIndex": 0,
|
|
9065
|
+
"endIndex": 0
|
|
9066
|
+
}
|
|
9067
|
+
},
|
|
8862
9068
|
{
|
|
8863
9069
|
"kind": "Interface",
|
|
8864
9070
|
"canonicalReference": "@genesislcap/ai-assistant!SpecialistAgentConfig:interface",
|
|
@@ -10686,6 +10892,33 @@
|
|
|
10686
10892
|
}
|
|
10687
10893
|
],
|
|
10688
10894
|
"extendsTokenRanges": []
|
|
10895
|
+
},
|
|
10896
|
+
{
|
|
10897
|
+
"kind": "Variable",
|
|
10898
|
+
"canonicalReference": "@genesislcap/ai-assistant!userIconSvg:var",
|
|
10899
|
+
"docComment": "/**\n * Person silhouette — default user avatar.\n */\n",
|
|
10900
|
+
"excerptTokens": [
|
|
10901
|
+
{
|
|
10902
|
+
"kind": "Content",
|
|
10903
|
+
"text": "userIconSvg = "
|
|
10904
|
+
},
|
|
10905
|
+
{
|
|
10906
|
+
"kind": "Content",
|
|
10907
|
+
"text": "\"<svg viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\\\" fill=\\\"currentColor\\\"/></svg>\""
|
|
10908
|
+
}
|
|
10909
|
+
],
|
|
10910
|
+
"fileUrlPath": "src/main/main.ts",
|
|
10911
|
+
"initializerTokenRange": {
|
|
10912
|
+
"startIndex": 1,
|
|
10913
|
+
"endIndex": 2
|
|
10914
|
+
},
|
|
10915
|
+
"isReadonly": true,
|
|
10916
|
+
"releaseTag": "Public",
|
|
10917
|
+
"name": "userIconSvg",
|
|
10918
|
+
"variableTypeTokenRange": {
|
|
10919
|
+
"startIndex": 0,
|
|
10920
|
+
"endIndex": 0
|
|
10921
|
+
}
|
|
10689
10922
|
}
|
|
10690
10923
|
]
|
|
10691
10924
|
}
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -1188,6 +1188,28 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
1188
1188
|
designSystemPrefix: string;
|
|
1189
1189
|
headerTitle: string;
|
|
1190
1190
|
imageSrc?: string;
|
|
1191
|
+
userImageSrc?: string;
|
|
1192
|
+
/**
|
|
1193
|
+
* Inline SVG markup overriding the default assistant "sparkle" avatar. The
|
|
1194
|
+
* markup is sanitized (SVG profile) before rendering and uses the avatar's
|
|
1195
|
+
* theme colour via `currentColor`. For a raster/photo avatar set `imageSrc`
|
|
1196
|
+
* instead, which takes precedence. Set to `genesisIconSvg` to restore the
|
|
1197
|
+
* Genesis G-mark.
|
|
1198
|
+
*/
|
|
1199
|
+
assistantIcon?: string;
|
|
1200
|
+
/** Sanitized `assistantIcon`, or the default sparkle mark; bound into the template. @internal */
|
|
1201
|
+
assistantIconSafe: string;
|
|
1202
|
+
protected assistantIconChanged(): void;
|
|
1203
|
+
/**
|
|
1204
|
+
* Inline SVG markup overriding the default user "person" avatar. The markup is
|
|
1205
|
+
* sanitized (SVG profile) before rendering and uses the avatar's theme colour
|
|
1206
|
+
* via `currentColor`. For a raster/photo avatar set `userImageSrc` instead,
|
|
1207
|
+
* which takes precedence.
|
|
1208
|
+
*/
|
|
1209
|
+
userIcon?: string;
|
|
1210
|
+
/** Sanitized `userIcon`, or the default person mark; bound into the template. @internal */
|
|
1211
|
+
userIconSafe: string;
|
|
1212
|
+
protected userIconChanged(): void;
|
|
1191
1213
|
placeholder: string;
|
|
1192
1214
|
/**
|
|
1193
1215
|
* Controls the pop-out button shown next to the settings cog.
|
|
@@ -1757,6 +1779,9 @@ export declare class FoundationAiPopoutManager extends GenesisElement {
|
|
|
1757
1779
|
*/
|
|
1758
1780
|
export declare const friendlyFallbackAgent: FallbackAgentConfig;
|
|
1759
1781
|
|
|
1782
|
+
/** Genesis G-mark — opt-in assistant avatar (the default before the sparkle mark). */
|
|
1783
|
+
export declare const genesisIconSvg = "<svg viewBox=\"-4 0 30 26\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18.7702 23.0437C18.7702 22.4675 18.8526 21.8089 19.0995 21.3149C19.3465 20.7386 19.6758 20.2447 20.0874 19.833C20.4991 19.4214 20.993 19.0921 21.5693 18.8451C22.1456 18.5982 22.7219 18.5158 23.2981 18.5158H25.9326V11.6828H19.1819V14.3172C19.1819 15.5521 18.6879 16.7047 17.8647 17.5279C17.0414 18.3512 15.8888 18.8451 14.7363 18.9275H6.7507V6.99025H16.4651V0.157227H3.54C2.63442 0.157227 1.72884 0.568855 1.07023 1.22746C0.411628 1.88606 0 2.79165 0 3.77955V22.2205C0 23.1261 0.411628 24.0316 1.07023 24.7726C1.72884 25.4312 2.63442 25.8428 3.54 25.8428H18.7702V23.0437Z\" fill=\"currentColor\"/></svg>";
|
|
1784
|
+
|
|
1760
1785
|
/**
|
|
1761
1786
|
* Returns the active `FoundationAiPopoutManager` instance, or `undefined` if none is mounted.
|
|
1762
1787
|
* Import this in pages to call `registerDockProvider` / `deregisterDockProvider`.
|
|
@@ -1981,6 +2006,9 @@ export declare type ProviderInput = string | ((ctx: SystemPromptContext) => stri
|
|
|
1981
2006
|
/** Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver. */
|
|
1982
2007
|
export declare const REQUEST_CONTINUATION_TOOL = "request_continuation";
|
|
1983
2008
|
|
|
2009
|
+
/** Three-star AI "sparkle" mark — the conventional AI signifier; default assistant avatar. */
|
|
2010
|
+
export declare const sparkleIconSvg = "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.5 5 C9.5 11.4 11.1 13 17.5 13 C11.1 13 9.5 14.6 9.5 21 C9.5 14.6 7.9 13 1.5 13 C7.9 13 9.5 11.4 9.5 5 Z\" fill=\"currentColor\"/><path d=\"M17 2.5 C17 5.7 17.8 6.5 21 6.5 C17.8 6.5 17 7.3 17 10.5 C17 7.3 16.2 6.5 13 6.5 C16.2 6.5 17 5.7 17 2.5 Z\" fill=\"currentColor\"/><path d=\"M17.5 15 C17.5 17 18 17.5 20 17.5 C18 17.5 17.5 18 17.5 20 C17.5 18 17 17.5 15 17.5 C17 17.5 17.5 17 17.5 15 Z\" fill=\"currentColor\"/></svg>";
|
|
2011
|
+
|
|
1984
2012
|
/**
|
|
1985
2013
|
* Configuration for a specialist agent.
|
|
1986
2014
|
*
|
|
@@ -2373,4 +2401,7 @@ export declare interface TurnSnapshot {
|
|
|
2373
2401
|
agentSnapshot?: unknown;
|
|
2374
2402
|
}
|
|
2375
2403
|
|
|
2404
|
+
/** Person silhouette — default user avatar. */
|
|
2405
|
+
export declare const userIconSvg = "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\" fill=\"currentColor\"/></svg>";
|
|
2406
|
+
|
|
2376
2407
|
export { }
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -4,6 +4,12 @@ import { GenesisElement } from '@genesislcap/web-core';
|
|
|
4
4
|
import type { AgentConfig } from '../config/config';
|
|
5
5
|
import { type MetaEventType } from '../state/debug-event-log';
|
|
6
6
|
import type { AgentPickerMode, AiAssistantAnimation, AiAssistantState, PopoutMode, SubmitMessageResult, SuggestionsState } from './main.types';
|
|
7
|
+
/** Three-star AI "sparkle" mark — the conventional AI signifier; default assistant avatar. */
|
|
8
|
+
export declare const sparkleIconSvg = "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.5 5 C9.5 11.4 11.1 13 17.5 13 C11.1 13 9.5 14.6 9.5 21 C9.5 14.6 7.9 13 1.5 13 C7.9 13 9.5 11.4 9.5 5 Z\" fill=\"currentColor\"/><path d=\"M17 2.5 C17 5.7 17.8 6.5 21 6.5 C17.8 6.5 17 7.3 17 10.5 C17 7.3 16.2 6.5 13 6.5 C16.2 6.5 17 5.7 17 2.5 Z\" fill=\"currentColor\"/><path d=\"M17.5 15 C17.5 17 18 17.5 20 17.5 C18 17.5 17.5 18 17.5 20 C17.5 18 17 17.5 15 17.5 C17 17.5 17.5 17 17.5 15 Z\" fill=\"currentColor\"/></svg>";
|
|
9
|
+
/** Person silhouette — default user avatar. */
|
|
10
|
+
export declare const userIconSvg = "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\" fill=\"currentColor\"/></svg>";
|
|
11
|
+
/** Genesis G-mark — opt-in assistant avatar (the default before the sparkle mark). */
|
|
12
|
+
export declare const genesisIconSvg = "<svg viewBox=\"-4 0 30 26\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18.7702 23.0437C18.7702 22.4675 18.8526 21.8089 19.0995 21.3149C19.3465 20.7386 19.6758 20.2447 20.0874 19.833C20.4991 19.4214 20.993 19.0921 21.5693 18.8451C22.1456 18.5982 22.7219 18.5158 23.2981 18.5158H25.9326V11.6828H19.1819V14.3172C19.1819 15.5521 18.6879 16.7047 17.8647 17.5279C17.0414 18.3512 15.8888 18.8451 14.7363 18.9275H6.7507V6.99025H16.4651V0.157227H3.54C2.63442 0.157227 1.72884 0.568855 1.07023 1.22746C0.411628 1.88606 0 2.79165 0 3.77955V22.2205C0 23.1261 0.411628 24.0316 1.07023 24.7726C1.72884 25.4312 2.63442 25.8428 3.54 25.8428H18.7702V23.0437Z\" fill=\"currentColor\"/></svg>";
|
|
7
13
|
/**
|
|
8
14
|
* Foundation AI Assistant component.
|
|
9
15
|
*
|
|
@@ -26,6 +32,28 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
26
32
|
designSystemPrefix: string;
|
|
27
33
|
headerTitle: string;
|
|
28
34
|
imageSrc?: string;
|
|
35
|
+
userImageSrc?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Inline SVG markup overriding the default assistant "sparkle" avatar. The
|
|
38
|
+
* markup is sanitized (SVG profile) before rendering and uses the avatar's
|
|
39
|
+
* theme colour via `currentColor`. For a raster/photo avatar set `imageSrc`
|
|
40
|
+
* instead, which takes precedence. Set to `genesisIconSvg` to restore the
|
|
41
|
+
* Genesis G-mark.
|
|
42
|
+
*/
|
|
43
|
+
assistantIcon?: string;
|
|
44
|
+
/** Sanitized `assistantIcon`, or the default sparkle mark; bound into the template. @internal */
|
|
45
|
+
assistantIconSafe: string;
|
|
46
|
+
protected assistantIconChanged(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Inline SVG markup overriding the default user "person" avatar. The markup is
|
|
49
|
+
* sanitized (SVG profile) before rendering and uses the avatar's theme colour
|
|
50
|
+
* via `currentColor`. For a raster/photo avatar set `userImageSrc` instead,
|
|
51
|
+
* which takes precedence.
|
|
52
|
+
*/
|
|
53
|
+
userIcon?: string;
|
|
54
|
+
/** Sanitized `userIcon`, or the default person mark; bound into the template. @internal */
|
|
55
|
+
userIconSafe: string;
|
|
56
|
+
protected userIconChanged(): void;
|
|
29
57
|
placeholder: string;
|
|
30
58
|
/**
|
|
31
59
|
* Controls the pop-out button shown next to the settings cog.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAGL,cAAc,EAIf,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"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IAAI;IAIlD,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAU5C,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,cAAc;YASR,YAAY;YAoCZ,iBAAiB;IAe/B,eAAe;IAIf;;;;OAIG;IACH,eAAe;IAOf,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAKxC;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,aAAa,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;YA0C7E,gBAAgB;YA6DhB,IAAI;IAgDlB,qBAAqB,CAAC,CAAC,EAAE,UAAU;IAYnC,0BAA0B,CAAC,CAAC,EAAE,KAAK;IASnC;iFAC6E;IAC7E,IAAI,mBAAmB,IAAI,OAAO,CAEjC;IAED;;;iCAG6B;IAC7B,IAAI,mBAAmB,IAAI,MAAM,CAIhC;IAED;iEAC6D;IAC7D,qBAAqB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IAoB5C;;;qDAGiD;IACjD,oBAAoB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IAS3C,yDAAyD;IACzD,mBAAmB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;CAI3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,iDAu0BlB,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;AA2JpD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CAujBpC,CAAC"}
|
package/dist/esm/main/main.js
CHANGED
|
@@ -25,6 +25,7 @@ import { __awaiter, __decorate, __rest } from "tslib";
|
|
|
25
25
|
import { AIProviderRegistry } from '@genesislcap/foundation-ai';
|
|
26
26
|
import { avoidTreeShaking } from '@genesislcap/foundation-utils';
|
|
27
27
|
import { customElement, html, GenesisElement, observable, volatile, attr, } from '@genesislcap/web-core';
|
|
28
|
+
import DOMPurify from 'dompurify';
|
|
28
29
|
import { agenticActivityBus } from '../channel/ai-activity-bus';
|
|
29
30
|
import { AiActivityHalo } from '../components/activity-halo/activity-halo';
|
|
30
31
|
import { AgentPicker } from '../components/agent-picker/agent-picker';
|
|
@@ -53,6 +54,26 @@ import { ALL_ANIMATIONS } from './main.types';
|
|
|
53
54
|
* used by the halo overlay and loading dots.
|
|
54
55
|
*/
|
|
55
56
|
const PIN_COLOURS = [AI_COLOUR_AMBER, AI_COLOUR_PINK, AI_COLOUR_CYAN, AI_COLOUR_VIOLET];
|
|
57
|
+
// ─── Avatar icons ─────────────────────────────────────────────────────────────
|
|
58
|
+
// Inline SVG bundled as strings — no runtime asset dependency. They use
|
|
59
|
+
// `fill="currentColor"` so they inherit the avatar's theme colour (unlike an
|
|
60
|
+
// `image-src`, whose SVG would render in an isolated context). Exported so an
|
|
61
|
+
// app can restore a specific mark via the `assistantIcon` / `userIcon`
|
|
62
|
+
// properties, e.g. `el.assistantIcon = genesisIconSvg`.
|
|
63
|
+
/** Three-star AI "sparkle" mark — the conventional AI signifier; default assistant avatar. */
|
|
64
|
+
export const sparkleIconSvg = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.5 5 C9.5 11.4 11.1 13 17.5 13 C11.1 13 9.5 14.6 9.5 21 C9.5 14.6 7.9 13 1.5 13 C7.9 13 9.5 11.4 9.5 5 Z" fill="currentColor"/><path d="M17 2.5 C17 5.7 17.8 6.5 21 6.5 C17.8 6.5 17 7.3 17 10.5 C17 7.3 16.2 6.5 13 6.5 C16.2 6.5 17 5.7 17 2.5 Z" fill="currentColor"/><path d="M17.5 15 C17.5 17 18 17.5 20 17.5 C18 17.5 17.5 18 17.5 20 C17.5 18 17 17.5 15 17.5 C17 17.5 17.5 17 17.5 15 Z" fill="currentColor"/></svg>`;
|
|
65
|
+
/** Person silhouette — default user avatar. */
|
|
66
|
+
export const userIconSvg = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" fill="currentColor"/></svg>`;
|
|
67
|
+
/** Genesis G-mark — opt-in assistant avatar (the default before the sparkle mark). */
|
|
68
|
+
export const genesisIconSvg = `<svg viewBox="-4 0 30 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.7702 23.0437C18.7702 22.4675 18.8526 21.8089 19.0995 21.3149C19.3465 20.7386 19.6758 20.2447 20.0874 19.833C20.4991 19.4214 20.993 19.0921 21.5693 18.8451C22.1456 18.5982 22.7219 18.5158 23.2981 18.5158H25.9326V11.6828H19.1819V14.3172C19.1819 15.5521 18.6879 16.7047 17.8647 17.5279C17.0414 18.3512 15.8888 18.8451 14.7363 18.9275H6.7507V6.99025H16.4651V0.157227H3.54C2.63442 0.157227 1.72884 0.568855 1.07023 1.22746C0.411628 1.88606 0 2.79165 0 3.77955V22.2205C0 23.1261 0.411628 24.0316 1.07023 24.7726C1.72884 25.4312 2.63442 25.8428 3.54 25.8428H18.7702V23.0437Z" fill="currentColor"/></svg>`;
|
|
69
|
+
/**
|
|
70
|
+
* Sanitize caller-supplied avatar markup. Restricted to the SVG profile so an
|
|
71
|
+
* icon override can only ever contribute inline vector markup — never arbitrary
|
|
72
|
+
* HTML or script. Mirrors the DOMPurify usage in `ai-chat-markdown`.
|
|
73
|
+
*/
|
|
74
|
+
function sanitizeIconMarkup(markup) {
|
|
75
|
+
return DOMPurify.sanitize(markup, { USE_PROFILES: { svg: true, svgFilters: true } });
|
|
76
|
+
}
|
|
56
77
|
/**
|
|
57
78
|
* Duration of the agent-picker slide-out animation. Must stay in sync with the
|
|
58
79
|
* `agent-picker-slide-out` keyframe duration in `main.styles.ts`.
|
|
@@ -109,6 +130,10 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
109
130
|
super(...arguments);
|
|
110
131
|
this.designSystemPrefix = 'rapid';
|
|
111
132
|
this.headerTitle = 'Genesis Assistant';
|
|
133
|
+
/** Sanitized `assistantIcon`, or the default sparkle mark; bound into the template. @internal */
|
|
134
|
+
this.assistantIconSafe = sparkleIconSvg;
|
|
135
|
+
/** Sanitized `userIcon`, or the default person mark; bound into the template. @internal */
|
|
136
|
+
this.userIconSafe = userIconSvg;
|
|
112
137
|
this.placeholder = 'Message assistant...';
|
|
113
138
|
this.chatConfig = {};
|
|
114
139
|
/** When set, enables Redux DevTools for this instance's session store. */
|
|
@@ -175,6 +200,14 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
175
200
|
this.agentPickerOpen = v;
|
|
176
201
|
});
|
|
177
202
|
}
|
|
203
|
+
assistantIconChanged() {
|
|
204
|
+
this.assistantIconSafe = this.assistantIcon
|
|
205
|
+
? sanitizeIconMarkup(this.assistantIcon)
|
|
206
|
+
: sparkleIconSvg;
|
|
207
|
+
}
|
|
208
|
+
userIconChanged() {
|
|
209
|
+
this.userIconSafe = this.userIcon ? sanitizeIconMarkup(this.userIcon) : userIconSvg;
|
|
210
|
+
}
|
|
178
211
|
/**
|
|
179
212
|
* Resolved agent picker mode from `chatConfig.picker.mode`. Defaults to
|
|
180
213
|
* `'disabled'`.
|
|
@@ -1804,6 +1837,21 @@ __decorate([
|
|
|
1804
1837
|
__decorate([
|
|
1805
1838
|
attr({ attribute: 'image-src' })
|
|
1806
1839
|
], FoundationAiAssistant.prototype, "imageSrc", void 0);
|
|
1840
|
+
__decorate([
|
|
1841
|
+
attr({ attribute: 'user-image-src' })
|
|
1842
|
+
], FoundationAiAssistant.prototype, "userImageSrc", void 0);
|
|
1843
|
+
__decorate([
|
|
1844
|
+
observable
|
|
1845
|
+
], FoundationAiAssistant.prototype, "assistantIcon", void 0);
|
|
1846
|
+
__decorate([
|
|
1847
|
+
observable
|
|
1848
|
+
], FoundationAiAssistant.prototype, "assistantIconSafe", void 0);
|
|
1849
|
+
__decorate([
|
|
1850
|
+
observable
|
|
1851
|
+
], FoundationAiAssistant.prototype, "userIcon", void 0);
|
|
1852
|
+
__decorate([
|
|
1853
|
+
observable
|
|
1854
|
+
], FoundationAiAssistant.prototype, "userIconSafe", void 0);
|
|
1807
1855
|
__decorate([
|
|
1808
1856
|
attr()
|
|
1809
1857
|
], FoundationAiAssistant.prototype, "placeholder", void 0);
|
|
@@ -452,6 +452,21 @@ export const styles = css `
|
|
|
452
452
|
border-radius: 50%;
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
+
.avatar-icon {
|
|
456
|
+
display: flex;
|
|
457
|
+
align-items: center;
|
|
458
|
+
justify-content: center;
|
|
459
|
+
width: 100%;
|
|
460
|
+
height: 100%;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.avatar-icon svg {
|
|
464
|
+
/* !important so a consumer-supplied SVG's own inline width/height/style
|
|
465
|
+
cannot break out of the avatar bounds. */
|
|
466
|
+
width: 84% !important;
|
|
467
|
+
height: 84% !important;
|
|
468
|
+
}
|
|
469
|
+
|
|
455
470
|
.message {
|
|
456
471
|
padding: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 3px);
|
|
457
472
|
max-width: 80%;
|
|
@@ -467,14 +482,18 @@ export const styles = css `
|
|
|
467
482
|
color-mix(in srgb, var(--accent-fill-rest) 70%, black) 100%
|
|
468
483
|
);
|
|
469
484
|
color: var(--accent-foreground-on-accent-rest);
|
|
470
|
-
|
|
485
|
+
|
|
486
|
+
/* Squared "tail" at top-right — the corner nearest the user avatar. */
|
|
487
|
+
border-radius: 18px 4px 18px 18px;
|
|
471
488
|
box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-fill-rest) 35%, transparent);
|
|
472
489
|
}
|
|
473
490
|
|
|
474
491
|
.message.ai {
|
|
475
492
|
background: linear-gradient(135deg, var(--neutral-layer-3) 0%, var(--neutral-layer-4) 100%);
|
|
476
493
|
color: var(--neutral-foreground-rest);
|
|
477
|
-
|
|
494
|
+
|
|
495
|
+
/* Squared "tail" at top-left — the corner nearest the assistant avatar. */
|
|
496
|
+
border-radius: 4px 18px 18px;
|
|
478
497
|
border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);
|
|
479
498
|
box-shadow: var(--ai-message-shadow, 0 2px 8px rgb(0 0 0 / 15%));
|
|
480
499
|
}
|
|
@@ -486,7 +505,7 @@ export const styles = css `
|
|
|
486
505
|
color-mix(in srgb, var(--ai-thinking-color, #7c3aed) 18%, transparent) 100%
|
|
487
506
|
);
|
|
488
507
|
color: var(--neutral-foreground-rest);
|
|
489
|
-
border-radius:
|
|
508
|
+
border-radius: 4px 18px 18px;
|
|
490
509
|
border-left: 2px solid var(--ai-thinking-color, #7c3aed);
|
|
491
510
|
font-style: italic;
|
|
492
511
|
font-size: 0.95em;
|
|
@@ -495,7 +514,7 @@ export const styles = css `
|
|
|
495
514
|
.message.ai-function {
|
|
496
515
|
background: linear-gradient(135deg, rgb(15 32 39 / 90%) 0%, rgb(30 58 58 / 80%) 100%);
|
|
497
516
|
color: var(--ai-function-color, #86efac);
|
|
498
|
-
border-radius:
|
|
517
|
+
border-radius: 4px 18px 18px;
|
|
499
518
|
font-size: 1em;
|
|
500
519
|
border: 1px solid color-mix(in srgb, var(--ai-function-color, #86efac) 20%, transparent);
|
|
501
520
|
}
|
|
@@ -44,20 +44,34 @@ const animationOptions = Object.entries(ANIMATION_DEFS).map(([value, def]) => ({
|
|
|
44
44
|
label: def.label,
|
|
45
45
|
tooltip: def.tooltip,
|
|
46
46
|
}));
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
// Avatar markup is owned by the component (`assistantIconSafe` / `userIconSafe`),
|
|
48
|
+
// which holds the sanitized SVG string for the default or any consumer override
|
|
49
|
+
// and is injected via `:innerHTML`. A raster `image-src` / `user-image-src`
|
|
50
|
+
// takes precedence over the inline icon. The exported `*IconSvg` string
|
|
51
|
+
// constants in `./main` let apps opt back into a specific built-in mark.
|
|
52
|
+
const assistantAvatarTemplate = html `
|
|
53
|
+
${(m, c) => {
|
|
54
|
+
const parent = c.parent;
|
|
55
|
+
return parent.imageSrc
|
|
56
|
+
? html `
|
|
57
|
+
<img src="${() => parent.imageSrc}" alt="Assistant" class="avatar-img" />
|
|
58
|
+
`
|
|
59
|
+
: html `
|
|
60
|
+
<span class="avatar-icon" :innerHTML="${() => parent.assistantIconSafe}"></span>
|
|
61
|
+
`;
|
|
62
|
+
}}
|
|
63
|
+
`;
|
|
64
|
+
const userAvatarTemplate = html `
|
|
65
|
+
${(m, c) => {
|
|
66
|
+
const parent = c.parent;
|
|
67
|
+
return parent.userImageSrc
|
|
68
|
+
? html `
|
|
69
|
+
<img src="${() => parent.userImageSrc}" alt="You" class="avatar-img" />
|
|
70
|
+
`
|
|
71
|
+
: html `
|
|
72
|
+
<span class="avatar-icon" :innerHTML="${() => parent.userIconSafe}"></span>
|
|
73
|
+
`;
|
|
74
|
+
}}
|
|
61
75
|
`;
|
|
62
76
|
/**
|
|
63
77
|
* @beta
|
|
@@ -158,22 +172,13 @@ ${(tc) => { var _a; return (((_a = tc.foldPath) === null || _a === void 0 ? void
|
|
|
158
172
|
`)}
|
|
159
173
|
${when((m) => m.role !== 'system-event', html `
|
|
160
174
|
<div class="message-row ${(m) => messageType(m)}">
|
|
161
|
-
${
|
|
175
|
+
<div class="avatar ${(m) => messageType(m)}">
|
|
176
|
+
${when(
|
|
162
177
|
// Keyed on messageType (not raw role) so a synthetic-user message,
|
|
163
|
-
// which renders as 'user',
|
|
164
|
-
//
|
|
165
|
-
(m) => messageType(m) !== 'user',
|
|
166
|
-
|
|
167
|
-
${when((m, c) => !!c.parent.imageSrc, html `
|
|
168
|
-
<img
|
|
169
|
-
src="${(m, c) => c.parent.imageSrc}"
|
|
170
|
-
alt="Assistant"
|
|
171
|
-
class="avatar-img"
|
|
172
|
-
/>
|
|
173
|
-
`)}
|
|
174
|
-
${when((m, c) => !c.parent.imageSrc, genesisIconTemplate)}
|
|
175
|
-
</div>
|
|
176
|
-
`)}
|
|
178
|
+
// which renders as 'user', gets the user avatar rather than the
|
|
179
|
+
// assistant one.
|
|
180
|
+
(m) => messageType(m) === 'user', userAvatarTemplate)}${when((m) => messageType(m) !== 'user', assistantAvatarTemplate)}
|
|
181
|
+
</div>
|
|
177
182
|
<div class="message ${(m) => messageType(m)}">
|
|
178
183
|
<div class="sender">
|
|
179
184
|
${(m, c) => {
|
|
@@ -452,10 +457,13 @@ ${(tc) => { var _a; return (((_a = tc.foldPath) === null || _a === void 0 ? void
|
|
|
452
457
|
}, html `
|
|
453
458
|
<div class="message-row ai" part="thinking">
|
|
454
459
|
<div class="avatar">
|
|
455
|
-
${
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
460
|
+
${(x) => x.imageSrc
|
|
461
|
+
? html `
|
|
462
|
+
<img src="${() => x.imageSrc}" alt="Assistant" class="avatar-img" />
|
|
463
|
+
`
|
|
464
|
+
: html `
|
|
465
|
+
<span class="avatar-icon" :innerHTML="${() => x.assistantIconSafe}"></span>
|
|
466
|
+
`}
|
|
459
467
|
</div>
|
|
460
468
|
<div class="thinking-dots">
|
|
461
469
|
<div class="dot dot-1"></div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/ai-assistant",
|
|
3
3
|
"description": "Genesis AI Assistant micro-frontend",
|
|
4
|
-
"version": "14.457.
|
|
4
|
+
"version": "14.457.1",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/ai-assistant.d.ts",
|
|
@@ -64,24 +64,24 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@genesislcap/foundation-testing": "14.457.
|
|
68
|
-
"@genesislcap/genx": "14.457.
|
|
69
|
-
"@genesislcap/rollup-builder": "14.457.
|
|
70
|
-
"@genesislcap/ts-builder": "14.457.
|
|
71
|
-
"@genesislcap/uvu-playwright-builder": "14.457.
|
|
72
|
-
"@genesislcap/vite-builder": "14.457.
|
|
73
|
-
"@genesislcap/webpack-builder": "14.457.
|
|
67
|
+
"@genesislcap/foundation-testing": "14.457.1",
|
|
68
|
+
"@genesislcap/genx": "14.457.1",
|
|
69
|
+
"@genesislcap/rollup-builder": "14.457.1",
|
|
70
|
+
"@genesislcap/ts-builder": "14.457.1",
|
|
71
|
+
"@genesislcap/uvu-playwright-builder": "14.457.1",
|
|
72
|
+
"@genesislcap/vite-builder": "14.457.1",
|
|
73
|
+
"@genesislcap/webpack-builder": "14.457.1",
|
|
74
74
|
"@types/dompurify": "^3.0.5",
|
|
75
75
|
"@types/marked": "^5.0.2"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@genesislcap/foundation-ai": "14.457.
|
|
79
|
-
"@genesislcap/foundation-logger": "14.457.
|
|
80
|
-
"@genesislcap/foundation-redux": "14.457.
|
|
81
|
-
"@genesislcap/foundation-ui": "14.457.
|
|
82
|
-
"@genesislcap/foundation-utils": "14.457.
|
|
83
|
-
"@genesislcap/rapid-design-system": "14.457.
|
|
84
|
-
"@genesislcap/web-core": "14.457.
|
|
78
|
+
"@genesislcap/foundation-ai": "14.457.1",
|
|
79
|
+
"@genesislcap/foundation-logger": "14.457.1",
|
|
80
|
+
"@genesislcap/foundation-redux": "14.457.1",
|
|
81
|
+
"@genesislcap/foundation-ui": "14.457.1",
|
|
82
|
+
"@genesislcap/foundation-utils": "14.457.1",
|
|
83
|
+
"@genesislcap/rapid-design-system": "14.457.1",
|
|
84
|
+
"@genesislcap/web-core": "14.457.1",
|
|
85
85
|
"dompurify": "^3.3.1",
|
|
86
86
|
"marked": "^17.0.3"
|
|
87
87
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "d11a46202d4f1404deffdaa867fcbe5b2c8225dc"
|
|
97
97
|
}
|
package/src/main/main.styles.ts
CHANGED
|
@@ -458,6 +458,21 @@ export const styles = css`
|
|
|
458
458
|
border-radius: 50%;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
+
.avatar-icon {
|
|
462
|
+
display: flex;
|
|
463
|
+
align-items: center;
|
|
464
|
+
justify-content: center;
|
|
465
|
+
width: 100%;
|
|
466
|
+
height: 100%;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.avatar-icon svg {
|
|
470
|
+
/* !important so a consumer-supplied SVG's own inline width/height/style
|
|
471
|
+
cannot break out of the avatar bounds. */
|
|
472
|
+
width: 84% !important;
|
|
473
|
+
height: 84% !important;
|
|
474
|
+
}
|
|
475
|
+
|
|
461
476
|
.message {
|
|
462
477
|
padding: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 3px);
|
|
463
478
|
max-width: 80%;
|
|
@@ -473,14 +488,18 @@ export const styles = css`
|
|
|
473
488
|
color-mix(in srgb, var(--accent-fill-rest) 70%, black) 100%
|
|
474
489
|
);
|
|
475
490
|
color: var(--accent-foreground-on-accent-rest);
|
|
476
|
-
|
|
491
|
+
|
|
492
|
+
/* Squared "tail" at top-right — the corner nearest the user avatar. */
|
|
493
|
+
border-radius: 18px 4px 18px 18px;
|
|
477
494
|
box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-fill-rest) 35%, transparent);
|
|
478
495
|
}
|
|
479
496
|
|
|
480
497
|
.message.ai {
|
|
481
498
|
background: linear-gradient(135deg, var(--neutral-layer-3) 0%, var(--neutral-layer-4) 100%);
|
|
482
499
|
color: var(--neutral-foreground-rest);
|
|
483
|
-
|
|
500
|
+
|
|
501
|
+
/* Squared "tail" at top-left — the corner nearest the assistant avatar. */
|
|
502
|
+
border-radius: 4px 18px 18px;
|
|
484
503
|
border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);
|
|
485
504
|
box-shadow: var(--ai-message-shadow, 0 2px 8px rgb(0 0 0 / 15%));
|
|
486
505
|
}
|
|
@@ -492,7 +511,7 @@ export const styles = css`
|
|
|
492
511
|
color-mix(in srgb, var(--ai-thinking-color, #7c3aed) 18%, transparent) 100%
|
|
493
512
|
);
|
|
494
513
|
color: var(--neutral-foreground-rest);
|
|
495
|
-
border-radius:
|
|
514
|
+
border-radius: 4px 18px 18px;
|
|
496
515
|
border-left: 2px solid var(--ai-thinking-color, #7c3aed);
|
|
497
516
|
font-style: italic;
|
|
498
517
|
font-size: 0.95em;
|
|
@@ -501,7 +520,7 @@ export const styles = css`
|
|
|
501
520
|
.message.ai-function {
|
|
502
521
|
background: linear-gradient(135deg, rgb(15 32 39 / 90%) 0%, rgb(30 58 58 / 80%) 100%);
|
|
503
522
|
color: var(--ai-function-color, #86efac);
|
|
504
|
-
border-radius:
|
|
523
|
+
border-radius: 4px 18px 18px;
|
|
505
524
|
font-size: 1em;
|
|
506
525
|
border: 1px solid color-mix(in srgb, var(--ai-function-color, #86efac) 20%, transparent);
|
|
507
526
|
}
|
|
@@ -57,20 +57,36 @@ const animationOptions = Object.entries(ANIMATION_DEFS).map(([value, def]) => ({
|
|
|
57
57
|
tooltip: def.tooltip,
|
|
58
58
|
}));
|
|
59
59
|
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
// Avatar markup is owned by the component (`assistantIconSafe` / `userIconSafe`),
|
|
61
|
+
// which holds the sanitized SVG string for the default or any consumer override
|
|
62
|
+
// and is injected via `:innerHTML`. A raster `image-src` / `user-image-src`
|
|
63
|
+
// takes precedence over the inline icon. The exported `*IconSvg` string
|
|
64
|
+
// constants in `./main` let apps opt back into a specific built-in mark.
|
|
65
|
+
|
|
66
|
+
const assistantAvatarTemplate = html<ChatMessage, FoundationAiAssistant>`
|
|
67
|
+
${(m, c) => {
|
|
68
|
+
const parent = c.parent as FoundationAiAssistant;
|
|
69
|
+
return parent.imageSrc
|
|
70
|
+
? html<ChatMessage, FoundationAiAssistant>`
|
|
71
|
+
<img src="${() => parent.imageSrc}" alt="Assistant" class="avatar-img" />
|
|
72
|
+
`
|
|
73
|
+
: html<ChatMessage, FoundationAiAssistant>`
|
|
74
|
+
<span class="avatar-icon" :innerHTML="${() => parent.assistantIconSafe}"></span>
|
|
75
|
+
`;
|
|
76
|
+
}}
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
const userAvatarTemplate = html<ChatMessage, FoundationAiAssistant>`
|
|
80
|
+
${(m, c) => {
|
|
81
|
+
const parent = c.parent as FoundationAiAssistant;
|
|
82
|
+
return parent.userImageSrc
|
|
83
|
+
? html<ChatMessage, FoundationAiAssistant>`
|
|
84
|
+
<img src="${() => parent.userImageSrc}" alt="You" class="avatar-img" />
|
|
85
|
+
`
|
|
86
|
+
: html<ChatMessage, FoundationAiAssistant>`
|
|
87
|
+
<span class="avatar-icon" :innerHTML="${() => parent.userIconSafe}"></span>
|
|
88
|
+
`;
|
|
89
|
+
}}
|
|
74
90
|
`;
|
|
75
91
|
|
|
76
92
|
/**
|
|
@@ -221,30 +237,15 @@ ${(tc) => (tc.foldPath?.length ? `${tc.foldPath.join(' › ')} › ` : '')}<stro
|
|
|
221
237
|
(m) => m.role !== 'system-event',
|
|
222
238
|
html<ChatMessage, FoundationAiAssistant>`
|
|
223
239
|
<div class="message-row ${(m) => messageType(m)}">
|
|
224
|
-
${
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
html<ChatMessage, FoundationAiAssistant>`
|
|
234
|
-
<img
|
|
235
|
-
src="${(m, c) => (c.parent as FoundationAiAssistant).imageSrc}"
|
|
236
|
-
alt="Assistant"
|
|
237
|
-
class="avatar-img"
|
|
238
|
-
/>
|
|
239
|
-
`,
|
|
240
|
-
)}
|
|
241
|
-
${when(
|
|
242
|
-
(m, c) => !(c.parent as FoundationAiAssistant).imageSrc,
|
|
243
|
-
genesisIconTemplate,
|
|
244
|
-
)}
|
|
245
|
-
</div>
|
|
246
|
-
`,
|
|
247
|
-
)}
|
|
240
|
+
<div class="avatar ${(m) => messageType(m)}">
|
|
241
|
+
${when(
|
|
242
|
+
// Keyed on messageType (not raw role) so a synthetic-user message,
|
|
243
|
+
// which renders as 'user', gets the user avatar rather than the
|
|
244
|
+
// assistant one.
|
|
245
|
+
(m) => messageType(m) === 'user',
|
|
246
|
+
userAvatarTemplate,
|
|
247
|
+
)}${when((m) => messageType(m) !== 'user', assistantAvatarTemplate)}
|
|
248
|
+
</div>
|
|
248
249
|
<div class="message ${(m) => messageType(m)}">
|
|
249
250
|
<div class="sender">
|
|
250
251
|
${(m, c) =>
|
|
@@ -593,13 +594,14 @@ ${(tc) => (tc.foldPath?.length ? `${tc.foldPath.join(' › ')} › ` : '')}<stro
|
|
|
593
594
|
html<FoundationAiAssistant>`
|
|
594
595
|
<div class="message-row ai" part="thinking">
|
|
595
596
|
<div class="avatar">
|
|
596
|
-
${
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
597
|
+
${(x) =>
|
|
598
|
+
x.imageSrc
|
|
599
|
+
? html<FoundationAiAssistant>`
|
|
600
|
+
<img src="${() => x.imageSrc}" alt="Assistant" class="avatar-img" />
|
|
601
|
+
`
|
|
602
|
+
: html<FoundationAiAssistant>`
|
|
603
|
+
<span class="avatar-icon" :innerHTML="${() => x.assistantIconSafe}"></span>
|
|
604
|
+
`}
|
|
603
605
|
</div>
|
|
604
606
|
<div class="thinking-dots">
|
|
605
607
|
<div class="dot dot-1"></div>
|
package/src/main/main.ts
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
volatile,
|
|
39
39
|
attr,
|
|
40
40
|
} from '@genesislcap/web-core';
|
|
41
|
+
import DOMPurify from 'dompurify';
|
|
41
42
|
import { agenticActivityBus } from '../channel/ai-activity-bus';
|
|
42
43
|
import { AiActivityHalo } from '../components/activity-halo/activity-halo';
|
|
43
44
|
import { AgentPicker } from '../components/agent-picker/agent-picker';
|
|
@@ -88,6 +89,31 @@ import { ALL_ANIMATIONS } from './main.types';
|
|
|
88
89
|
*/
|
|
89
90
|
const PIN_COLOURS = [AI_COLOUR_AMBER, AI_COLOUR_PINK, AI_COLOUR_CYAN, AI_COLOUR_VIOLET];
|
|
90
91
|
|
|
92
|
+
// ─── Avatar icons ─────────────────────────────────────────────────────────────
|
|
93
|
+
// Inline SVG bundled as strings — no runtime asset dependency. They use
|
|
94
|
+
// `fill="currentColor"` so they inherit the avatar's theme colour (unlike an
|
|
95
|
+
// `image-src`, whose SVG would render in an isolated context). Exported so an
|
|
96
|
+
// app can restore a specific mark via the `assistantIcon` / `userIcon`
|
|
97
|
+
// properties, e.g. `el.assistantIcon = genesisIconSvg`.
|
|
98
|
+
|
|
99
|
+
/** Three-star AI "sparkle" mark — the conventional AI signifier; default assistant avatar. */
|
|
100
|
+
export const sparkleIconSvg = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.5 5 C9.5 11.4 11.1 13 17.5 13 C11.1 13 9.5 14.6 9.5 21 C9.5 14.6 7.9 13 1.5 13 C7.9 13 9.5 11.4 9.5 5 Z" fill="currentColor"/><path d="M17 2.5 C17 5.7 17.8 6.5 21 6.5 C17.8 6.5 17 7.3 17 10.5 C17 7.3 16.2 6.5 13 6.5 C16.2 6.5 17 5.7 17 2.5 Z" fill="currentColor"/><path d="M17.5 15 C17.5 17 18 17.5 20 17.5 C18 17.5 17.5 18 17.5 20 C17.5 18 17 17.5 15 17.5 C17 17.5 17.5 17 17.5 15 Z" fill="currentColor"/></svg>`;
|
|
101
|
+
|
|
102
|
+
/** Person silhouette — default user avatar. */
|
|
103
|
+
export const userIconSvg = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" fill="currentColor"/></svg>`;
|
|
104
|
+
|
|
105
|
+
/** Genesis G-mark — opt-in assistant avatar (the default before the sparkle mark). */
|
|
106
|
+
export const genesisIconSvg = `<svg viewBox="-4 0 30 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.7702 23.0437C18.7702 22.4675 18.8526 21.8089 19.0995 21.3149C19.3465 20.7386 19.6758 20.2447 20.0874 19.833C20.4991 19.4214 20.993 19.0921 21.5693 18.8451C22.1456 18.5982 22.7219 18.5158 23.2981 18.5158H25.9326V11.6828H19.1819V14.3172C19.1819 15.5521 18.6879 16.7047 17.8647 17.5279C17.0414 18.3512 15.8888 18.8451 14.7363 18.9275H6.7507V6.99025H16.4651V0.157227H3.54C2.63442 0.157227 1.72884 0.568855 1.07023 1.22746C0.411628 1.88606 0 2.79165 0 3.77955V22.2205C0 23.1261 0.411628 24.0316 1.07023 24.7726C1.72884 25.4312 2.63442 25.8428 3.54 25.8428H18.7702V23.0437Z" fill="currentColor"/></svg>`;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Sanitize caller-supplied avatar markup. Restricted to the SVG profile so an
|
|
110
|
+
* icon override can only ever contribute inline vector markup — never arbitrary
|
|
111
|
+
* HTML or script. Mirrors the DOMPurify usage in `ai-chat-markdown`.
|
|
112
|
+
*/
|
|
113
|
+
function sanitizeIconMarkup(markup: string): string {
|
|
114
|
+
return DOMPurify.sanitize(markup, { USE_PROFILES: { svg: true, svgFilters: true } });
|
|
115
|
+
}
|
|
116
|
+
|
|
91
117
|
/**
|
|
92
118
|
* Duration of the agent-picker slide-out animation. Must stay in sync with the
|
|
93
119
|
* `agent-picker-slide-out` keyframe duration in `main.styles.ts`.
|
|
@@ -187,6 +213,37 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
187
213
|
@observable designSystemPrefix: string = 'rapid';
|
|
188
214
|
@attr({ attribute: 'header-title' }) headerTitle: string = 'Genesis Assistant';
|
|
189
215
|
@attr({ attribute: 'image-src' }) imageSrc?: string;
|
|
216
|
+
@attr({ attribute: 'user-image-src' }) userImageSrc?: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Inline SVG markup overriding the default assistant "sparkle" avatar. The
|
|
220
|
+
* markup is sanitized (SVG profile) before rendering and uses the avatar's
|
|
221
|
+
* theme colour via `currentColor`. For a raster/photo avatar set `imageSrc`
|
|
222
|
+
* instead, which takes precedence. Set to `genesisIconSvg` to restore the
|
|
223
|
+
* Genesis G-mark.
|
|
224
|
+
*/
|
|
225
|
+
@observable assistantIcon?: string;
|
|
226
|
+
/** Sanitized `assistantIcon`, or the default sparkle mark; bound into the template. @internal */
|
|
227
|
+
@observable assistantIconSafe: string = sparkleIconSvg;
|
|
228
|
+
protected assistantIconChanged(): void {
|
|
229
|
+
this.assistantIconSafe = this.assistantIcon
|
|
230
|
+
? sanitizeIconMarkup(this.assistantIcon)
|
|
231
|
+
: sparkleIconSvg;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Inline SVG markup overriding the default user "person" avatar. The markup is
|
|
236
|
+
* sanitized (SVG profile) before rendering and uses the avatar's theme colour
|
|
237
|
+
* via `currentColor`. For a raster/photo avatar set `userImageSrc` instead,
|
|
238
|
+
* which takes precedence.
|
|
239
|
+
*/
|
|
240
|
+
@observable userIcon?: string;
|
|
241
|
+
/** Sanitized `userIcon`, or the default person mark; bound into the template. @internal */
|
|
242
|
+
@observable userIconSafe: string = userIconSvg;
|
|
243
|
+
protected userIconChanged(): void {
|
|
244
|
+
this.userIconSafe = this.userIcon ? sanitizeIconMarkup(this.userIcon) : userIconSvg;
|
|
245
|
+
}
|
|
246
|
+
|
|
190
247
|
@attr() placeholder: string = 'Message assistant...';
|
|
191
248
|
/**
|
|
192
249
|
* Controls the pop-out button shown next to the settings cog.
|