solfaces 2.2.0 → 2.3.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/README.md +45 -19
- package/SKILL.md +2 -3
- package/dist/agent/index.cjs +13 -14
- package/dist/agent/index.js +3 -4
- package/dist/agent/mcp-server.cjs +326 -333
- package/dist/{chunk-5DT27HMT.js → chunk-2KW35VRI.js} +3 -3
- package/dist/{chunk-5DT27HMT.js.map → chunk-2KW35VRI.js.map} +1 -1
- package/dist/{chunk-PVJR3SFG.cjs → chunk-BI3GHRKQ.cjs} +14 -15
- package/dist/chunk-BI3GHRKQ.cjs.map +1 -0
- package/dist/{chunk-DRUSCLEF.js → chunk-MYUSB4LA.js} +28 -8
- package/dist/chunk-MYUSB4LA.js.map +1 -0
- package/dist/{chunk-3CE7Q44S.js → chunk-N5GDLCCL.js} +324 -110
- package/dist/chunk-N5GDLCCL.js.map +1 -0
- package/dist/{chunk-74CSG63X.js → chunk-O2IIBSQH.js} +6 -7
- package/dist/chunk-O2IIBSQH.js.map +1 -0
- package/dist/{chunk-6QRDULAO.cjs → chunk-PCSRDAWQ.cjs} +28 -7
- package/dist/chunk-PCSRDAWQ.cjs.map +1 -0
- package/dist/{chunk-WIXGHS77.cjs → chunk-T7HEUW2O.cjs} +6 -6
- package/dist/{chunk-WIXGHS77.cjs.map → chunk-T7HEUW2O.cjs.map} +1 -1
- package/dist/{chunk-F54WHRCE.cjs → chunk-W2U6ITMR.cjs} +328 -110
- package/dist/chunk-W2U6ITMR.cjs.map +1 -0
- package/dist/core/index.cjs +43 -44
- package/dist/core/index.d.cts +39 -5
- package/dist/core/index.d.ts +39 -5
- package/dist/core/index.js +2 -3
- package/dist/index.cjs +53 -50
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -5
- package/dist/react/index.cjs +107 -120
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +23 -1
- package/dist/react/index.d.ts +23 -1
- package/dist/react/index.js +95 -108
- package/dist/react/index.js.map +1 -1
- package/dist/solfaces.cdn.global.js +2 -2
- package/dist/solfaces.cdn.global.js.map +1 -1
- package/dist/themes/index.cjs +18 -14
- package/dist/themes/index.d.cts +30 -4
- package/dist/themes/index.d.ts +30 -4
- package/dist/themes/index.js +1 -1
- package/dist/traits-D4tbtZIr.d.cts +259 -0
- package/dist/traits-D4tbtZIr.d.ts +259 -0
- package/dist/vanilla/index.cjs +6 -7
- package/dist/vanilla/index.cjs.map +1 -1
- package/dist/vanilla/index.d.cts +1 -1
- package/dist/vanilla/index.d.ts +1 -1
- package/dist/vanilla/index.js +2 -3
- package/dist/vanilla/index.js.map +1 -1
- package/package.json +4 -1
- package/python/solfaces.py +103 -119
- package/reference/integrations.md +1 -1
- package/dist/chunk-3CE7Q44S.js.map +0 -1
- package/dist/chunk-6QRDULAO.cjs.map +0 -1
- package/dist/chunk-74CSG63X.js.map +0 -1
- package/dist/chunk-CKHLRORB.js +0 -239
- package/dist/chunk-CKHLRORB.js.map +0 -1
- package/dist/chunk-DRUSCLEF.js.map +0 -1
- package/dist/chunk-F54WHRCE.cjs.map +0 -1
- package/dist/chunk-PVJR3SFG.cjs.map +0 -1
- package/dist/chunk-TYTBYDQU.cjs +0 -244
- package/dist/chunk-TYTBYDQU.cjs.map +0 -1
- package/dist/traits-sfe7rM9C.d.cts +0 -106
- package/dist/traits-sfe7rM9C.d.ts +0 -106
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agent/tools.ts","../src/agent/index.ts"],"names":["getPresetTheme","renderSolFaceSVG","deriveName","describeAppearance","generateTraits","getTraitLabels","traitHash","agentAppearancePrompt","PRESET_THEMES","deriveIdentity"],"mappings":";;;;;;;;AAsCA,IAAM,kBAAA,GAAkC;AAAA,EACtC,IAAA,EAAM,sBAAA;AAAA,EACN,WAAA,EACE,8PAAA;AAAA,EACF,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,QAAA;AAAA,IAC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ACF;AAEO,SAAS,cAAA,GAA+B;AAC7C,EAAA,OAAO,aAAA,CAAc,IAAI,QAAQ,CAAA;AACnC;AAWO,SAAS,YAAY,IAAA,EAAkC;AAC5D,EAAA,OAAO;AAAA,IACL,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,aAAa,IAAA,CAAK,WAAA;AAAA,IAClB,cAAc,IAAA,CAAK;AAAA,GACrB;AACF;AAEO,SAAS,iBAAA,GAAqC;AACnD,EAAA,OAAO,aAAA,CAAc,IAAI,WAAW,CAAA;AACtC;AAWO,SAAS,WAAW,IAAA,EAAiC;AAC1D,EAAA,OAAO;AAAA,IACL,aAAa,IAAA,CAAK,WAAA;AAAA,IAClB,YAAY,IAAA,CAAK,UAAA;AAAA,IACjB,OAAA,EAAS,OAAO,MAAA,KAAW,IAAA,CAAK,QAAQ,MAAM;AAAA,GAChD;AACF;AAEO,SAAS,gBAAA,GAAiD;AAC/D,EAAA,MAAM,SAAuC,EAAC;AAC9C,EAAA,KAAA,MAAW,QAAQ,aAAA,EAAe;AAChC,IAAA,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA,GAAI,UAAA,CAAW,IAAI,CAAA;AAAA,EACrC;AACA,EAAA,OAAO,MAAA;AACT","file":"chunk-PVJR3SFG.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES v2 — AI Agent Tool Definitions\n// Canonical, framework-agnostic tool schemas with handlers.\n// ═══════════════════════════════════════════════════════════════\n\nimport { renderSolFaceSVG } from \"../core/renderer\";\nimport { describeAppearance, agentAppearancePrompt } from \"../core/describe\";\nimport {\n generateTraits,\n getTraitLabels,\n traitHash,\n} from \"../core/traits\";\nimport { deriveName, deriveIdentity } from \"../names\";\nimport type { NameFormat } from \"../names\";\nimport { PRESET_THEMES, getPresetTheme } from \"../themes/presets\";\nimport type { SolFaceTheme } from \"../core/traits\";\n\n// ─── Types ───────────────────────────────────────\n\nexport interface JSONSchema {\n type: string;\n properties?: Record<string, JSONSchema & { description?: string; enum?: string[] }>;\n required?: string[];\n items?: JSONSchema;\n description?: string;\n enum?: string[];\n default?: unknown;\n}\n\nexport interface SolFaceTool {\n name: string;\n description: string;\n parameters: JSONSchema;\n handler: (params: Record<string, unknown>) => unknown;\n}\n\n// ─── Tool: generate_solface_svg ──────────────────\n\nconst generateSolfaceSvg: SolFaceTool = {\n name: \"generate_solface_svg\",\n description:\n \"Generate a deterministic SVG avatar for a Solana wallet address. Returns an SVG string with gradient-rich rendering, skin-luminance-driven colors, and 10 accessory types. The same wallet always produces the same face. ~2.56 billion unique combinations.\",\n parameters: {\n type: \"object\",\n properties: {\n wallet: {\n type: \"string\",\n description: \"Solana wallet address (base58 public key)\",\n },\n size: {\n type: \"number\",\n description: \"SVG width/height in pixels. Default: 64. Sizes >= 48 use full detail (gradients, specular highlights, cheek blush).\",\n },\n theme: {\n type: \"string\",\n description:\n \"Preset theme name. 'flat' and 'transparent' work everywhere. 'glass', 'glassDark', 'pixel', 'pixelRetro', 'pixelClean' are React-only.\",\n enum: [\"default\", \"dark\", \"light\", \"mono\", \"flat\", \"transparent\", \"glass\", \"glassDark\", \"pixel\", \"pixelRetro\", \"pixelClean\"],\n },\n enableBlink: {\n type: \"boolean\",\n description: \"Enable CSS blink animation on the eyes. Default: false\",\n },\n detail: {\n type: \"string\",\n description: \"Detail level: 'full' (gradients, cheeks, specular), 'simplified' (flat shapes), 'auto' (full if size >= 48). Default: auto\",\n enum: [\"full\", \"simplified\", \"auto\"],\n },\n },\n required: [\"wallet\"],\n },\n handler(params) {\n const wallet = params.wallet as string;\n const size = (params.size as number) ?? 64;\n const enableBlink = (params.enableBlink as boolean) ?? false;\n const detail = (params.detail as \"full\" | \"simplified\" | \"auto\") ?? \"auto\";\n const themeName = params.theme as string | undefined;\n const theme: SolFaceTheme | undefined = themeName\n ? getPresetTheme(themeName)\n : undefined;\n\n return renderSolFaceSVG(wallet, { size, theme, enableBlink, detail });\n },\n};\n\n// ─── Tool: describe_solface ──────────────────────\n\nconst describeSolface: SolFaceTool = {\n name: \"describe_solface\",\n description:\n \"Generate a natural language description of a wallet's SolFace avatar. Useful for alt text, profile bios, system prompts, and accessibility. Describes squircle face, skin tone, eye style/color, hair, accessories, and expression.\",\n parameters: {\n type: \"object\",\n properties: {\n wallet: {\n type: \"string\",\n description: \"Solana wallet address (base58 public key)\",\n },\n format: {\n type: \"string\",\n description:\n \"Output format: paragraph (flowing text), structured (labeled lines), compact (short comma-separated). Default: paragraph\",\n enum: [\"paragraph\", \"structured\", \"compact\"],\n },\n perspective: {\n type: \"string\",\n description:\n 'Narrative perspective: \"first\" for self-description (\"I have...\"), \"third\" for external (\"This SolFace has...\"). Default: third',\n enum: [\"first\", \"third\"],\n },\n name: {\n type: \"string\",\n description:\n 'Optional name to use instead of \"This SolFace\" or \"I\". E.g. \"Atlas\"',\n },\n },\n required: [\"wallet\"],\n },\n handler(params) {\n const wallet = params.wallet as string;\n const name = (params.name as string | undefined) ?? deriveName(wallet, \"display\");\n return describeAppearance(wallet, {\n format: (params.format as \"paragraph\" | \"structured\" | \"compact\") ?? \"paragraph\",\n perspective: (params.perspective as \"first\" | \"third\") ?? \"third\",\n name,\n });\n },\n};\n\n// ─── Tool: get_solface_traits ────────────────────\n\nconst getSolfaceTraits: SolFaceTool = {\n name: \"get_solface_traits\",\n description:\n \"Get the raw numeric trait values, human-readable labels, and deterministic hash for a wallet's SolFace avatar. Returns structured data useful for programmatic decisions about appearance.\",\n parameters: {\n type: \"object\",\n properties: {\n wallet: {\n type: \"string\",\n description: \"Solana wallet address (base58 public key)\",\n },\n },\n required: [\"wallet\"],\n },\n handler(params) {\n const wallet = params.wallet as string;\n const traits = generateTraits(wallet);\n const labels = getTraitLabels(traits);\n const hash = traitHash(wallet);\n const name = deriveName(wallet, \"display\");\n return { traits, labels, hash, name };\n },\n};\n\n// ─── Tool: get_agent_identity ────────────────────\n\nconst getAgentIdentity: SolFaceTool = {\n name: \"get_agent_identity\",\n description:\n \"Generate a system prompt snippet that gives an AI agent a visual identity based on its Solana wallet. The snippet describes the agent's appearance in first person and explains the deterministic nature of SolFace avatars.\",\n parameters: {\n type: \"object\",\n properties: {\n wallet: {\n type: \"string\",\n description: \"The agent's Solana wallet address (base58 public key)\",\n },\n agentName: {\n type: \"string\",\n description: 'Optional agent name to personalize the description. E.g. \"Atlas\"',\n },\n },\n required: [\"wallet\"],\n },\n handler(params) {\n const wallet = params.wallet as string;\n const agentName = (params.agentName as string | undefined) ?? deriveName(wallet, \"display\");\n return agentAppearancePrompt(wallet, agentName);\n },\n};\n\n// ─── Tool: list_solface_themes ───────────────────\n\nconst THEME_DESCRIPTIONS: Record<string, string> = {\n default: \"Base look with gradient-rich rendering — no overrides\",\n dark: \"Dark backgrounds with muted tones and subtle border\",\n light: \"Soft pastel backgrounds with rounded corners\",\n mono: \"Full grayscale — all colors replaced with grays\",\n flat: \"Disables all gradients — uses flat fill colors only\",\n transparent: \"Transparent background with flat rendering\",\n glass: \"Liquid glass effect with backdrop blur and specular highlights (React-only)\",\n glassDark: \"Dark variant of liquid glass with deeper blur (React-only)\",\n pixel: \"Pixel art mode at 16px density with rounded corners (React-only)\",\n pixelRetro: \"Retro pixel art with scanlines and drop shadow (React-only)\",\n pixelClean: \"Clean pixel art at 24px density (React-only)\",\n};\n\nconst listSolfaceThemes: SolFaceTool = {\n name: \"list_solface_themes\",\n description:\n \"List all available SolFace preset themes with descriptions. Themes control colors, gradients, borders, and rendering modes. Some themes (glass, pixel) are React-only.\",\n parameters: {\n type: \"object\",\n properties: {},\n },\n handler() {\n return Object.keys(PRESET_THEMES).map((name) => ({\n name,\n description: THEME_DESCRIPTIONS[name] ?? \"\",\n reactOnly: name.startsWith(\"glass\") || name.startsWith(\"pixel\"),\n }));\n },\n};\n\n// ─── Tool: derive_solname ────────────────────────\n\nconst deriveSolname: SolFaceTool = {\n name: \"derive_solname\",\n description:\n \"Derive a deterministic name from a Solana wallet address using SHA-256 hashing. Returns human-friendly names like 'Sunny Icon'. Same wallet always produces the same name. ~1M display name combinations, ~65.5B unique tag combinations.\",\n parameters: {\n type: \"object\",\n properties: {\n wallet: {\n type: \"string\",\n description: \"Solana wallet address (base58 public key)\",\n },\n format: {\n type: \"string\",\n description:\n \"Name format: 'short' (adjective only), 'display' (adj noun, default), 'tag' (adj noun#hex, unique), 'full' (adj noun-adj noun). Omit for full identity bundle.\",\n enum: [\"short\", \"display\", \"tag\", \"full\"],\n },\n },\n required: [\"wallet\"],\n },\n handler(params) {\n const wallet = params.wallet as string;\n const format = params.format as NameFormat | undefined;\n if (format) {\n return deriveName(wallet, format);\n }\n return deriveIdentity(wallet);\n },\n};\n\n// ─── Export All Tools ────────────────────────────\n\nexport const SOLFACE_TOOLS: SolFaceTool[] = [\n generateSolfaceSvg,\n describeSolface,\n getSolfaceTraits,\n getAgentIdentity,\n listSolfaceThemes,\n deriveSolname,\n];\n","// ═══════════════════════════════════════════════════════════════\n// SOLFACES — Agent Integration Barrel + Format Adapters\n// Convert SolFace tools to any AI agent framework format.\n// ═══════════════════════════════════════════════════════════════\n\nexport { SOLFACE_TOOLS } from \"./tools\";\nexport type { SolFaceTool, JSONSchema } from \"./tools\";\n\nimport { SOLFACE_TOOLS } from \"./tools\";\nimport type { SolFaceTool, JSONSchema } from \"./tools\";\n\n// ─── Unified Dispatcher ─────────────────────────\n\n/**\n * Handle a tool call by name. Works as a universal dispatcher for\n * any framework — just pass the tool name and parameters.\n *\n * @example\n * ```ts\n * const svg = await handleToolCall(\"generate_solface_svg\", {\n * wallet: \"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\"\n * });\n * ```\n */\nexport async function handleToolCall(\n name: string,\n params: Record<string, unknown>,\n): Promise<unknown> {\n const tool = SOLFACE_TOOLS.find((t) => t.name === name);\n if (!tool) {\n throw new Error(`Unknown SolFace tool: \"${name}\". Available: ${SOLFACE_TOOLS.map((t) => t.name).join(\", \")}`);\n }\n return tool.handler(params);\n}\n\n// ─── MCP Format ─────────────────────────────────\n// Model Context Protocol (Claude Code, Cursor, Windsurf)\n\nexport interface MCPTool {\n name: string;\n description: string;\n inputSchema: JSONSchema;\n}\n\nexport function toMCP(tool: SolFaceTool): MCPTool {\n return {\n name: tool.name,\n description: tool.description,\n inputSchema: tool.parameters,\n };\n}\n\nexport function allToolsMCP(): MCPTool[] {\n return SOLFACE_TOOLS.map(toMCP);\n}\n\n// ─── OpenAI Format ──────────────────────────────\n// OpenAI function calling / GPT Actions\n\nexport interface OpenAITool {\n type: \"function\";\n function: {\n name: string;\n description: string;\n parameters: JSONSchema;\n };\n}\n\nexport function toOpenAI(tool: SolFaceTool): OpenAITool {\n return {\n type: \"function\",\n function: {\n name: tool.name,\n description: tool.description,\n parameters: tool.parameters,\n },\n };\n}\n\nexport function allToolsOpenAI(): OpenAITool[] {\n return SOLFACE_TOOLS.map(toOpenAI);\n}\n\n// ─── Anthropic Format ───────────────────────────\n// Anthropic tool use (Claude API)\n\nexport interface AnthropicTool {\n name: string;\n description: string;\n input_schema: JSONSchema;\n}\n\nexport function toAnthropic(tool: SolFaceTool): AnthropicTool {\n return {\n name: tool.name,\n description: tool.description,\n input_schema: tool.parameters,\n };\n}\n\nexport function allToolsAnthropic(): AnthropicTool[] {\n return SOLFACE_TOOLS.map(toAnthropic);\n}\n\n// ─── Vercel AI SDK Format ───────────────────────\n// For use with Vercel AI SDK's `tool()` helper\n\nexport interface VercelAITool {\n description: string;\n parameters: JSONSchema;\n execute: (params: Record<string, unknown>) => Promise<unknown>;\n}\n\nexport function toVercelAI(tool: SolFaceTool): VercelAITool {\n return {\n description: tool.description,\n parameters: tool.parameters,\n execute: async (params) => tool.handler(params),\n };\n}\n\nexport function allToolsVercelAI(): Record<string, VercelAITool> {\n const result: Record<string, VercelAITool> = {};\n for (const tool of SOLFACE_TOOLS) {\n result[tool.name] = toVercelAI(tool);\n }\n return result;\n}\n"]}
|
package/dist/chunk-TYTBYDQU.cjs
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkF54WHRCE_cjs = require('./chunk-F54WHRCE.cjs');
|
|
4
|
-
|
|
5
|
-
// src/core/describe.ts
|
|
6
|
-
var SKIN_TONES = {
|
|
7
|
-
0: "porcelain",
|
|
8
|
-
1: "ivory",
|
|
9
|
-
2: "fair",
|
|
10
|
-
3: "light",
|
|
11
|
-
4: "sand",
|
|
12
|
-
5: "golden",
|
|
13
|
-
6: "warm",
|
|
14
|
-
7: "caramel",
|
|
15
|
-
8: "brown",
|
|
16
|
-
9: "deep"
|
|
17
|
-
};
|
|
18
|
-
var EYE_STYLES = {
|
|
19
|
-
0: "round, wide-open",
|
|
20
|
-
1: "small and minimal",
|
|
21
|
-
2: "almond-shaped",
|
|
22
|
-
3: "wide and expressive",
|
|
23
|
-
4: "relaxed, half-lidded",
|
|
24
|
-
5: "joyful, crescent-shaped",
|
|
25
|
-
6: "bright and sparkling",
|
|
26
|
-
7: "gentle and narrow"
|
|
27
|
-
};
|
|
28
|
-
var EYE_COLORS_DESC = {
|
|
29
|
-
0: "dark brown",
|
|
30
|
-
1: "blue",
|
|
31
|
-
2: "green",
|
|
32
|
-
3: "hazel",
|
|
33
|
-
4: "gray"
|
|
34
|
-
};
|
|
35
|
-
var EYEBROW_STYLES = {
|
|
36
|
-
0: "wispy",
|
|
37
|
-
1: "straight",
|
|
38
|
-
2: "natural",
|
|
39
|
-
3: "elegantly arched",
|
|
40
|
-
4: "sharply angled"
|
|
41
|
-
};
|
|
42
|
-
var NOSE_STYLES = {
|
|
43
|
-
0: "a subtle shadow nose",
|
|
44
|
-
1: "a small button nose",
|
|
45
|
-
2: "a soft curved nose",
|
|
46
|
-
3: "a button nose with visible nostrils"
|
|
47
|
-
};
|
|
48
|
-
var MOUTH_STYLES = {
|
|
49
|
-
0: "a gentle smile",
|
|
50
|
-
1: "a calm, neutral expression",
|
|
51
|
-
2: "a happy grin",
|
|
52
|
-
3: "a surprised O-shaped mouth",
|
|
53
|
-
4: "a confident smirk",
|
|
54
|
-
5: "a wide, toothy grin",
|
|
55
|
-
6: "a flat, straight expression",
|
|
56
|
-
7: "a soft pout"
|
|
57
|
-
};
|
|
58
|
-
var HAIR_STYLES = {
|
|
59
|
-
0: "bald, with no hair",
|
|
60
|
-
1: "short, neatly cropped hair",
|
|
61
|
-
2: "bouncy, curly hair",
|
|
62
|
-
3: "side-swept hair",
|
|
63
|
-
4: "a voluminous puff",
|
|
64
|
-
5: "long hair that falls past the shoulders",
|
|
65
|
-
6: "a clean bob cut",
|
|
66
|
-
7: "a close buzz cut",
|
|
67
|
-
8: "flowing, wavy hair",
|
|
68
|
-
9: "a neat topknot"
|
|
69
|
-
};
|
|
70
|
-
var HAIR_COLORS_DESC = {
|
|
71
|
-
0: "jet black",
|
|
72
|
-
1: "espresso brown",
|
|
73
|
-
2: "walnut",
|
|
74
|
-
3: "honey blonde",
|
|
75
|
-
4: "copper red",
|
|
76
|
-
5: "silver",
|
|
77
|
-
6: "charcoal",
|
|
78
|
-
7: "burgundy",
|
|
79
|
-
8: "strawberry",
|
|
80
|
-
9: "ginger"
|
|
81
|
-
};
|
|
82
|
-
var ACCESSORY_DESC = {
|
|
83
|
-
0: "",
|
|
84
|
-
1: "a beauty mark",
|
|
85
|
-
2: "round glasses",
|
|
86
|
-
3: "rectangular glasses",
|
|
87
|
-
4: "a dangling earring",
|
|
88
|
-
5: "a headband",
|
|
89
|
-
6: "freckles",
|
|
90
|
-
7: "stud earrings",
|
|
91
|
-
8: "aviator sunglasses",
|
|
92
|
-
9: "a band-aid"
|
|
93
|
-
};
|
|
94
|
-
var BG_COLORS_DESC = {
|
|
95
|
-
0: "rose",
|
|
96
|
-
1: "olive",
|
|
97
|
-
2: "sage",
|
|
98
|
-
3: "fern",
|
|
99
|
-
4: "mint",
|
|
100
|
-
5: "ocean",
|
|
101
|
-
6: "sky",
|
|
102
|
-
7: "lavender",
|
|
103
|
-
8: "orchid",
|
|
104
|
-
9: "blush"
|
|
105
|
-
};
|
|
106
|
-
function describeAppearance(walletAddress, options) {
|
|
107
|
-
const traits = chunkF54WHRCE_cjs.generateTraits(walletAddress);
|
|
108
|
-
const {
|
|
109
|
-
includeBackground = true,
|
|
110
|
-
format = "paragraph",
|
|
111
|
-
perspective = "third",
|
|
112
|
-
name
|
|
113
|
-
} = options ?? {};
|
|
114
|
-
if (format === "structured") return buildStructured(traits, includeBackground);
|
|
115
|
-
if (format === "compact") return buildCompact(traits);
|
|
116
|
-
return buildParagraph(traits, perspective, name, includeBackground);
|
|
117
|
-
}
|
|
118
|
-
function describeTraits(traits, options) {
|
|
119
|
-
const {
|
|
120
|
-
includeBackground = true,
|
|
121
|
-
format = "paragraph",
|
|
122
|
-
perspective = "third",
|
|
123
|
-
name
|
|
124
|
-
} = options ?? {};
|
|
125
|
-
if (format === "structured") return buildStructured(traits, includeBackground);
|
|
126
|
-
if (format === "compact") return buildCompact(traits);
|
|
127
|
-
return buildParagraph(traits, perspective, name, includeBackground);
|
|
128
|
-
}
|
|
129
|
-
function buildParagraph(t, perspective, name, includeBg) {
|
|
130
|
-
const parts = [];
|
|
131
|
-
const ai = chunkF54WHRCE_cjs.effectiveAccessory(t);
|
|
132
|
-
const subject = perspective === "first" ? name ? `I'm ${name}. I have` : "I have" : name ? `${name} has` : "This SolFace has";
|
|
133
|
-
const im = perspective === "first" ? "I'm" : "They're";
|
|
134
|
-
parts.push(`${subject} a squircle face with ${SKIN_TONES[t.skinColor] ?? "warm"} skin`);
|
|
135
|
-
const eyeStyle = EYE_STYLES[t.eyeStyle] ?? "round";
|
|
136
|
-
const eyeColor = EYE_COLORS_DESC[t.eyeColor] ?? "dark";
|
|
137
|
-
parts.push(`${eyeStyle} ${eyeColor} eyes`);
|
|
138
|
-
const brows = EYEBROW_STYLES[t.eyebrows];
|
|
139
|
-
if (brows) parts.push(`${brows} eyebrows`);
|
|
140
|
-
const hairStyle = HAIR_STYLES[t.hairStyle] ?? "";
|
|
141
|
-
const hairColor = HAIR_COLORS_DESC[t.hairColor] ?? "";
|
|
142
|
-
if (t.hairStyle === 0) {
|
|
143
|
-
parts.push(perspective === "first" ? "and am bald" : "and is bald");
|
|
144
|
-
} else if (hairStyle.startsWith("a ")) {
|
|
145
|
-
parts.push(`and a ${hairColor} ${hairStyle.slice(2)}`);
|
|
146
|
-
} else {
|
|
147
|
-
parts.push(`and ${hairColor} ${hairStyle}`);
|
|
148
|
-
}
|
|
149
|
-
let desc = parts[0];
|
|
150
|
-
if (parts.length > 2) {
|
|
151
|
-
desc += ", " + parts.slice(1, -1).join(", ") + ", " + parts[parts.length - 1];
|
|
152
|
-
} else if (parts.length === 2) {
|
|
153
|
-
desc += " and " + parts[1];
|
|
154
|
-
}
|
|
155
|
-
desc += ".";
|
|
156
|
-
const nose = NOSE_STYLES[t.nose];
|
|
157
|
-
if (nose) {
|
|
158
|
-
const noseSubject = perspective === "first" ? "I have" : (name ?? "They") + (name ? " has" : " have");
|
|
159
|
-
desc += ` ${noseSubject} ${nose}.`;
|
|
160
|
-
}
|
|
161
|
-
const acc = ACCESSORY_DESC[ai];
|
|
162
|
-
if (acc) {
|
|
163
|
-
desc += ` ${im} wearing ${acc}.`;
|
|
164
|
-
}
|
|
165
|
-
const mouth = MOUTH_STYLES[t.mouth] ?? "a smile";
|
|
166
|
-
const mouthVerb = perspective === "first" ? "I have" : (name ?? "They") + (name ? " has" : " have");
|
|
167
|
-
desc += ` ${mouthVerb} ${mouth}.`;
|
|
168
|
-
if (includeBg) {
|
|
169
|
-
const bg = BG_COLORS_DESC[t.bgColor] ?? "colorful";
|
|
170
|
-
desc += ` The background is ${bg}.`;
|
|
171
|
-
}
|
|
172
|
-
return desc;
|
|
173
|
-
}
|
|
174
|
-
function buildStructured(t, includeBg) {
|
|
175
|
-
const ai = chunkF54WHRCE_cjs.effectiveAccessory(t);
|
|
176
|
-
const lines = [
|
|
177
|
-
`Face: squircle`,
|
|
178
|
-
`Skin: ${SKIN_TONES[t.skinColor] ?? "warm"}`,
|
|
179
|
-
`Eyes: ${EYE_STYLES[t.eyeStyle] ?? "round"}, ${EYE_COLORS_DESC[t.eyeColor] ?? "dark"}`,
|
|
180
|
-
`Eyebrows: ${EYEBROW_STYLES[t.eyebrows] ?? "wispy"}`
|
|
181
|
-
];
|
|
182
|
-
const nose = NOSE_STYLES[t.nose];
|
|
183
|
-
if (nose) lines.push(`Nose: ${nose.replace(/^a /, "")}`);
|
|
184
|
-
lines.push(`Mouth: ${MOUTH_STYLES[t.mouth] ?? "smile"}`);
|
|
185
|
-
if (t.hairStyle === 0) {
|
|
186
|
-
lines.push("Hair: bald");
|
|
187
|
-
} else {
|
|
188
|
-
const hs = HAIR_STYLES[t.hairStyle] ?? "";
|
|
189
|
-
const hc = HAIR_COLORS_DESC[t.hairColor] ?? "";
|
|
190
|
-
lines.push(`Hair: ${hc} ${hs.startsWith("a ") ? hs.slice(2) : hs}`);
|
|
191
|
-
}
|
|
192
|
-
const acc = ACCESSORY_DESC[ai];
|
|
193
|
-
if (acc) lines.push(`Accessory: ${acc}`);
|
|
194
|
-
if (includeBg) {
|
|
195
|
-
lines.push(`Background: ${BG_COLORS_DESC[t.bgColor] ?? "colorful"}`);
|
|
196
|
-
}
|
|
197
|
-
return lines.join("\n");
|
|
198
|
-
}
|
|
199
|
-
function buildCompact(t) {
|
|
200
|
-
const ai = chunkF54WHRCE_cjs.effectiveAccessory(t);
|
|
201
|
-
const parts = [];
|
|
202
|
-
parts.push(`squircle face`);
|
|
203
|
-
parts.push(`${SKIN_TONES[t.skinColor] ?? "warm"} skin`);
|
|
204
|
-
parts.push(`${EYE_COLORS_DESC[t.eyeColor] ?? "dark"} ${EYE_STYLES[t.eyeStyle] ?? "round"} eyes`);
|
|
205
|
-
if (t.hairStyle === 0) {
|
|
206
|
-
parts.push("bald");
|
|
207
|
-
} else {
|
|
208
|
-
const raw = HAIR_STYLES[t.hairStyle] ?? "hair";
|
|
209
|
-
const hs = raw.includes(",") ? raw.replace(/.*,\s*/, "") : raw;
|
|
210
|
-
const hc = HAIR_COLORS_DESC[t.hairColor] ?? "";
|
|
211
|
-
parts.push(`${hc} ${hs.startsWith("a ") ? hs.slice(2) : hs}`);
|
|
212
|
-
}
|
|
213
|
-
const acc = ACCESSORY_DESC[ai];
|
|
214
|
-
if (acc) parts.push(acc);
|
|
215
|
-
parts.push((MOUTH_STYLES[t.mouth] ?? "smiling").replace(/^a /, ""));
|
|
216
|
-
return parts.join(", ");
|
|
217
|
-
}
|
|
218
|
-
function solFaceAltText(walletAddress) {
|
|
219
|
-
return `SolFace avatar: ${describeAppearance(walletAddress, { format: "compact", includeBackground: false })}`;
|
|
220
|
-
}
|
|
221
|
-
function agentAppearancePrompt(walletAddress, agentName) {
|
|
222
|
-
const desc = describeAppearance(walletAddress, {
|
|
223
|
-
perspective: "first",
|
|
224
|
-
name: agentName,
|
|
225
|
-
includeBackground: false,
|
|
226
|
-
format: "paragraph"
|
|
227
|
-
});
|
|
228
|
-
const hash = (djb2Simple(walletAddress) >>> 0).toString(16).padStart(8, "0");
|
|
229
|
-
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.`;
|
|
230
|
-
}
|
|
231
|
-
function djb2Simple(str) {
|
|
232
|
-
let hash = 5381;
|
|
233
|
-
for (let i = 0; i < str.length; i++) {
|
|
234
|
-
hash = (hash << 5) + hash + str.charCodeAt(i) | 0;
|
|
235
|
-
}
|
|
236
|
-
return hash >>> 0;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
exports.agentAppearancePrompt = agentAppearancePrompt;
|
|
240
|
-
exports.describeAppearance = describeAppearance;
|
|
241
|
-
exports.describeTraits = describeTraits;
|
|
242
|
-
exports.solFaceAltText = solFaceAltText;
|
|
243
|
-
//# sourceMappingURL=chunk-TYTBYDQU.cjs.map
|
|
244
|
-
//# sourceMappingURL=chunk-TYTBYDQU.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/describe.ts"],"names":["generateTraits","eff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AmB,aAAA,EAAe;AAAA,IAC7C,WAAA,EAAa,OAAA;AAAA,IACb,IAAA,EAAM,SAAA;AAAA,IACN,iBAAA,EAAmB,KAAA;AAAA,IACnB,MAAA,EAAQ;AAAA,GACT,CAAA;AAED,EAAA,MAAM,IAAA,GAAA,CAAQ,UAAA,CAAW,aAAa,CAAA,KAAM,CAAA,EAAG,SAAS,EAAE,CAAA,CAAE,QAAA,CAAS,CAAA,EAAG,GAAG,CAAA;AAE3E,EAAA,OAAO,CAAA,4CAAA,EAA+C,IAAI,CAAA,kCAAA,EAAqC,IAAI,CAAA,8FAAA,CAAA;AACrG;AAGA,SAAS,WAAW,GAAA,EAAqB;AACvC,EAAA,IAAI,IAAA,GAAO,IAAA;AACX,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,GAAA,CAAI,QAAQ,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-TYTBYDQU.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES v2 — 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, effectiveAccessory, type SolFaceTraits } from \"./traits\";\n\n// ─── Vocabulary Maps ─────────────────────────────────────────\n\nconst SKIN_TONES: Record<number, string> = {\n 0: \"porcelain\",\n 1: \"ivory\",\n 2: \"fair\",\n 3: \"light\",\n 4: \"sand\",\n 5: \"golden\",\n 6: \"warm\",\n 7: \"caramel\",\n 8: \"brown\",\n 9: \"deep\",\n};\n\nconst EYE_STYLES: Record<number, string> = {\n 0: \"round, wide-open\",\n 1: \"small and minimal\",\n 2: \"almond-shaped\",\n 3: \"wide and expressive\",\n 4: \"relaxed, half-lidded\",\n 5: \"joyful, crescent-shaped\",\n 6: \"bright and sparkling\",\n 7: \"gentle and narrow\",\n};\n\nconst EYE_COLORS_DESC: Record<number, string> = {\n 0: \"dark brown\",\n 1: \"blue\",\n 2: \"green\",\n 3: \"hazel\",\n 4: \"gray\",\n};\n\nconst EYEBROW_STYLES: Record<number, string> = {\n 0: \"wispy\",\n 1: \"straight\",\n 2: \"natural\",\n 3: \"elegantly arched\",\n 4: \"sharply angled\",\n};\n\nconst NOSE_STYLES: Record<number, string> = {\n 0: \"a subtle shadow nose\",\n 1: \"a small button nose\",\n 2: \"a soft curved 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 calm, neutral expression\",\n 2: \"a happy grin\",\n 3: \"a surprised O-shaped mouth\",\n 4: \"a confident smirk\",\n 5: \"a wide, toothy grin\",\n 6: \"a flat, straight expression\",\n 7: \"a soft pout\",\n};\n\nconst HAIR_STYLES: Record<number, string> = {\n 0: \"bald, with no hair\",\n 1: \"short, neatly cropped hair\",\n 2: \"bouncy, curly hair\",\n 3: \"side-swept hair\",\n 4: \"a voluminous puff\",\n 5: \"long hair that falls past the shoulders\",\n 6: \"a clean bob cut\",\n 7: \"a close buzz cut\",\n 8: \"flowing, wavy hair\",\n 9: \"a neat topknot\",\n};\n\nconst HAIR_COLORS_DESC: Record<number, string> = {\n 0: \"jet black\",\n 1: \"espresso brown\",\n 2: \"walnut\",\n 3: \"honey blonde\",\n 4: \"copper red\",\n 5: \"silver\",\n 6: \"charcoal\",\n 7: \"burgundy\",\n 8: \"strawberry\",\n 9: \"ginger\",\n};\n\nconst ACCESSORY_DESC: Record<number, string> = {\n 0: \"\",\n 1: \"a beauty mark\",\n 2: \"round glasses\",\n 3: \"rectangular glasses\",\n 4: \"a dangling earring\",\n 5: \"a headband\",\n 6: \"freckles\",\n 7: \"stud earrings\",\n 8: \"aviator sunglasses\",\n 9: \"a band-aid\",\n};\n\nconst BG_COLORS_DESC: Record<number, string> = {\n 0: \"rose\",\n 1: \"olive\",\n 2: \"sage\",\n 3: \"fern\",\n 4: \"mint\",\n 5: \"ocean\",\n 6: \"sky\",\n 7: \"lavender\",\n 8: \"orchid\",\n 9: \"blush\",\n};\n\n// ─── Description Builder ─────────────────────────────────────\n\nexport interface DescribeOptions {\n includeBackground?: boolean;\n format?: \"paragraph\" | \"structured\" | \"compact\";\n perspective?: \"first\" | \"third\";\n name?: string;\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\") return buildStructured(traits, includeBackground);\n if (format === \"compact\") return buildCompact(traits);\n return buildParagraph(traits, perspective, name, includeBackground);\n}\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 const ai = effectiveAccessory(t);\n\n const subject = perspective === \"first\"\n ? (name ? `I'm ${name}. I have` : \"I have\")\n : (name ? `${name} has` : \"This SolFace has\");\n\n const im = perspective === \"first\" ? \"I'm\" : \"They're\";\n\n // Face + skin (all squircle now)\n parts.push(`${subject} a squircle 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\n const brows = EYEBROW_STYLES[t.eyebrows];\n if (brows) parts.push(`${brows} eyebrows`);\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(perspective === \"first\" ? \"and am bald\" : \"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 main sentence\n let desc = parts[0];\n if (parts.length > 2) {\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\"\n ? \"I have\"\n : (name ?? \"They\") + (name ? \" has\" : \" have\");\n desc += ` ${noseSubject} ${nose}.`;\n }\n\n // Accessory\n const acc = ACCESSORY_DESC[ai];\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\"\n ? \"I have\"\n : (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 ai = effectiveAccessory(t);\n const lines: string[] = [\n `Face: squircle`,\n `Skin: ${SKIN_TONES[t.skinColor] ?? \"warm\"}`,\n `Eyes: ${EYE_STYLES[t.eyeStyle] ?? \"round\"}, ${EYE_COLORS_DESC[t.eyeColor] ?? \"dark\"}`,\n `Eyebrows: ${EYEBROW_STYLES[t.eyebrows] ?? \"wispy\"}`,\n ];\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[ai];\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 ai = effectiveAccessory(t);\n const parts: string[] = [];\n\n parts.push(`squircle 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 raw = HAIR_STYLES[t.hairStyle] ?? \"hair\";\n const hs = raw.includes(\",\") ? raw.replace(/.*,\\s*/, \"\") : raw;\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[ai];\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\nexport function solFaceAltText(walletAddress: string): string {\n return `SolFace avatar: ${describeAppearance(walletAddress, { format: \"compact\", includeBackground: false })}`;\n}\n\n// ─── System Prompt Helper ────────────────────────────────────\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"]}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
interface SolFaceTraits {
|
|
2
|
-
faceShape: number;
|
|
3
|
-
skinColor: number;
|
|
4
|
-
eyeStyle: number;
|
|
5
|
-
eyeColor: number;
|
|
6
|
-
eyebrows: number;
|
|
7
|
-
nose: number;
|
|
8
|
-
mouth: number;
|
|
9
|
-
hairStyle: number;
|
|
10
|
-
hairColor: number;
|
|
11
|
-
accessory: number;
|
|
12
|
-
bgColor: number;
|
|
13
|
-
}
|
|
14
|
-
interface SolFaceTheme {
|
|
15
|
-
skinColors?: string[];
|
|
16
|
-
eyeColors?: string[];
|
|
17
|
-
hairColors?: string[];
|
|
18
|
-
bgColors?: string[];
|
|
19
|
-
mouthColor?: string;
|
|
20
|
-
eyebrowColor?: string;
|
|
21
|
-
accessoryColor?: string;
|
|
22
|
-
eyeWhiteColor?: string;
|
|
23
|
-
noseColor?: string;
|
|
24
|
-
glassesColor?: string;
|
|
25
|
-
earringColor?: string;
|
|
26
|
-
headbandColor?: string;
|
|
27
|
-
bgOpacity?: number;
|
|
28
|
-
bgRadius?: number;
|
|
29
|
-
border?: {
|
|
30
|
-
color: string;
|
|
31
|
-
width: number;
|
|
32
|
-
};
|
|
33
|
-
flat?: boolean;
|
|
34
|
-
cheekEnabled?: boolean;
|
|
35
|
-
cheekColor?: string;
|
|
36
|
-
cheekOpacity?: number;
|
|
37
|
-
skinOpacity?: number;
|
|
38
|
-
shadowEnabled?: boolean;
|
|
39
|
-
glowIntensity?: number;
|
|
40
|
-
_pixel?: boolean;
|
|
41
|
-
_pixelDensity?: number;
|
|
42
|
-
_pixelRounded?: boolean;
|
|
43
|
-
_pixelOutline?: boolean;
|
|
44
|
-
_pixelOutlineColor?: string;
|
|
45
|
-
_pixelOutlineWidth?: number;
|
|
46
|
-
_pixelContrast?: number;
|
|
47
|
-
_pixelSaturation?: number;
|
|
48
|
-
_pixelBrightness?: number;
|
|
49
|
-
_pixelScanlines?: boolean;
|
|
50
|
-
_pixelScanlineOpacity?: number;
|
|
51
|
-
_pixelScanlineSpacing?: number;
|
|
52
|
-
_pixelGrid?: boolean;
|
|
53
|
-
_pixelGridOpacity?: number;
|
|
54
|
-
_pixelGridColor?: string;
|
|
55
|
-
_pixelShadow?: boolean;
|
|
56
|
-
_pixelShadowColor?: string;
|
|
57
|
-
_pixelShadowOffset?: number;
|
|
58
|
-
_glass?: boolean;
|
|
59
|
-
_blurRadius?: number;
|
|
60
|
-
_saturate?: number;
|
|
61
|
-
_tintOpacity?: number;
|
|
62
|
-
_tintColor?: string;
|
|
63
|
-
_borderOpacity?: number;
|
|
64
|
-
_borderWidth?: number;
|
|
65
|
-
_borderColor?: string;
|
|
66
|
-
_specularOpacity?: number;
|
|
67
|
-
_specularColor?: string;
|
|
68
|
-
_specularEnd?: number;
|
|
69
|
-
_lightAngle?: number;
|
|
70
|
-
_rimIntensity?: number;
|
|
71
|
-
_shadow?: string;
|
|
72
|
-
}
|
|
73
|
-
interface RenderOptions {
|
|
74
|
-
size?: number;
|
|
75
|
-
theme?: SolFaceTheme;
|
|
76
|
-
traitOverrides?: Partial<SolFaceTraits>;
|
|
77
|
-
enableBlink?: boolean | {
|
|
78
|
-
duration?: number;
|
|
79
|
-
delay?: number;
|
|
80
|
-
};
|
|
81
|
-
className?: string;
|
|
82
|
-
detail?: "full" | "simplified" | "auto";
|
|
83
|
-
colorOverrides?: {
|
|
84
|
-
skin?: string;
|
|
85
|
-
eyes?: string;
|
|
86
|
-
hair?: string;
|
|
87
|
-
bg?: string;
|
|
88
|
-
mouth?: string;
|
|
89
|
-
eyebrow?: string;
|
|
90
|
-
accessory?: string;
|
|
91
|
-
nose?: string;
|
|
92
|
-
eyeWhite?: string;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
declare const SKIN_COLORS: string[];
|
|
96
|
-
declare const EYE_COLORS: string[];
|
|
97
|
-
declare const HAIR_COLORS: string[];
|
|
98
|
-
declare const BG_COLORS: string[];
|
|
99
|
-
declare function generateTraits(walletAddress: string, overrides?: Partial<SolFaceTraits>): SolFaceTraits;
|
|
100
|
-
declare function effectiveAccessory(traits: SolFaceTraits): number;
|
|
101
|
-
declare function getTraitLabels(traits: SolFaceTraits): Record<string, string>;
|
|
102
|
-
declare function traitHash(walletAddress: string): string;
|
|
103
|
-
declare function resolveTheme(themeName?: string, themes?: Record<string, SolFaceTheme>): SolFaceTheme | undefined;
|
|
104
|
-
declare function mergeTheme(base: SolFaceTheme | null | undefined, overrides: SolFaceTheme | null | undefined): SolFaceTheme | null;
|
|
105
|
-
|
|
106
|
-
export { BG_COLORS as B, EYE_COLORS as E, HAIR_COLORS as H, type RenderOptions as R, SKIN_COLORS as S, type SolFaceTheme as a, type SolFaceTraits as b, getTraitLabels as c, effectiveAccessory as e, generateTraits as g, mergeTheme as m, resolveTheme as r, traitHash as t };
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
interface SolFaceTraits {
|
|
2
|
-
faceShape: number;
|
|
3
|
-
skinColor: number;
|
|
4
|
-
eyeStyle: number;
|
|
5
|
-
eyeColor: number;
|
|
6
|
-
eyebrows: number;
|
|
7
|
-
nose: number;
|
|
8
|
-
mouth: number;
|
|
9
|
-
hairStyle: number;
|
|
10
|
-
hairColor: number;
|
|
11
|
-
accessory: number;
|
|
12
|
-
bgColor: number;
|
|
13
|
-
}
|
|
14
|
-
interface SolFaceTheme {
|
|
15
|
-
skinColors?: string[];
|
|
16
|
-
eyeColors?: string[];
|
|
17
|
-
hairColors?: string[];
|
|
18
|
-
bgColors?: string[];
|
|
19
|
-
mouthColor?: string;
|
|
20
|
-
eyebrowColor?: string;
|
|
21
|
-
accessoryColor?: string;
|
|
22
|
-
eyeWhiteColor?: string;
|
|
23
|
-
noseColor?: string;
|
|
24
|
-
glassesColor?: string;
|
|
25
|
-
earringColor?: string;
|
|
26
|
-
headbandColor?: string;
|
|
27
|
-
bgOpacity?: number;
|
|
28
|
-
bgRadius?: number;
|
|
29
|
-
border?: {
|
|
30
|
-
color: string;
|
|
31
|
-
width: number;
|
|
32
|
-
};
|
|
33
|
-
flat?: boolean;
|
|
34
|
-
cheekEnabled?: boolean;
|
|
35
|
-
cheekColor?: string;
|
|
36
|
-
cheekOpacity?: number;
|
|
37
|
-
skinOpacity?: number;
|
|
38
|
-
shadowEnabled?: boolean;
|
|
39
|
-
glowIntensity?: number;
|
|
40
|
-
_pixel?: boolean;
|
|
41
|
-
_pixelDensity?: number;
|
|
42
|
-
_pixelRounded?: boolean;
|
|
43
|
-
_pixelOutline?: boolean;
|
|
44
|
-
_pixelOutlineColor?: string;
|
|
45
|
-
_pixelOutlineWidth?: number;
|
|
46
|
-
_pixelContrast?: number;
|
|
47
|
-
_pixelSaturation?: number;
|
|
48
|
-
_pixelBrightness?: number;
|
|
49
|
-
_pixelScanlines?: boolean;
|
|
50
|
-
_pixelScanlineOpacity?: number;
|
|
51
|
-
_pixelScanlineSpacing?: number;
|
|
52
|
-
_pixelGrid?: boolean;
|
|
53
|
-
_pixelGridOpacity?: number;
|
|
54
|
-
_pixelGridColor?: string;
|
|
55
|
-
_pixelShadow?: boolean;
|
|
56
|
-
_pixelShadowColor?: string;
|
|
57
|
-
_pixelShadowOffset?: number;
|
|
58
|
-
_glass?: boolean;
|
|
59
|
-
_blurRadius?: number;
|
|
60
|
-
_saturate?: number;
|
|
61
|
-
_tintOpacity?: number;
|
|
62
|
-
_tintColor?: string;
|
|
63
|
-
_borderOpacity?: number;
|
|
64
|
-
_borderWidth?: number;
|
|
65
|
-
_borderColor?: string;
|
|
66
|
-
_specularOpacity?: number;
|
|
67
|
-
_specularColor?: string;
|
|
68
|
-
_specularEnd?: number;
|
|
69
|
-
_lightAngle?: number;
|
|
70
|
-
_rimIntensity?: number;
|
|
71
|
-
_shadow?: string;
|
|
72
|
-
}
|
|
73
|
-
interface RenderOptions {
|
|
74
|
-
size?: number;
|
|
75
|
-
theme?: SolFaceTheme;
|
|
76
|
-
traitOverrides?: Partial<SolFaceTraits>;
|
|
77
|
-
enableBlink?: boolean | {
|
|
78
|
-
duration?: number;
|
|
79
|
-
delay?: number;
|
|
80
|
-
};
|
|
81
|
-
className?: string;
|
|
82
|
-
detail?: "full" | "simplified" | "auto";
|
|
83
|
-
colorOverrides?: {
|
|
84
|
-
skin?: string;
|
|
85
|
-
eyes?: string;
|
|
86
|
-
hair?: string;
|
|
87
|
-
bg?: string;
|
|
88
|
-
mouth?: string;
|
|
89
|
-
eyebrow?: string;
|
|
90
|
-
accessory?: string;
|
|
91
|
-
nose?: string;
|
|
92
|
-
eyeWhite?: string;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
declare const SKIN_COLORS: string[];
|
|
96
|
-
declare const EYE_COLORS: string[];
|
|
97
|
-
declare const HAIR_COLORS: string[];
|
|
98
|
-
declare const BG_COLORS: string[];
|
|
99
|
-
declare function generateTraits(walletAddress: string, overrides?: Partial<SolFaceTraits>): SolFaceTraits;
|
|
100
|
-
declare function effectiveAccessory(traits: SolFaceTraits): number;
|
|
101
|
-
declare function getTraitLabels(traits: SolFaceTraits): Record<string, string>;
|
|
102
|
-
declare function traitHash(walletAddress: string): string;
|
|
103
|
-
declare function resolveTheme(themeName?: string, themes?: Record<string, SolFaceTheme>): SolFaceTheme | undefined;
|
|
104
|
-
declare function mergeTheme(base: SolFaceTheme | null | undefined, overrides: SolFaceTheme | null | undefined): SolFaceTheme | null;
|
|
105
|
-
|
|
106
|
-
export { BG_COLORS as B, EYE_COLORS as E, HAIR_COLORS as H, type RenderOptions as R, SKIN_COLORS as S, type SolFaceTheme as a, type SolFaceTraits as b, getTraitLabels as c, effectiveAccessory as e, generateTraits as g, mergeTheme as m, resolveTheme as r, traitHash as t };
|