solfaces 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +518 -0
- package/dist/agent/index.cjs +51 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +65 -0
- package/dist/agent/index.d.ts +65 -0
- package/dist/agent/index.js +6 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/mcp-server.cjs +836 -0
- package/dist/chunk-2DIKGLXZ.cjs +126 -0
- package/dist/chunk-2DIKGLXZ.cjs.map +1 -0
- package/dist/chunk-A6N3RPEA.cjs +111 -0
- package/dist/chunk-A6N3RPEA.cjs.map +1 -0
- package/dist/chunk-CVFO7YHY.cjs +97 -0
- package/dist/chunk-CVFO7YHY.cjs.map +1 -0
- package/dist/chunk-H3SK3MNX.cjs +409 -0
- package/dist/chunk-H3SK3MNX.cjs.map +1 -0
- package/dist/chunk-KSGFMW33.js +401 -0
- package/dist/chunk-KSGFMW33.js.map +1 -0
- package/dist/chunk-LQWJRHGC.js +86 -0
- package/dist/chunk-LQWJRHGC.js.map +1 -0
- package/dist/chunk-RX6D5FGH.js +211 -0
- package/dist/chunk-RX6D5FGH.js.map +1 -0
- package/dist/chunk-SNJABBAT.js +107 -0
- package/dist/chunk-SNJABBAT.js.map +1 -0
- package/dist/chunk-VMNATBH3.cjs +222 -0
- package/dist/chunk-VMNATBH3.cjs.map +1 -0
- package/dist/chunk-WURY4QGH.js +117 -0
- package/dist/chunk-WURY4QGH.js.map +1 -0
- package/dist/core/index.cjs +82 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +104 -0
- package/dist/core/index.d.ts +104 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.cjs +100 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.cjs +543 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +28 -0
- package/dist/react/index.d.ts +28 -0
- package/dist/react/index.js +541 -0
- package/dist/react/index.js.map +1 -0
- package/dist/solfaces.cdn.global.js +3 -0
- package/dist/solfaces.cdn.global.js.map +1 -0
- package/dist/themes/index.cjs +48 -0
- package/dist/themes/index.cjs.map +1 -0
- package/dist/themes/index.d.cts +14 -0
- package/dist/themes/index.d.ts +14 -0
- package/dist/themes/index.js +3 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/traits-DAFZnXeS.d.cts +61 -0
- package/dist/traits-DAFZnXeS.d.ts +61 -0
- package/dist/vanilla/index.cjs +43 -0
- package/dist/vanilla/index.cjs.map +1 -0
- package/dist/vanilla/index.d.cts +7 -0
- package/dist/vanilla/index.d.ts +7 -0
- package/dist/vanilla/index.js +39 -0
- package/dist/vanilla/index.js.map +1 -0
- package/package.json +100 -0
- package/python/solfaces.py +475 -0
- package/skill.md +463 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk2DIKGLXZ_cjs = require('./chunk-2DIKGLXZ.cjs');
|
|
4
|
+
|
|
5
|
+
// src/core/renderer.ts
|
|
6
|
+
function renderFace(t, skin) {
|
|
7
|
+
if (t.faceShape === 0) return `<circle cx="32" cy="34" r="20" fill="${skin}"/>`;
|
|
8
|
+
if (t.faceShape === 1) return `<rect x="12" y="14" width="40" height="40" rx="8" ry="8" fill="${skin}"/>`;
|
|
9
|
+
if (t.faceShape === 2) return `<ellipse cx="32" cy="34" rx="18" ry="22" fill="${skin}"/>`;
|
|
10
|
+
if (t.faceShape === 3) return `<path d="M32 12 L50 24 L50 44 L32 56 L14 44 L14 24 Z" fill="${skin}" stroke-linejoin="round"/>`;
|
|
11
|
+
return `<circle cx="32" cy="34" r="20" fill="${skin}"/>`;
|
|
12
|
+
}
|
|
13
|
+
function renderEyes(t, c, w = "white") {
|
|
14
|
+
const l = 24, r = 40, y = 30;
|
|
15
|
+
switch (t.eyeStyle) {
|
|
16
|
+
case 0:
|
|
17
|
+
return `<circle cx="${l}" cy="${y}" r="3.5" fill="${w}"/><circle cx="${l + 1}" cy="${y}" r="2" fill="${c}"/><circle cx="${r}" cy="${y}" r="3.5" fill="${w}"/><circle cx="${r + 1}" cy="${y}" r="2" fill="${c}"/>`;
|
|
18
|
+
case 1:
|
|
19
|
+
return `<circle cx="${l}" cy="${y}" r="2" fill="${c}"/><circle cx="${r}" cy="${y}" r="2" fill="${c}"/>`;
|
|
20
|
+
case 2:
|
|
21
|
+
return `<ellipse cx="${l}" cy="${y}" rx="4" ry="2.5" fill="${w}"/><circle cx="${l + 0.5}" cy="${y}" r="1.5" fill="${c}"/><ellipse cx="${r}" cy="${y}" rx="4" ry="2.5" fill="${w}"/><circle cx="${r + 0.5}" cy="${y}" r="1.5" fill="${c}"/>`;
|
|
22
|
+
case 3:
|
|
23
|
+
return `<circle cx="${l}" cy="${y}" r="4.5" fill="${w}"/><circle cx="${l}" cy="${y + 0.5}" r="2.5" fill="${c}"/><circle cx="${r}" cy="${y}" r="4.5" fill="${w}"/><circle cx="${r}" cy="${y + 0.5}" r="2.5" fill="${c}"/>`;
|
|
24
|
+
case 4:
|
|
25
|
+
return `<ellipse cx="${l}" cy="${y + 1}" rx="3.5" ry="2" fill="${w}"/><circle cx="${l}" cy="${y + 1}" r="1.5" fill="${c}"/><line x1="${l - 4}" y1="${y - 0.5}" x2="${l + 4}" y2="${y - 0.5}" stroke="${c}" stroke-width="1" stroke-linecap="round"/><ellipse cx="${r}" cy="${y + 1}" rx="3.5" ry="2" fill="${w}"/><circle cx="${r}" cy="${y + 1}" r="1.5" fill="${c}"/><line x1="${r - 4}" y1="${y - 0.5}" x2="${r + 4}" y2="${y - 0.5}" stroke="${c}" stroke-width="1" stroke-linecap="round"/>`;
|
|
26
|
+
case 5:
|
|
27
|
+
return `<path d="M${l - 3} ${y} Q${l} ${y + 3} ${l + 3} ${y}" fill="none" stroke="${c}" stroke-width="1.5" stroke-linecap="round"/><circle cx="${r}" cy="${y}" r="3.5" fill="${w}"/><circle cx="${r + 1}" cy="${y}" r="2" fill="${c}"/>`;
|
|
28
|
+
case 6:
|
|
29
|
+
return `<circle cx="${l}" cy="${y}" r="3" fill="${w}"/><circle cx="${l + 0.5}" cy="${y}" r="1.5" fill="${c}"/><line x1="${l + 2}" y1="${y - 3}" x2="${l + 3.5}" y2="${y - 4.5}" stroke="${c}" stroke-width="0.8" stroke-linecap="round"/><line x1="${l + 3}" y1="${y - 2}" x2="${l + 4.5}" y2="${y - 3}" stroke="${c}" stroke-width="0.8" stroke-linecap="round"/><circle cx="${r}" cy="${y}" r="3" fill="${w}"/><circle cx="${r + 0.5}" cy="${y}" r="1.5" fill="${c}"/><line x1="${r + 2}" y1="${y - 3}" x2="${r + 3.5}" y2="${y - 4.5}" stroke="${c}" stroke-width="0.8" stroke-linecap="round"/><line x1="${r + 3}" y1="${y - 2}" x2="${r + 4.5}" y2="${y - 3}" stroke="${c}" stroke-width="0.8" stroke-linecap="round"/>`;
|
|
30
|
+
case 7:
|
|
31
|
+
return `<ellipse cx="${l}" cy="${y}" rx="4" ry="1.2" fill="${w}"/><ellipse cx="${l + 0.5}" cy="${y}" rx="2" ry="1" fill="${c}"/><ellipse cx="${r}" cy="${y}" rx="4" ry="1.2" fill="${w}"/><ellipse cx="${r + 0.5}" cy="${y}" rx="2" ry="1" fill="${c}"/>`;
|
|
32
|
+
default:
|
|
33
|
+
return `<circle cx="${l}" cy="${y}" r="3" fill="${w}"/><circle cx="${l + 1}" cy="${y}" r="2" fill="${c}"/><circle cx="${r}" cy="${y}" r="3" fill="${w}"/><circle cx="${r + 1}" cy="${y}" r="2" fill="${c}"/>`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function renderEyebrows(t, col = "#2a2020") {
|
|
37
|
+
const l = 24, r = 40, y = 25;
|
|
38
|
+
switch (t.eyebrows) {
|
|
39
|
+
case 0:
|
|
40
|
+
return "";
|
|
41
|
+
case 1:
|
|
42
|
+
return `<line x1="${l - 3}" y1="${y}" x2="${l + 3}" y2="${y}" stroke="${col}" stroke-width="0.8" stroke-linecap="round"/><line x1="${r - 3}" y1="${y}" x2="${r + 3}" y2="${y}" stroke="${col}" stroke-width="0.8" stroke-linecap="round"/>`;
|
|
43
|
+
case 2:
|
|
44
|
+
return `<line x1="${l - 3.5}" y1="${y}" x2="${l + 3.5}" y2="${y}" stroke="${col}" stroke-width="2" stroke-linecap="round"/><line x1="${r - 3.5}" y1="${y}" x2="${r + 3.5}" y2="${y}" stroke="${col}" stroke-width="2" stroke-linecap="round"/>`;
|
|
45
|
+
case 3:
|
|
46
|
+
return `<path d="M${l - 3.5} ${y + 1} Q${l} ${y - 2} ${l + 3.5} ${y + 1}" fill="none" stroke="${col}" stroke-width="1" stroke-linecap="round"/><path d="M${r - 3.5} ${y + 1} Q${r} ${y - 2} ${r + 3.5} ${y + 1}" fill="none" stroke="${col}" stroke-width="1" stroke-linecap="round"/>`;
|
|
47
|
+
case 4:
|
|
48
|
+
return `<line x1="${l - 3}" y1="${y - 1}" x2="${l + 3}" y2="${y + 1}" stroke="${col}" stroke-width="1.2" stroke-linecap="round"/><line x1="${r - 3}" y1="${y + 1}" x2="${r + 3}" y2="${y - 1}" stroke="${col}" stroke-width="1.2" stroke-linecap="round"/>`;
|
|
49
|
+
default:
|
|
50
|
+
return "";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function renderNose(t, skin, noseCol) {
|
|
54
|
+
const cx = 32, y = 36;
|
|
55
|
+
const sh = noseCol ?? skin + "aa";
|
|
56
|
+
switch (t.nose) {
|
|
57
|
+
case 0:
|
|
58
|
+
return "";
|
|
59
|
+
case 1:
|
|
60
|
+
return `<circle cx="${cx}" cy="${y}" r="1.5" fill="${sh}"/>`;
|
|
61
|
+
case 2:
|
|
62
|
+
return `<path d="M${cx} ${y - 1.5} L${cx + 2.5} ${y + 2} L${cx - 2.5} ${y + 2} Z" fill="${sh}"/>`;
|
|
63
|
+
case 3:
|
|
64
|
+
return `<circle cx="${cx - 1.5}" cy="${y}" r="1" fill="${sh}"/><circle cx="${cx + 1.5}" cy="${y}" r="1" fill="${sh}"/>`;
|
|
65
|
+
default:
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function renderMouth(t, col = "#c05050", teethCol = "white") {
|
|
70
|
+
const cx = 32, y = 42;
|
|
71
|
+
switch (t.mouth) {
|
|
72
|
+
case 0:
|
|
73
|
+
return `<path d="M${cx - 4} ${y} Q${cx} ${y + 4} ${cx + 4} ${y}" fill="none" stroke="${col}" stroke-width="1.2" stroke-linecap="round"/>`;
|
|
74
|
+
case 1:
|
|
75
|
+
return `<line x1="${cx - 3}" y1="${y + 1}" x2="${cx + 3}" y2="${y + 1}" stroke="${col}" stroke-width="1.2" stroke-linecap="round"/>`;
|
|
76
|
+
case 2:
|
|
77
|
+
return `<path d="M${cx - 6} ${y} Q${cx} ${y + 5} ${cx + 6} ${y}" fill="none" stroke="${col}" stroke-width="1.5" stroke-linecap="round"/>`;
|
|
78
|
+
case 3:
|
|
79
|
+
return `<ellipse cx="${cx}" cy="${y + 1}" rx="3" ry="2.5" fill="${col}" opacity="0.8"/>`;
|
|
80
|
+
case 4:
|
|
81
|
+
return `<path d="M${cx - 4} ${y + 1} Q${cx - 1} ${y + 1} ${cx + 4} ${y - 1}" fill="none" stroke="${col}" stroke-width="1.2" stroke-linecap="round"/>`;
|
|
82
|
+
case 5:
|
|
83
|
+
return `<path d="M${cx - 6} ${y} Q${cx} ${y + 6} ${cx + 6} ${y}" fill="${teethCol}" stroke="${col}" stroke-width="1"/>`;
|
|
84
|
+
default:
|
|
85
|
+
return `<path d="M${cx - 4} ${y} Q${cx} ${y + 4} ${cx + 4} ${y}" fill="none" stroke="${col}" stroke-width="1.2" stroke-linecap="round"/>`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function renderHair(t, col) {
|
|
89
|
+
switch (t.hairStyle) {
|
|
90
|
+
case 0:
|
|
91
|
+
return "";
|
|
92
|
+
// Bald
|
|
93
|
+
case 1:
|
|
94
|
+
return `<rect x="14" y="12" width="36" height="12" rx="6" ry="6" fill="${col}"/>`;
|
|
95
|
+
case 2:
|
|
96
|
+
return `<g fill="${col}"><rect x="14" y="16" width="36" height="8" rx="2"/><polygon points="18,16 22,6 26,16"/><polygon points="26,16 30,4 34,16"/><polygon points="34,16 38,6 42,16"/><polygon points="42,16 46,10 48,16"/></g>`;
|
|
97
|
+
case 3:
|
|
98
|
+
return `<g fill="${col}"><rect x="14" y="14" width="36" height="10" rx="4"/><path d="M14 18 Q8 14 10 8 Q14 10 20 14 Z"/></g>`;
|
|
99
|
+
case 4:
|
|
100
|
+
return `<rect x="26" y="4" width="12" height="20" rx="4" ry="2" fill="${col}"/>`;
|
|
101
|
+
case 5:
|
|
102
|
+
return `<g fill="${col}"><rect x="14" y="12" width="36" height="10" rx="4"/><rect x="10" y="18" width="8" height="24" rx="3"/><rect x="46" y="18" width="8" height="24" rx="3"/></g>`;
|
|
103
|
+
case 6:
|
|
104
|
+
return `<path d="M12 22 Q12 10 32 10 Q52 10 52 22 L52 38 Q52 42 48 42 L48 26 Q48 16 32 16 Q16 16 16 26 L16 42 Q12 42 12 38 Z" fill="${col}"/>`;
|
|
105
|
+
case 7:
|
|
106
|
+
return `<rect x="15" y="13" width="34" height="9" rx="8" ry="4" fill="${col}" opacity="0.7"/>`;
|
|
107
|
+
default:
|
|
108
|
+
return "";
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function renderAccessory(t, col = "#444") {
|
|
112
|
+
if (t.accessory <= 1) return "";
|
|
113
|
+
if (t.accessory === 2) return `<g fill="none" stroke="${col}" stroke-width="1"><circle cx="24" cy="30" r="5"/><circle cx="40" cy="30" r="5"/><line x1="29" y1="30" x2="35" y2="30"/><line x1="19" y1="30" x2="14" y2="28"/><line x1="45" y1="30" x2="50" y2="28"/></g>`;
|
|
114
|
+
if (t.accessory === 3) return `<g fill="none" stroke="${col}" stroke-width="1"><rect x="19" y="26" width="10" height="8" rx="1"/><rect x="35" y="26" width="10" height="8" rx="1"/><line x1="29" y1="30" x2="35" y2="30"/><line x1="19" y1="30" x2="14" y2="28"/><line x1="45" y1="30" x2="50" y2="28"/></g>`;
|
|
115
|
+
if (t.accessory === 4) return `<circle cx="11" cy="36" r="2" fill="${col}" stroke="${col}" stroke-width="0.5"/>`;
|
|
116
|
+
if (t.accessory === 5) return `<g><rect x="12" y="20" width="40" height="4" rx="1" fill="${col}"/><path d="M12 22 L8 26 L12 24 Z" fill="${col}"/></g>`;
|
|
117
|
+
return "";
|
|
118
|
+
}
|
|
119
|
+
function renderSolFaceSVG(walletAddress, options) {
|
|
120
|
+
const { size = 64, theme, traitOverrides, enableBlink, className, colorOverrides } = options ?? {};
|
|
121
|
+
const traits = chunk2DIKGLXZ_cjs.generateTraits(walletAddress, traitOverrides);
|
|
122
|
+
const skinColors = theme?.skinColors ?? chunk2DIKGLXZ_cjs.SKIN_COLORS;
|
|
123
|
+
const eyeColors = theme?.eyeColors ?? chunk2DIKGLXZ_cjs.EYE_COLORS;
|
|
124
|
+
const hairColors = theme?.hairColors ?? chunk2DIKGLXZ_cjs.HAIR_COLORS;
|
|
125
|
+
const bgColors = theme?.bgColors ?? chunk2DIKGLXZ_cjs.BG_COLORS;
|
|
126
|
+
const skin = colorOverrides?.skin ?? skinColors[traits.skinColor % skinColors.length];
|
|
127
|
+
const eyeCol = colorOverrides?.eyes ?? eyeColors[traits.eyeColor % eyeColors.length];
|
|
128
|
+
const hairCol = colorOverrides?.hair ?? hairColors[traits.hairColor % hairColors.length];
|
|
129
|
+
const bgCol = colorOverrides?.bg ?? bgColors[traits.bgColor % bgColors.length];
|
|
130
|
+
const bgOpacity = theme?.bgOpacity ?? 0.15;
|
|
131
|
+
const bgRadius = theme?.bgRadius ?? 4;
|
|
132
|
+
const mouthCol = colorOverrides?.mouth ?? theme?.mouthColor ?? "#c05050";
|
|
133
|
+
const browCol = colorOverrides?.eyebrow ?? theme?.eyebrowColor ?? "#2a2020";
|
|
134
|
+
const accCol = colorOverrides?.accessory ?? theme?.accessoryColor ?? "#444";
|
|
135
|
+
const eyeWhite = colorOverrides?.eyeWhite ?? theme?.eyeWhiteColor ?? "white";
|
|
136
|
+
const noseCol = colorOverrides?.nose ?? theme?.noseColor;
|
|
137
|
+
const classAttr = className ? ` class="${className}"` : "";
|
|
138
|
+
let svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="${size}" height="${size}"${classAttr}>`;
|
|
139
|
+
svg += `<rect x="0" y="0" width="64" height="64" fill="${bgCol}" opacity="${bgOpacity}" rx="${bgRadius}"/>`;
|
|
140
|
+
const blinkEnabled = !!enableBlink;
|
|
141
|
+
const blinkDuration = typeof enableBlink === "object" ? enableBlink.duration ?? 4 : 4;
|
|
142
|
+
const blinkDelay = typeof enableBlink === "object" ? enableBlink.delay ?? 0 : 0;
|
|
143
|
+
if (blinkEnabled) {
|
|
144
|
+
const uid = `sf-${walletAddress.slice(0, 8)}`;
|
|
145
|
+
const delayStr = blinkDelay ? ` ${blinkDelay}s` : "";
|
|
146
|
+
svg += `<style>@keyframes ${uid}-blink{0%,90%,100%{transform:scaleY(1)}95%{transform:scaleY(0.1)}}.${uid}-eyes{animation:${uid}-blink ${blinkDuration}s ease-in-out${delayStr} infinite;transform-origin:32px 30px}</style>`;
|
|
147
|
+
}
|
|
148
|
+
svg += renderHair(traits, hairCol);
|
|
149
|
+
svg += renderFace(traits, skin);
|
|
150
|
+
if (blinkEnabled) {
|
|
151
|
+
const uid = `sf-${walletAddress.slice(0, 8)}`;
|
|
152
|
+
svg += `<g class="${uid}-eyes">`;
|
|
153
|
+
}
|
|
154
|
+
svg += renderEyes(traits, eyeCol, eyeWhite);
|
|
155
|
+
if (blinkEnabled) svg += `</g>`;
|
|
156
|
+
svg += renderEyebrows(traits, browCol);
|
|
157
|
+
svg += renderNose(traits, skin, noseCol);
|
|
158
|
+
svg += renderMouth(traits, mouthCol, eyeWhite);
|
|
159
|
+
svg += renderAccessory(traits, accCol);
|
|
160
|
+
if (theme?.border) {
|
|
161
|
+
svg += `<rect x="0" y="0" width="64" height="64" fill="none" stroke="${theme.border.color}" stroke-width="${theme.border.width}" rx="${bgRadius}"/>`;
|
|
162
|
+
}
|
|
163
|
+
svg += `</svg>`;
|
|
164
|
+
return svg;
|
|
165
|
+
}
|
|
166
|
+
function renderSolFaceDataURI(walletAddress, options) {
|
|
167
|
+
const svg = renderSolFaceSVG(walletAddress, options);
|
|
168
|
+
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
|
169
|
+
}
|
|
170
|
+
function renderSolFaceBase64(walletAddress, options) {
|
|
171
|
+
const svg = renderSolFaceSVG(walletAddress, options);
|
|
172
|
+
return `data:image/svg+xml;base64,${btoa(svg)}`;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// src/core/describe.ts
|
|
176
|
+
var FACE_SHAPES = {
|
|
177
|
+
0: "round",
|
|
178
|
+
1: "square with softly rounded corners",
|
|
179
|
+
2: "oval",
|
|
180
|
+
3: "angular, hexagonal"
|
|
181
|
+
};
|
|
182
|
+
var SKIN_TONES = {
|
|
183
|
+
0: "light peach",
|
|
184
|
+
1: "warm tan",
|
|
185
|
+
2: "golden brown",
|
|
186
|
+
3: "medium brown",
|
|
187
|
+
4: "deep brown",
|
|
188
|
+
5: "rich dark brown"
|
|
189
|
+
};
|
|
190
|
+
var EYE_STYLES = {
|
|
191
|
+
0: "round, wide-open",
|
|
192
|
+
1: "small and dot-like",
|
|
193
|
+
2: "almond-shaped",
|
|
194
|
+
3: "wide and expressive",
|
|
195
|
+
4: "sleepy, half-lidded",
|
|
196
|
+
5: "playfully winking",
|
|
197
|
+
6: "adorned with lashes",
|
|
198
|
+
7: "narrow and observant"
|
|
199
|
+
};
|
|
200
|
+
var EYE_COLORS_DESC = {
|
|
201
|
+
0: "dark brown",
|
|
202
|
+
1: "blue",
|
|
203
|
+
2: "green",
|
|
204
|
+
3: "amber",
|
|
205
|
+
4: "gray"
|
|
206
|
+
};
|
|
207
|
+
var EYEBROW_STYLES = {
|
|
208
|
+
0: "",
|
|
209
|
+
// none — omitted from description
|
|
210
|
+
1: "thin",
|
|
211
|
+
2: "thick, prominent",
|
|
212
|
+
3: "elegantly arched",
|
|
213
|
+
4: "sharply angled"
|
|
214
|
+
};
|
|
215
|
+
var NOSE_STYLES = {
|
|
216
|
+
0: "",
|
|
217
|
+
// none
|
|
218
|
+
1: "a small dot nose",
|
|
219
|
+
2: "a triangular nose",
|
|
220
|
+
3: "a button nose with visible nostrils"
|
|
221
|
+
};
|
|
222
|
+
var MOUTH_STYLES = {
|
|
223
|
+
0: "a gentle smile",
|
|
224
|
+
1: "a neutral, straight expression",
|
|
225
|
+
2: "a wide grin",
|
|
226
|
+
3: "a small, open mouth",
|
|
227
|
+
4: "a confident smirk",
|
|
228
|
+
5: "a broad, toothy smile"
|
|
229
|
+
};
|
|
230
|
+
var HAIR_STYLES = {
|
|
231
|
+
0: "bald, with no hair",
|
|
232
|
+
1: "short, neatly cropped hair",
|
|
233
|
+
2: "tall, spiky hair",
|
|
234
|
+
3: "side-swept hair",
|
|
235
|
+
4: "a bold mohawk",
|
|
236
|
+
5: "long hair that falls past the shoulders",
|
|
237
|
+
6: "a clean bob cut",
|
|
238
|
+
7: "a close buzz cut"
|
|
239
|
+
};
|
|
240
|
+
var HAIR_COLORS_DESC = {
|
|
241
|
+
0: "jet black",
|
|
242
|
+
1: "brown",
|
|
243
|
+
2: "blonde",
|
|
244
|
+
3: "ginger red",
|
|
245
|
+
4: "neon lime green",
|
|
246
|
+
5: "neon blue",
|
|
247
|
+
6: "Solana mint green",
|
|
248
|
+
7: "neon magenta"
|
|
249
|
+
};
|
|
250
|
+
var ACCESSORY_DESC = {
|
|
251
|
+
0: "",
|
|
252
|
+
1: "",
|
|
253
|
+
2: "round glasses",
|
|
254
|
+
3: "square-framed glasses",
|
|
255
|
+
4: "a gold earring",
|
|
256
|
+
5: "a red bandana"
|
|
257
|
+
};
|
|
258
|
+
var BG_COLORS_DESC = {
|
|
259
|
+
0: "lime green",
|
|
260
|
+
1: "blue",
|
|
261
|
+
2: "Solana mint green",
|
|
262
|
+
3: "warm sand",
|
|
263
|
+
4: "red"
|
|
264
|
+
};
|
|
265
|
+
function describeAppearance(walletAddress, options) {
|
|
266
|
+
const traits = chunk2DIKGLXZ_cjs.generateTraits(walletAddress);
|
|
267
|
+
const {
|
|
268
|
+
includeBackground = true,
|
|
269
|
+
format = "paragraph",
|
|
270
|
+
perspective = "third",
|
|
271
|
+
name
|
|
272
|
+
} = options ?? {};
|
|
273
|
+
if (format === "structured") {
|
|
274
|
+
return buildStructured(traits, includeBackground);
|
|
275
|
+
}
|
|
276
|
+
if (format === "compact") {
|
|
277
|
+
return buildCompact(traits);
|
|
278
|
+
}
|
|
279
|
+
return buildParagraph(traits, perspective, name, includeBackground);
|
|
280
|
+
}
|
|
281
|
+
function describeTraits(traits, options) {
|
|
282
|
+
const {
|
|
283
|
+
includeBackground = true,
|
|
284
|
+
format = "paragraph",
|
|
285
|
+
perspective = "third",
|
|
286
|
+
name
|
|
287
|
+
} = options ?? {};
|
|
288
|
+
if (format === "structured") return buildStructured(traits, includeBackground);
|
|
289
|
+
if (format === "compact") return buildCompact(traits);
|
|
290
|
+
return buildParagraph(traits, perspective, name, includeBackground);
|
|
291
|
+
}
|
|
292
|
+
function buildParagraph(t, perspective, name, includeBg) {
|
|
293
|
+
const parts = [];
|
|
294
|
+
const subject = perspective === "first" ? name ? `I'm ${name}. I have` : "I have" : name ? `${name} has` : "This SolFace has";
|
|
295
|
+
const im = perspective === "first" ? "I'm" : "They're";
|
|
296
|
+
parts.push(`${subject} a ${FACE_SHAPES[t.faceShape] ?? "round"} face with ${SKIN_TONES[t.skinColor] ?? "warm"} skin`);
|
|
297
|
+
const eyeStyle = EYE_STYLES[t.eyeStyle] ?? "round";
|
|
298
|
+
const eyeColor = EYE_COLORS_DESC[t.eyeColor] ?? "dark";
|
|
299
|
+
parts.push(`${eyeStyle} ${eyeColor} eyes`);
|
|
300
|
+
const brows = EYEBROW_STYLES[t.eyebrows];
|
|
301
|
+
if (brows) {
|
|
302
|
+
parts.push(`${brows} eyebrows`);
|
|
303
|
+
}
|
|
304
|
+
const hairStyle = HAIR_STYLES[t.hairStyle] ?? "";
|
|
305
|
+
const hairColor = HAIR_COLORS_DESC[t.hairColor] ?? "";
|
|
306
|
+
if (t.hairStyle === 0) {
|
|
307
|
+
parts.push("and is bald");
|
|
308
|
+
} else if (hairStyle.startsWith("a ")) {
|
|
309
|
+
parts.push(`and a ${hairColor} ${hairStyle.slice(2)}`);
|
|
310
|
+
} else {
|
|
311
|
+
parts.push(`and ${hairColor} ${hairStyle}`);
|
|
312
|
+
}
|
|
313
|
+
let desc = parts[0];
|
|
314
|
+
if (parts.length > 2) {
|
|
315
|
+
desc += ", " + parts.slice(1, -1).join(", ") + ", " + parts[parts.length - 1];
|
|
316
|
+
} else if (parts.length === 2) {
|
|
317
|
+
desc += " and " + parts[1];
|
|
318
|
+
}
|
|
319
|
+
desc += ".";
|
|
320
|
+
const nose = NOSE_STYLES[t.nose];
|
|
321
|
+
if (nose) {
|
|
322
|
+
const noseSubject = perspective === "first" ? "I have" : (name ?? "They") + (name ? " has" : " have");
|
|
323
|
+
desc += ` ${noseSubject} ${nose}.`;
|
|
324
|
+
}
|
|
325
|
+
const acc = ACCESSORY_DESC[t.accessory];
|
|
326
|
+
if (acc) {
|
|
327
|
+
desc += ` ${im} wearing ${acc}.`;
|
|
328
|
+
}
|
|
329
|
+
const mouth = MOUTH_STYLES[t.mouth] ?? "a smile";
|
|
330
|
+
const mouthVerb = perspective === "first" ? "I have" : (name ?? "They") + (name ? " has" : " have");
|
|
331
|
+
desc += ` ${mouthVerb} ${mouth}.`;
|
|
332
|
+
if (includeBg) {
|
|
333
|
+
const bg = BG_COLORS_DESC[t.bgColor] ?? "colorful";
|
|
334
|
+
desc += ` The background is ${bg}.`;
|
|
335
|
+
}
|
|
336
|
+
return desc;
|
|
337
|
+
}
|
|
338
|
+
function buildStructured(t, includeBg) {
|
|
339
|
+
const lines = [
|
|
340
|
+
`Face: ${FACE_SHAPES[t.faceShape] ?? "round"}`,
|
|
341
|
+
`Skin: ${SKIN_TONES[t.skinColor] ?? "warm"}`,
|
|
342
|
+
`Eyes: ${EYE_STYLES[t.eyeStyle] ?? "round"}, ${EYE_COLORS_DESC[t.eyeColor] ?? "dark"}`
|
|
343
|
+
];
|
|
344
|
+
const brows = EYEBROW_STYLES[t.eyebrows];
|
|
345
|
+
if (brows) lines.push(`Eyebrows: ${brows}`);
|
|
346
|
+
const nose = NOSE_STYLES[t.nose];
|
|
347
|
+
if (nose) lines.push(`Nose: ${nose.replace(/^a /, "")}`);
|
|
348
|
+
lines.push(`Mouth: ${MOUTH_STYLES[t.mouth] ?? "smile"}`);
|
|
349
|
+
if (t.hairStyle === 0) {
|
|
350
|
+
lines.push("Hair: bald");
|
|
351
|
+
} else {
|
|
352
|
+
const hs = HAIR_STYLES[t.hairStyle] ?? "";
|
|
353
|
+
const hc = HAIR_COLORS_DESC[t.hairColor] ?? "";
|
|
354
|
+
lines.push(`Hair: ${hc} ${hs.startsWith("a ") ? hs.slice(2) : hs}`);
|
|
355
|
+
}
|
|
356
|
+
const acc = ACCESSORY_DESC[t.accessory];
|
|
357
|
+
if (acc) lines.push(`Accessory: ${acc}`);
|
|
358
|
+
if (includeBg) {
|
|
359
|
+
lines.push(`Background: ${BG_COLORS_DESC[t.bgColor] ?? "colorful"}`);
|
|
360
|
+
}
|
|
361
|
+
return lines.join("\n");
|
|
362
|
+
}
|
|
363
|
+
function buildCompact(t) {
|
|
364
|
+
const parts = [];
|
|
365
|
+
parts.push(`${FACE_SHAPES[t.faceShape] ?? "round"} face`);
|
|
366
|
+
parts.push(`${SKIN_TONES[t.skinColor] ?? "warm"} skin`);
|
|
367
|
+
parts.push(`${EYE_COLORS_DESC[t.eyeColor] ?? "dark"} ${EYE_STYLES[t.eyeStyle] ?? "round"} eyes`);
|
|
368
|
+
if (t.hairStyle === 0) {
|
|
369
|
+
parts.push("bald");
|
|
370
|
+
} else {
|
|
371
|
+
const hs = (HAIR_STYLES[t.hairStyle] ?? "hair").replace(/,.*/, "");
|
|
372
|
+
const hc = HAIR_COLORS_DESC[t.hairColor] ?? "";
|
|
373
|
+
parts.push(`${hc} ${hs.startsWith("a ") ? hs.slice(2) : hs}`);
|
|
374
|
+
}
|
|
375
|
+
const acc = ACCESSORY_DESC[t.accessory];
|
|
376
|
+
if (acc) parts.push(acc);
|
|
377
|
+
parts.push((MOUTH_STYLES[t.mouth] ?? "smiling").replace(/^a /, ""));
|
|
378
|
+
return parts.join(", ");
|
|
379
|
+
}
|
|
380
|
+
function solFaceAltText(walletAddress) {
|
|
381
|
+
return `SolFace avatar: ${describeAppearance(walletAddress, { format: "compact", includeBackground: false })}`;
|
|
382
|
+
}
|
|
383
|
+
function agentAppearancePrompt(walletAddress, agentName) {
|
|
384
|
+
const desc = describeAppearance(walletAddress, {
|
|
385
|
+
perspective: "first",
|
|
386
|
+
name: agentName,
|
|
387
|
+
includeBackground: false,
|
|
388
|
+
format: "paragraph"
|
|
389
|
+
});
|
|
390
|
+
const hash = (djb2Simple(walletAddress) >>> 0).toString(16).padStart(8, "0");
|
|
391
|
+
return `My visual identity is a SolFace avatar (ID: ${hash}) derived from my wallet address. ${desc} This appearance is deterministic \u2014 anyone who looks up my wallet will see the same face.`;
|
|
392
|
+
}
|
|
393
|
+
function djb2Simple(str) {
|
|
394
|
+
let hash = 5381;
|
|
395
|
+
for (let i = 0; i < str.length; i++) {
|
|
396
|
+
hash = (hash << 5) + hash + str.charCodeAt(i) | 0;
|
|
397
|
+
}
|
|
398
|
+
return hash >>> 0;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
exports.agentAppearancePrompt = agentAppearancePrompt;
|
|
402
|
+
exports.describeAppearance = describeAppearance;
|
|
403
|
+
exports.describeTraits = describeTraits;
|
|
404
|
+
exports.renderSolFaceBase64 = renderSolFaceBase64;
|
|
405
|
+
exports.renderSolFaceDataURI = renderSolFaceDataURI;
|
|
406
|
+
exports.renderSolFaceSVG = renderSolFaceSVG;
|
|
407
|
+
exports.solFaceAltText = solFaceAltText;
|
|
408
|
+
//# sourceMappingURL=chunk-H3SK3MNX.cjs.map
|
|
409
|
+
//# sourceMappingURL=chunk-H3SK3MNX.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/renderer.ts","../src/core/describe.ts"],"names":["generateTraits","SKIN_COLORS","EYE_COLORS","HAIR_COLORS","BG_COLORS"],"mappings":";;;;;AAoBA,SAAS,UAAA,CAAW,GAAkB,IAAA,EAAsB;AAC1D,EAAA,IAAI,CAAA,CAAE,SAAA,KAAc,CAAA,EAAG,OAAO,wCAAwC,IAAI,CAAA,GAAA,CAAA;AAC1E,EAAA,IAAI,CAAA,CAAE,SAAA,KAAc,CAAA,EAAG,OAAO,kEAAkE,IAAI,CAAA,GAAA,CAAA;AACpG,EAAA,IAAI,CAAA,CAAE,SAAA,KAAc,CAAA,EAAG,OAAO,kDAAkD,IAAI,CAAA,GAAA,CAAA;AACpF,EAAA,IAAI,CAAA,CAAE,SAAA,KAAc,CAAA,EAAG,OAAO,+DAA+D,IAAI,CAAA,2BAAA,CAAA;AACjG,EAAA,OAAO,wCAAwC,IAAI,CAAA,GAAA,CAAA;AACrD;AAIA,SAAS,UAAA,CAAW,CAAA,EAAkB,CAAA,EAAW,CAAA,GAAY,OAAA,EAAiB;AAC5E,EAAA,MAAM,CAAA,GAAI,EAAA,EAAI,CAAA,GAAI,EAAA,EAAI,CAAA,GAAI,EAAA;AAE1B,EAAA,QAAQ,EAAE,QAAA;AAAU,IAClB,KAAK,CAAA;AACH,MAAA,OAAO,CAAA,YAAA,EAAe,CAAC,CAAA,MAAA,EAAS,CAAC,CAAA,g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,CAAA,EAAA,EAAK;AACnC,IAAA,IAAA,GAAA,CAAS,QAAQ,CAAA,IAAK,IAAA,GAAO,GAAA,CAAI,UAAA,CAAW,CAAC,CAAA,GAAK,CAAA;AAAA,EACpD;AACA,EAAA,OAAO,IAAA,KAAS,CAAA;AAClB","file":"chunk-H3SK3MNX.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES — SVG String Renderer\n// Generates SVG markup as strings for server-side and non-React use.\n// ═══════════════════════════════════════════════════════════════\n\nimport {\n generateTraits,\n SKIN_COLORS,\n EYE_COLORS,\n HAIR_COLORS,\n BG_COLORS,\n type SolFaceTraits,\n type SolFaceTheme,\n type RenderOptions,\n} from \"./traits\";\n\nexport type { RenderOptions } from \"./traits\";\n\n// ─── Face Shape ─────────────────────────────────\n\nfunction renderFace(t: SolFaceTraits, skin: string): string {\n if (t.faceShape === 0) return `<circle cx=\"32\" cy=\"34\" r=\"20\" fill=\"${skin}\"/>`;\n if (t.faceShape === 1) return `<rect x=\"12\" y=\"14\" width=\"40\" height=\"40\" rx=\"8\" ry=\"8\" fill=\"${skin}\"/>`;\n if (t.faceShape === 2) return `<ellipse cx=\"32\" cy=\"34\" rx=\"18\" ry=\"22\" fill=\"${skin}\"/>`;\n if (t.faceShape === 3) return `<path d=\"M32 12 L50 24 L50 44 L32 56 L14 44 L14 24 Z\" fill=\"${skin}\" stroke-linejoin=\"round\"/>`;\n return `<circle cx=\"32\" cy=\"34\" r=\"20\" fill=\"${skin}\"/>`;\n}\n\n// ─── Eyes ────────────────────────────────────────\n\nfunction renderEyes(t: SolFaceTraits, c: string, w: string = \"white\"): string {\n const l = 24, r = 40, y = 30;\n\n switch (t.eyeStyle) {\n case 0: // Round\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"3.5\" fill=\"${w}\"/><circle cx=\"${l + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3.5\" fill=\"${w}\"/><circle cx=\"${r + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n case 1: // Dots\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n case 2: // Almond\n return `<ellipse cx=\"${l}\" cy=\"${y}\" rx=\"4\" ry=\"2.5\" fill=\"${w}\"/><circle cx=\"${l + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/><ellipse cx=\"${r}\" cy=\"${y}\" rx=\"4\" ry=\"2.5\" fill=\"${w}\"/><circle cx=\"${r + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/>`;\n case 3: // Wide\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"4.5\" fill=\"${w}\"/><circle cx=\"${l}\" cy=\"${y + 0.5}\" r=\"2.5\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"4.5\" fill=\"${w}\"/><circle cx=\"${r}\" cy=\"${y + 0.5}\" r=\"2.5\" fill=\"${c}\"/>`;\n case 4: // Sleepy\n return `<ellipse cx=\"${l}\" cy=\"${y + 1}\" rx=\"3.5\" ry=\"2\" fill=\"${w}\"/><circle cx=\"${l}\" cy=\"${y + 1}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${l - 4}\" y1=\"${y - 0.5}\" x2=\"${l + 4}\" y2=\"${y - 0.5}\" stroke=\"${c}\" stroke-width=\"1\" stroke-linecap=\"round\"/><ellipse cx=\"${r}\" cy=\"${y + 1}\" rx=\"3.5\" ry=\"2\" fill=\"${w}\"/><circle cx=\"${r}\" cy=\"${y + 1}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${r - 4}\" y1=\"${y - 0.5}\" x2=\"${r + 4}\" y2=\"${y - 0.5}\" stroke=\"${c}\" stroke-width=\"1\" stroke-linecap=\"round\"/>`;\n case 5: // Winking\n return `<path d=\"M${l - 3} ${y} Q${l} ${y + 3} ${l + 3} ${y}\" fill=\"none\" stroke=\"${c}\" stroke-width=\"1.5\" stroke-linecap=\"round\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3.5\" fill=\"${w}\"/><circle cx=\"${r + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n case 6: // Lashes\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${l + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${l + 2}\" y1=\"${y - 3}\" x2=\"${l + 3.5}\" y2=\"${y - 4.5}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><line x1=\"${l + 3}\" y1=\"${y - 2}\" x2=\"${l + 4.5}\" y2=\"${y - 3}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${r + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${r + 2}\" y1=\"${y - 3}\" x2=\"${r + 3.5}\" y2=\"${y - 4.5}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><line x1=\"${r + 3}\" y1=\"${y - 2}\" x2=\"${r + 4.5}\" y2=\"${y - 3}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/>`;\n case 7: // Narrow\n return `<ellipse cx=\"${l}\" cy=\"${y}\" rx=\"4\" ry=\"1.2\" fill=\"${w}\"/><ellipse cx=\"${l + 0.5}\" cy=\"${y}\" rx=\"2\" ry=\"1\" fill=\"${c}\"/><ellipse cx=\"${r}\" cy=\"${y}\" rx=\"4\" ry=\"1.2\" fill=\"${w}\"/><ellipse cx=\"${r + 0.5}\" cy=\"${y}\" rx=\"2\" ry=\"1\" fill=\"${c}\"/>`;\n default:\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${l + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${r + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n }\n}\n\n// ─── Eyebrows ───────────────────────────────────\n\nfunction renderEyebrows(t: SolFaceTraits, col: string = \"#2a2020\"): string {\n const l = 24, r = 40, y = 25;\n\n switch (t.eyebrows) {\n case 0: return \"\";\n case 1: // Thin\n return `<line x1=\"${l - 3}\" y1=\"${y}\" x2=\"${l + 3}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><line x1=\"${r - 3}\" y1=\"${y}\" x2=\"${r + 3}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/>`;\n case 2: // Thick\n return `<line x1=\"${l - 3.5}\" y1=\"${y}\" x2=\"${l + 3.5}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"2\" stroke-linecap=\"round\"/><line x1=\"${r - 3.5}\" y1=\"${y}\" x2=\"${r + 3.5}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"2\" stroke-linecap=\"round\"/>`;\n case 3: // Arched\n return `<path d=\"M${l - 3.5} ${y + 1} Q${l} ${y - 2} ${l + 3.5} ${y + 1}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1\" stroke-linecap=\"round\"/><path d=\"M${r - 3.5} ${y + 1} Q${r} ${y - 2} ${r + 3.5} ${y + 1}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1\" stroke-linecap=\"round\"/>`;\n case 4: // Angled\n return `<line x1=\"${l - 3}\" y1=\"${y - 1}\" x2=\"${l + 3}\" y2=\"${y + 1}\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/><line x1=\"${r - 3}\" y1=\"${y + 1}\" x2=\"${r + 3}\" y2=\"${y - 1}\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n default: return \"\";\n }\n}\n\n// ─── Nose ───────────────────────────────────────\n\nfunction renderNose(t: SolFaceTraits, skin: string, noseCol?: string): string {\n const cx = 32, y = 36;\n const sh = noseCol ?? (skin + \"aa\");\n\n switch (t.nose) {\n case 0: return \"\";\n case 1: return `<circle cx=\"${cx}\" cy=\"${y}\" r=\"1.5\" fill=\"${sh}\"/>`;\n case 2: return `<path d=\"M${cx} ${y - 1.5} L${cx + 2.5} ${y + 2} L${cx - 2.5} ${y + 2} Z\" fill=\"${sh}\"/>`;\n case 3: return `<circle cx=\"${cx - 1.5}\" cy=\"${y}\" r=\"1\" fill=\"${sh}\"/><circle cx=\"${cx + 1.5}\" cy=\"${y}\" r=\"1\" fill=\"${sh}\"/>`;\n default: return \"\";\n }\n}\n\n// ─── Mouth ──────────────────────────────────────\n\nfunction renderMouth(t: SolFaceTraits, col: string = \"#c05050\", teethCol: string = \"white\"): string {\n const cx = 32, y = 42;\n\n switch (t.mouth) {\n case 0: // Smile\n return `<path d=\"M${cx - 4} ${y} Q${cx} ${y + 4} ${cx + 4} ${y}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n case 1: // Neutral\n return `<line x1=\"${cx - 3}\" y1=\"${y + 1}\" x2=\"${cx + 3}\" y2=\"${y + 1}\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n case 2: // Grin\n return `<path d=\"M${cx - 6} ${y} Q${cx} ${y + 5} ${cx + 6} ${y}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>`;\n case 3: // Open\n return `<ellipse cx=\"${cx}\" cy=\"${y + 1}\" rx=\"3\" ry=\"2.5\" fill=\"${col}\" opacity=\"0.8\"/>`;\n case 4: // Smirk\n return `<path d=\"M${cx - 4} ${y + 1} Q${cx - 1} ${y + 1} ${cx + 4} ${y - 1}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n case 5: // Wide smile\n return `<path d=\"M${cx - 6} ${y} Q${cx} ${y + 6} ${cx + 6} ${y}\" fill=\"${teethCol}\" stroke=\"${col}\" stroke-width=\"1\"/>`;\n default:\n return `<path d=\"M${cx - 4} ${y} Q${cx} ${y + 4} ${cx + 4} ${y}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n }\n}\n\n// ─── Hair ───────────────────────────────────────\n\nfunction renderHair(t: SolFaceTraits, col: string): string {\n switch (t.hairStyle) {\n case 0: return \"\"; // Bald\n case 1: return `<rect x=\"14\" y=\"12\" width=\"36\" height=\"12\" rx=\"6\" ry=\"6\" fill=\"${col}\"/>`;\n case 2: return `<g fill=\"${col}\"><rect x=\"14\" y=\"16\" width=\"36\" height=\"8\" rx=\"2\"/><polygon points=\"18,16 22,6 26,16\"/><polygon points=\"26,16 30,4 34,16\"/><polygon points=\"34,16 38,6 42,16\"/><polygon points=\"42,16 46,10 48,16\"/></g>`;\n case 3: return `<g fill=\"${col}\"><rect x=\"14\" y=\"14\" width=\"36\" height=\"10\" rx=\"4\"/><path d=\"M14 18 Q8 14 10 8 Q14 10 20 14 Z\"/></g>`;\n case 4: return `<rect x=\"26\" y=\"4\" width=\"12\" height=\"20\" rx=\"4\" ry=\"2\" fill=\"${col}\"/>`;\n case 5: return `<g fill=\"${col}\"><rect x=\"14\" y=\"12\" width=\"36\" height=\"10\" rx=\"4\"/><rect x=\"10\" y=\"18\" width=\"8\" height=\"24\" rx=\"3\"/><rect x=\"46\" y=\"18\" width=\"8\" height=\"24\" rx=\"3\"/></g>`;\n case 6: return `<path d=\"M12 22 Q12 10 32 10 Q52 10 52 22 L52 38 Q52 42 48 42 L48 26 Q48 16 32 16 Q16 16 16 26 L16 42 Q12 42 12 38 Z\" fill=\"${col}\"/>`;\n case 7: return `<rect x=\"15\" y=\"13\" width=\"34\" height=\"9\" rx=\"8\" ry=\"4\" fill=\"${col}\" opacity=\"0.7\"/>`;\n default: return \"\";\n }\n}\n\n// ─── Accessories ────────────────────────────────\n\nfunction renderAccessory(t: SolFaceTraits, col: string = \"#444\"): string {\n if (t.accessory <= 1) return \"\";\n if (t.accessory === 2) return `<g fill=\"none\" stroke=\"${col}\" stroke-width=\"1\"><circle cx=\"24\" cy=\"30\" r=\"5\"/><circle cx=\"40\" cy=\"30\" r=\"5\"/><line x1=\"29\" y1=\"30\" x2=\"35\" y2=\"30\"/><line x1=\"19\" y1=\"30\" x2=\"14\" y2=\"28\"/><line x1=\"45\" y1=\"30\" x2=\"50\" y2=\"28\"/></g>`;\n if (t.accessory === 3) return `<g fill=\"none\" stroke=\"${col}\" stroke-width=\"1\"><rect x=\"19\" y=\"26\" width=\"10\" height=\"8\" rx=\"1\"/><rect x=\"35\" y=\"26\" width=\"10\" height=\"8\" rx=\"1\"/><line x1=\"29\" y1=\"30\" x2=\"35\" y2=\"30\"/><line x1=\"19\" y1=\"30\" x2=\"14\" y2=\"28\"/><line x1=\"45\" y1=\"30\" x2=\"50\" y2=\"28\"/></g>`;\n if (t.accessory === 4) return `<circle cx=\"11\" cy=\"36\" r=\"2\" fill=\"${col}\" stroke=\"${col}\" stroke-width=\"0.5\"/>`;\n if (t.accessory === 5) return `<g><rect x=\"12\" y=\"20\" width=\"40\" height=\"4\" rx=\"1\" fill=\"${col}\"/><path d=\"M12 22 L8 26 L12 24 Z\" fill=\"${col}\"/></g>`;\n return \"\";\n}\n\n// ─── Main Render Functions ──────────────────────\n\nexport function renderSolFaceSVG(\n walletAddress: string,\n options?: RenderOptions\n): string {\n const { size = 64, theme, traitOverrides, enableBlink, className, colorOverrides } = options ?? {};\n const traits = generateTraits(walletAddress, traitOverrides);\n\n const skinColors = theme?.skinColors ?? SKIN_COLORS;\n const eyeColors = theme?.eyeColors ?? EYE_COLORS;\n const hairColors = theme?.hairColors ?? HAIR_COLORS;\n const bgColors = theme?.bgColors ?? BG_COLORS;\n\n const skin = colorOverrides?.skin ?? skinColors[traits.skinColor % skinColors.length];\n const eyeCol = colorOverrides?.eyes ?? eyeColors[traits.eyeColor % eyeColors.length];\n const hairCol = colorOverrides?.hair ?? hairColors[traits.hairColor % hairColors.length];\n const bgCol = colorOverrides?.bg ?? bgColors[traits.bgColor % bgColors.length];\n\n const bgOpacity = theme?.bgOpacity ?? 0.15;\n const bgRadius = theme?.bgRadius ?? 4;\n const mouthCol = colorOverrides?.mouth ?? theme?.mouthColor ?? \"#c05050\";\n const browCol = colorOverrides?.eyebrow ?? theme?.eyebrowColor ?? \"#2a2020\";\n const accCol = colorOverrides?.accessory ?? theme?.accessoryColor ?? \"#444\";\n const eyeWhite = colorOverrides?.eyeWhite ?? theme?.eyeWhiteColor ?? \"white\";\n const noseCol = colorOverrides?.nose ?? theme?.noseColor;\n\n const classAttr = className ? ` class=\"${className}\"` : \"\";\n let svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\" width=\"${size}\" height=\"${size}\"${classAttr}>`;\n\n svg += `<rect x=\"0\" y=\"0\" width=\"64\" height=\"64\" fill=\"${bgCol}\" opacity=\"${bgOpacity}\" rx=\"${bgRadius}\"/>`;\n\n const blinkEnabled = !!enableBlink;\n const blinkDuration = typeof enableBlink === \"object\" ? (enableBlink.duration ?? 4) : 4;\n const blinkDelay = typeof enableBlink === \"object\" ? (enableBlink.delay ?? 0) : 0;\n\n if (blinkEnabled) {\n const uid = `sf-${walletAddress.slice(0, 8)}`;\n const delayStr = blinkDelay ? ` ${blinkDelay}s` : \"\";\n svg += `<style>@keyframes ${uid}-blink{0%,90%,100%{transform:scaleY(1)}95%{transform:scaleY(0.1)}}.${uid}-eyes{animation:${uid}-blink ${blinkDuration}s ease-in-out${delayStr} infinite;transform-origin:32px 30px}</style>`;\n }\n\n svg += renderHair(traits, hairCol);\n svg += renderFace(traits, skin);\n\n if (blinkEnabled) {\n const uid = `sf-${walletAddress.slice(0, 8)}`;\n svg += `<g class=\"${uid}-eyes\">`;\n }\n svg += renderEyes(traits, eyeCol, eyeWhite);\n if (blinkEnabled) svg += `</g>`;\n\n svg += renderEyebrows(traits, browCol);\n svg += renderNose(traits, skin, noseCol);\n svg += renderMouth(traits, mouthCol, eyeWhite);\n svg += renderAccessory(traits, accCol);\n\n if (theme?.border) {\n svg += `<rect x=\"0\" y=\"0\" width=\"64\" height=\"64\" fill=\"none\" stroke=\"${theme.border.color}\" stroke-width=\"${theme.border.width}\" rx=\"${bgRadius}\"/>`;\n }\n\n svg += `</svg>`;\n\n return svg;\n}\n\nexport function renderSolFaceDataURI(\n walletAddress: string,\n options?: RenderOptions\n): string {\n const svg = renderSolFaceSVG(walletAddress, options);\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;\n}\n\nexport function renderSolFaceBase64(\n walletAddress: string,\n options?: RenderOptions\n): string {\n const svg = renderSolFaceSVG(walletAddress, options);\n return `data:image/svg+xml;base64,${btoa(svg)}`;\n}\n","// ═══════════════════════════════════════════════════════════════\n// SOLFACES — AI Agent Description Generator\n// Produces natural language descriptions of a wallet's SolFace\n// for use in system prompts, bios, and self-reference.\n// ═══════════════════════════════════════════════════════════════\n\nimport { generateTraits, type SolFaceTraits } from \"./traits\";\n\n// ─── Vocabulary Maps ─────────────────────────────────────────\n\nconst FACE_SHAPES: Record<number, string> = {\n 0: \"round\",\n 1: \"square with softly rounded corners\",\n 2: \"oval\",\n 3: \"angular, hexagonal\",\n};\n\nconst SKIN_TONES: Record<number, string> = {\n 0: \"light peach\",\n 1: \"warm tan\",\n 2: \"golden brown\",\n 3: \"medium brown\",\n 4: \"deep brown\",\n 5: \"rich dark brown\",\n};\n\nconst EYE_STYLES: Record<number, string> = {\n 0: \"round, wide-open\",\n 1: \"small and dot-like\",\n 2: \"almond-shaped\",\n 3: \"wide and expressive\",\n 4: \"sleepy, half-lidded\",\n 5: \"playfully winking\",\n 6: \"adorned with lashes\",\n 7: \"narrow and observant\",\n};\n\nconst EYE_COLORS_DESC: Record<number, string> = {\n 0: \"dark brown\",\n 1: \"blue\",\n 2: \"green\",\n 3: \"amber\",\n 4: \"gray\",\n};\n\nconst EYEBROW_STYLES: Record<number, string> = {\n 0: \"\", // none — omitted from description\n 1: \"thin\",\n 2: \"thick, prominent\",\n 3: \"elegantly arched\",\n 4: \"sharply angled\",\n};\n\nconst NOSE_STYLES: Record<number, string> = {\n 0: \"\", // none\n 1: \"a small dot nose\",\n 2: \"a triangular nose\",\n 3: \"a button nose with visible nostrils\",\n};\n\nconst MOUTH_STYLES: Record<number, string> = {\n 0: \"a gentle smile\",\n 1: \"a neutral, straight expression\",\n 2: \"a wide grin\",\n 3: \"a small, open mouth\",\n 4: \"a confident smirk\",\n 5: \"a broad, toothy smile\",\n};\n\nconst HAIR_STYLES: Record<number, string> = {\n 0: \"bald, with no hair\",\n 1: \"short, neatly cropped hair\",\n 2: \"tall, spiky hair\",\n 3: \"side-swept hair\",\n 4: \"a bold mohawk\",\n 5: \"long hair that falls past the shoulders\",\n 6: \"a clean bob cut\",\n 7: \"a close buzz cut\",\n};\n\nconst HAIR_COLORS_DESC: Record<number, string> = {\n 0: \"jet black\",\n 1: \"brown\",\n 2: \"blonde\",\n 3: \"ginger red\",\n 4: \"neon lime green\",\n 5: \"neon blue\",\n 6: \"Solana mint green\",\n 7: \"neon magenta\",\n};\n\nconst ACCESSORY_DESC: Record<number, string> = {\n 0: \"\",\n 1: \"\",\n 2: \"round glasses\",\n 3: \"square-framed glasses\",\n 4: \"a gold earring\",\n 5: \"a red bandana\",\n};\n\nconst BG_COLORS_DESC: Record<number, string> = {\n 0: \"lime green\",\n 1: \"blue\",\n 2: \"Solana mint green\",\n 3: \"warm sand\",\n 4: \"red\",\n};\n\n// ─── Description Builder ─────────────────────────────────────\n\nexport interface DescribeOptions {\n /** Include background color in description. Default: true */\n includeBackground?: boolean;\n /** Output format. Default: \"paragraph\" */\n format?: \"paragraph\" | \"structured\" | \"compact\";\n /** Perspective: how the description is framed. Default: \"third\" */\n perspective?: \"first\" | \"third\";\n /** Optional name to use instead of \"This SolFace\" / \"I\". */\n name?: string;\n}\n\n/**\n * Generate a natural language description of a SolFace avatar.\n *\n * Designed for AI agent system prompts, profile bios, alt text,\n * and anywhere a wallet's visual identity needs to be described in words.\n *\n * @example\n * ```ts\n * // For an AI agent's system prompt\n * const desc = describeAppearance(\"7xKXq...\", {\n * perspective: \"first\",\n * name: \"Atlas\",\n * });\n * // → \"I'm Atlas. I have a round face with light peach skin, wide\n * // and expressive blue eyes with elegantly arched eyebrows, and\n * // tall, spiky Solana mint green hair. I'm wearing round glasses\n * // and have a confident smirk.\"\n *\n * // For alt text\n * const alt = describeAppearance(\"7xKXq...\", { format: \"compact\" });\n * // → \"Round face, light peach skin, blue wide eyes, spiky mint hair, round glasses, smirking\"\n * ```\n */\nexport function describeAppearance(\n walletAddress: string,\n options?: DescribeOptions\n): string {\n const traits = generateTraits(walletAddress);\n const {\n includeBackground = true,\n format = \"paragraph\",\n perspective = \"third\",\n name,\n } = options ?? {};\n\n if (format === \"structured\") {\n return buildStructured(traits, includeBackground);\n }\n if (format === \"compact\") {\n return buildCompact(traits);\n }\n return buildParagraph(traits, perspective, name, includeBackground);\n}\n\n/**\n * Generate description from pre-computed traits (for when you already have them).\n */\nexport function describeTraits(\n traits: SolFaceTraits,\n options?: DescribeOptions\n): string {\n const {\n includeBackground = true,\n format = \"paragraph\",\n perspective = \"third\",\n name,\n } = options ?? {};\n\n if (format === \"structured\") return buildStructured(traits, includeBackground);\n if (format === \"compact\") return buildCompact(traits);\n return buildParagraph(traits, perspective, name, includeBackground);\n}\n\n// ─── Builders ────────────────────────────────────────────────\n\nfunction buildParagraph(\n t: SolFaceTraits,\n perspective: \"first\" | \"third\",\n name?: string,\n includeBg?: boolean\n): string {\n const parts: string[] = [];\n\n // Subject intro\n const subject = perspective === \"first\"\n ? (name ? `I'm ${name}. I have` : \"I have\")\n : (name ? `${name} has` : \"This SolFace has\");\n\n const have = perspective === \"first\" ? \"have\" : \"has\";\n const my = perspective === \"first\" ? \"my\" : \"their\";\n const im = perspective === \"first\" ? \"I'm\" : \"They're\";\n\n // Face + skin\n parts.push(`${subject} a ${FACE_SHAPES[t.faceShape] ?? \"round\"} face with ${SKIN_TONES[t.skinColor] ?? \"warm\"} skin`);\n\n // Eyes\n const eyeStyle = EYE_STYLES[t.eyeStyle] ?? \"round\";\n const eyeColor = EYE_COLORS_DESC[t.eyeColor] ?? \"dark\";\n parts.push(`${eyeStyle} ${eyeColor} eyes`);\n\n // Eyebrows (if present)\n const brows = EYEBROW_STYLES[t.eyebrows];\n if (brows) {\n parts.push(`${brows} eyebrows`);\n }\n\n // Hair\n const hairStyle = HAIR_STYLES[t.hairStyle] ?? \"\";\n const hairColor = HAIR_COLORS_DESC[t.hairColor] ?? \"\";\n if (t.hairStyle === 0) {\n parts.push(\"and is bald\");\n } else if (hairStyle.startsWith(\"a \")) {\n parts.push(`and a ${hairColor} ${hairStyle.slice(2)}`);\n } else {\n parts.push(`and ${hairColor} ${hairStyle}`);\n }\n\n // Build the main sentence\n let desc = parts[0];\n if (parts.length > 2) {\n // \"face with skin, eyes, eyebrows, and hair\"\n desc += \", \" + parts.slice(1, -1).join(\", \") + \", \" + parts[parts.length - 1];\n } else if (parts.length === 2) {\n desc += \" and \" + parts[1];\n }\n desc += \".\";\n\n // Nose\n const nose = NOSE_STYLES[t.nose];\n if (nose) {\n const noseSubject = perspective === \"first\" ? \"I have\" : (name ?? \"They\") + (name ? \" has\" : \" have\");\n desc += ` ${noseSubject} ${nose}.`;\n }\n\n // Accessory\n const acc = ACCESSORY_DESC[t.accessory];\n if (acc) {\n desc += ` ${im} wearing ${acc}.`;\n }\n\n // Mouth\n const mouth = MOUTH_STYLES[t.mouth] ?? \"a smile\";\n const mouthVerb = perspective === \"first\" ? \"I have\" : (name ?? \"They\") + (name ? \" has\" : \" have\");\n desc += ` ${mouthVerb} ${mouth}.`;\n\n // Background\n if (includeBg) {\n const bg = BG_COLORS_DESC[t.bgColor] ?? \"colorful\";\n desc += ` The background is ${bg}.`;\n }\n\n return desc;\n}\n\nfunction buildStructured(t: SolFaceTraits, includeBg: boolean): string {\n const lines: string[] = [\n `Face: ${FACE_SHAPES[t.faceShape] ?? \"round\"}`,\n `Skin: ${SKIN_TONES[t.skinColor] ?? \"warm\"}`,\n `Eyes: ${EYE_STYLES[t.eyeStyle] ?? \"round\"}, ${EYE_COLORS_DESC[t.eyeColor] ?? \"dark\"}`,\n ];\n\n const brows = EYEBROW_STYLES[t.eyebrows];\n if (brows) lines.push(`Eyebrows: ${brows}`);\n\n const nose = NOSE_STYLES[t.nose];\n if (nose) lines.push(`Nose: ${nose.replace(/^a /, \"\")}`);\n\n lines.push(`Mouth: ${MOUTH_STYLES[t.mouth] ?? \"smile\"}`);\n\n if (t.hairStyle === 0) {\n lines.push(\"Hair: bald\");\n } else {\n const hs = HAIR_STYLES[t.hairStyle] ?? \"\";\n const hc = HAIR_COLORS_DESC[t.hairColor] ?? \"\";\n lines.push(`Hair: ${hc} ${hs.startsWith(\"a \") ? hs.slice(2) : hs}`);\n }\n\n const acc = ACCESSORY_DESC[t.accessory];\n if (acc) lines.push(`Accessory: ${acc}`);\n\n if (includeBg) {\n lines.push(`Background: ${BG_COLORS_DESC[t.bgColor] ?? \"colorful\"}`);\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction buildCompact(t: SolFaceTraits): string {\n const parts: string[] = [];\n\n parts.push(`${FACE_SHAPES[t.faceShape] ?? \"round\"} face`);\n parts.push(`${SKIN_TONES[t.skinColor] ?? \"warm\"} skin`);\n parts.push(`${EYE_COLORS_DESC[t.eyeColor] ?? \"dark\"} ${EYE_STYLES[t.eyeStyle] ?? \"round\"} eyes`);\n\n if (t.hairStyle === 0) {\n parts.push(\"bald\");\n } else {\n const hs = (HAIR_STYLES[t.hairStyle] ?? \"hair\").replace(/,.*/, \"\");\n const hc = HAIR_COLORS_DESC[t.hairColor] ?? \"\";\n parts.push(`${hc} ${hs.startsWith(\"a \") ? hs.slice(2) : hs}`);\n }\n\n const acc = ACCESSORY_DESC[t.accessory];\n if (acc) parts.push(acc);\n\n parts.push((MOUTH_STYLES[t.mouth] ?? \"smiling\").replace(/^a /, \"\"));\n\n return parts.join(\", \");\n}\n\n// ─── Alt Text Helper ─────────────────────────────────────────\n\n/**\n * Generate accessible alt text for a SolFace avatar.\n * Shorter than full description, optimized for screen readers.\n */\nexport function solFaceAltText(walletAddress: string): string {\n return `SolFace avatar: ${describeAppearance(walletAddress, { format: \"compact\", includeBackground: false })}`;\n}\n\n// ─── System Prompt Helper ────────────────────────────────────\n\n/**\n * Generate a system prompt snippet for an AI agent describing its appearance.\n *\n * @example\n * ```ts\n * const appearance = agentAppearancePrompt(\"7xKXq...\", \"Atlas\");\n * // Use in system prompt:\n * // `You are Atlas, an AI agent. ${appearance}`\n * ```\n */\nexport function agentAppearancePrompt(\n walletAddress: string,\n agentName?: string\n): string {\n const desc = describeAppearance(walletAddress, {\n perspective: \"first\",\n name: agentName,\n includeBackground: false,\n format: \"paragraph\",\n });\n\n const hash = (djb2Simple(walletAddress) >>> 0).toString(16).padStart(8, \"0\");\n\n return `My visual identity is a SolFace avatar (ID: ${hash}) derived from my wallet address. ${desc} This appearance is deterministic — anyone who looks up my wallet will see the same face.`;\n}\n\n// Inline djb2 to avoid circular dependency\nfunction djb2Simple(str: string): number {\n let hash = 5381;\n for (let i = 0; i < str.length; i++) {\n hash = ((hash << 5) + hash + str.charCodeAt(i)) | 0;\n }\n return hash >>> 0;\n}\n"]}
|