solfaces 1.0.2 → 2.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/README.md +359 -87
- package/dist/agent/index.cjs +14 -14
- package/dist/agent/index.js +4 -4
- package/dist/agent/mcp-server.cjs +716 -277
- package/dist/{chunk-VMNATBH3.cjs → chunk-23XJ5VDX.cjs} +37 -27
- package/dist/chunk-23XJ5VDX.cjs.map +1 -0
- package/dist/chunk-46ZEFA6R.cjs +243 -0
- package/dist/chunk-46ZEFA6R.cjs.map +1 -0
- package/dist/{chunk-A6N3RPEA.cjs → chunk-546TBMAR.cjs} +6 -6
- package/dist/{chunk-A6N3RPEA.cjs.map → chunk-546TBMAR.cjs.map} +1 -1
- package/dist/chunk-6QRDULAO.cjs +191 -0
- package/dist/chunk-6QRDULAO.cjs.map +1 -0
- package/dist/chunk-6UWILY7E.cjs +647 -0
- package/dist/chunk-6UWILY7E.cjs.map +1 -0
- package/dist/chunk-DRUSCLEF.js +177 -0
- package/dist/chunk-DRUSCLEF.js.map +1 -0
- package/dist/chunk-HCEE4K4T.js +625 -0
- package/dist/chunk-HCEE4K4T.js.map +1 -0
- package/dist/chunk-JS527VKL.js +238 -0
- package/dist/chunk-JS527VKL.js.map +1 -0
- package/dist/{chunk-SNJABBAT.js → chunk-LRHYF5QN.js} +3 -3
- package/dist/{chunk-SNJABBAT.js.map → chunk-LRHYF5QN.js.map} +1 -1
- package/dist/{chunk-RX6D5FGH.js → chunk-TTGJZEPV.js} +30 -20
- package/dist/chunk-TTGJZEPV.js.map +1 -0
- package/dist/core/index.cjs +69 -29
- package/dist/core/index.d.cts +29 -47
- package/dist/core/index.d.ts +29 -47
- package/dist/core/index.js +3 -3
- package/dist/index.cjs +75 -35
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/react/index.cjs +431 -397
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +3 -2
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.js +427 -393
- 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 +29 -17
- package/dist/themes/index.d.cts +10 -7
- package/dist/themes/index.d.ts +10 -7
- package/dist/themes/index.js +1 -1
- package/dist/{traits-DAFZnXeS.d.cts → traits-QlWuxZDD.d.cts} +45 -1
- package/dist/{traits-DAFZnXeS.d.ts → traits-QlWuxZDD.d.ts} +45 -1
- package/dist/vanilla/index.cjs +20 -8
- 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 +17 -5
- package/dist/vanilla/index.js.map +1 -1
- package/package.json +1 -1
- package/python/solfaces.py +557 -235
- package/skill.md +210 -65
- package/dist/chunk-2DIKGLXZ.cjs +0 -126
- package/dist/chunk-2DIKGLXZ.cjs.map +0 -1
- package/dist/chunk-CVFO7YHY.cjs +0 -97
- package/dist/chunk-CVFO7YHY.cjs.map +0 -1
- package/dist/chunk-H3SK3MNX.cjs +0 -409
- package/dist/chunk-H3SK3MNX.cjs.map +0 -1
- package/dist/chunk-KSGFMW33.js +0 -401
- package/dist/chunk-KSGFMW33.js.map +0 -1
- package/dist/chunk-LQWJRHGC.js +0 -86
- package/dist/chunk-LQWJRHGC.js.map +0 -1
- package/dist/chunk-RX6D5FGH.js.map +0 -1
- package/dist/chunk-VMNATBH3.cjs.map +0 -1
- package/dist/chunk-WURY4QGH.js +0 -117
- package/dist/chunk-WURY4QGH.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { generateTraits, getTraitLabels, traitHash } from './chunk-
|
|
3
|
-
import { getPresetTheme, PRESET_THEMES } from './chunk-
|
|
1
|
+
import { describeAppearance, agentAppearancePrompt } from './chunk-JS527VKL.js';
|
|
2
|
+
import { renderSolFaceSVG, generateTraits, getTraitLabels, traitHash } from './chunk-HCEE4K4T.js';
|
|
3
|
+
import { getPresetTheme, PRESET_THEMES } from './chunk-DRUSCLEF.js';
|
|
4
4
|
|
|
5
5
|
// src/agent/tools.ts
|
|
6
6
|
var generateSolfaceSvg = {
|
|
7
7
|
name: "generate_solface_svg",
|
|
8
|
-
description: "Generate a deterministic SVG avatar for a Solana wallet address. Returns an SVG string
|
|
8
|
+
description: "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.",
|
|
9
9
|
parameters: {
|
|
10
10
|
type: "object",
|
|
11
11
|
properties: {
|
|
@@ -15,16 +15,21 @@ var generateSolfaceSvg = {
|
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
17
|
type: "number",
|
|
18
|
-
description: "SVG width/height in pixels. Default: 64"
|
|
18
|
+
description: "SVG width/height in pixels. Default: 64. Sizes >= 48 use full detail (gradients, specular highlights, cheek blush)."
|
|
19
19
|
},
|
|
20
20
|
theme: {
|
|
21
21
|
type: "string",
|
|
22
|
-
description: "Preset theme name
|
|
23
|
-
enum: ["
|
|
22
|
+
description: "Preset theme name. 'flat' and 'transparent' work everywhere. 'glass', 'glassDark', 'pixel', 'pixelRetro', 'pixelClean' are React-only.",
|
|
23
|
+
enum: ["default", "dark", "light", "mono", "flat", "transparent", "glass", "glassDark", "pixel", "pixelRetro", "pixelClean"]
|
|
24
24
|
},
|
|
25
25
|
enableBlink: {
|
|
26
26
|
type: "boolean",
|
|
27
27
|
description: "Enable CSS blink animation on the eyes. Default: false"
|
|
28
|
+
},
|
|
29
|
+
detail: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Detail level: 'full' (gradients, cheeks, specular), 'simplified' (flat shapes), 'auto' (full if size >= 48). Default: auto",
|
|
32
|
+
enum: ["full", "simplified", "auto"]
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
35
|
required: ["wallet"]
|
|
@@ -33,14 +38,15 @@ var generateSolfaceSvg = {
|
|
|
33
38
|
const wallet = params.wallet;
|
|
34
39
|
const size = params.size ?? 64;
|
|
35
40
|
const enableBlink = params.enableBlink ?? false;
|
|
41
|
+
const detail = params.detail ?? "auto";
|
|
36
42
|
const themeName = params.theme;
|
|
37
43
|
const theme = themeName ? getPresetTheme(themeName) : void 0;
|
|
38
|
-
return renderSolFaceSVG(wallet, { size, theme, enableBlink });
|
|
44
|
+
return renderSolFaceSVG(wallet, { size, theme, enableBlink, detail });
|
|
39
45
|
}
|
|
40
46
|
};
|
|
41
47
|
var describeSolface = {
|
|
42
48
|
name: "describe_solface",
|
|
43
|
-
description: "Generate a natural language description of a wallet's SolFace avatar. Useful for alt text, profile bios, system prompts, and accessibility.",
|
|
49
|
+
description: "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.",
|
|
44
50
|
parameters: {
|
|
45
51
|
type: "object",
|
|
46
52
|
properties: {
|
|
@@ -119,18 +125,21 @@ var getAgentIdentity = {
|
|
|
119
125
|
}
|
|
120
126
|
};
|
|
121
127
|
var THEME_DESCRIPTIONS = {
|
|
122
|
-
|
|
123
|
-
dark: "Dark backgrounds with muted tones",
|
|
124
|
-
light: "Soft pastel backgrounds",
|
|
128
|
+
default: "Base look with gradient-rich rendering \u2014 no overrides",
|
|
129
|
+
dark: "Dark backgrounds with muted tones and subtle border",
|
|
130
|
+
light: "Soft pastel backgrounds with rounded corners",
|
|
125
131
|
mono: "Full grayscale \u2014 all colors replaced with grays",
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
flat: "Disables all gradients \u2014 uses flat fill colors only",
|
|
133
|
+
transparent: "Transparent background with flat rendering",
|
|
134
|
+
glass: "Liquid glass effect with backdrop blur and specular highlights (React-only)",
|
|
135
|
+
glassDark: "Dark variant of liquid glass with deeper blur (React-only)",
|
|
136
|
+
pixel: "Pixel art mode at 16px density with rounded corners (React-only)",
|
|
137
|
+
pixelRetro: "Retro pixel art with scanlines and drop shadow (React-only)",
|
|
138
|
+
pixelClean: "Clean pixel art at 24px density (React-only)"
|
|
130
139
|
};
|
|
131
140
|
var listSolfaceThemes = {
|
|
132
141
|
name: "list_solface_themes",
|
|
133
|
-
description: "List all available SolFace preset themes with descriptions. Themes control colors,
|
|
142
|
+
description: "List all available SolFace preset themes with descriptions. Themes control colors, gradients, borders, and rendering modes. Some themes (glass, pixel) are React-only.",
|
|
134
143
|
parameters: {
|
|
135
144
|
type: "object",
|
|
136
145
|
properties: {}
|
|
@@ -138,7 +147,8 @@ var listSolfaceThemes = {
|
|
|
138
147
|
handler() {
|
|
139
148
|
return Object.keys(PRESET_THEMES).map((name) => ({
|
|
140
149
|
name,
|
|
141
|
-
description: THEME_DESCRIPTIONS[name] ?? ""
|
|
150
|
+
description: THEME_DESCRIPTIONS[name] ?? "",
|
|
151
|
+
reactOnly: name.startsWith("glass") || name.startsWith("pixel")
|
|
142
152
|
}));
|
|
143
153
|
}
|
|
144
154
|
};
|
|
@@ -207,5 +217,5 @@ function allToolsVercelAI() {
|
|
|
207
217
|
}
|
|
208
218
|
|
|
209
219
|
export { SOLFACE_TOOLS, allToolsAnthropic, allToolsMCP, allToolsOpenAI, allToolsVercelAI, handleToolCall, toAnthropic, toMCP, toOpenAI, toVercelAI };
|
|
210
|
-
//# sourceMappingURL=chunk-
|
|
211
|
-
//# sourceMappingURL=chunk-
|
|
220
|
+
//# sourceMappingURL=chunk-TTGJZEPV.js.map
|
|
221
|
+
//# sourceMappingURL=chunk-TTGJZEPV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent/tools.ts","../src/agent/index.ts"],"names":[],"mappings":";;;;;AAoCA,IAAM,kBAAA,GAAkC;AAAA,EACtC,IAAA,EAAM,sBAAA;AAAA,EACN,WAAA,EACE,8PAAA;AAAA,EACF,UAAA,EAAY;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A;AAChC;AAcO,SAAS,SAAS,IAAA,EAA+B;AACtD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,UAAA;AAAA,IACN,QAAA,EAAU;AAAA,MACR,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,aAAa,IAAA,CAAK,WAAA;AAAA,MAClB,YAAY,IAAA,CAAK;AAAA;AACnB,GACF;AACF;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-TTGJZEPV.js","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 { 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 return describeAppearance(params.wallet as string, {\n format: (params.format as \"paragraph\" | \"structured\" | \"compact\") ?? \"paragraph\",\n perspective: (params.perspective as \"first\" | \"third\") ?? \"third\",\n name: params.name as string | undefined,\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 return { traits, labels, hash };\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 return agentAppearancePrompt(\n params.wallet as string,\n params.agentName as string | undefined,\n );\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// ─── Export All Tools ────────────────────────────\n\nexport const SOLFACE_TOOLS: SolFaceTool[] = [\n generateSolfaceSvg,\n describeSolface,\n getSolfaceTraits,\n getAgentIdentity,\n listSolfaceThemes,\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/core/index.cjs
CHANGED
|
@@ -1,82 +1,122 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk546TBMAR_cjs = require('../chunk-546TBMAR.cjs');
|
|
4
|
+
var chunk46ZEFA6R_cjs = require('../chunk-46ZEFA6R.cjs');
|
|
5
|
+
var chunk6UWILY7E_cjs = require('../chunk-6UWILY7E.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "renderSolFacePNG", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunk546TBMAR_cjs.renderSolFacePNG; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "renderSolFacePNGBrowser", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk546TBMAR_cjs.renderSolFacePNGBrowser; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "renderSolFacePNGDataURL", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk546TBMAR_cjs.renderSolFacePNGDataURL; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "agentAppearancePrompt", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk46ZEFA6R_cjs.agentAppearancePrompt; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "describeAppearance", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunk46ZEFA6R_cjs.describeAppearance; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "describeTraits", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk46ZEFA6R_cjs.describeTraits; }
|
|
32
32
|
});
|
|
33
|
-
Object.defineProperty(exports, "
|
|
33
|
+
Object.defineProperty(exports, "solFaceAltText", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunk46ZEFA6R_cjs.solFaceAltText; }
|
|
36
36
|
});
|
|
37
|
-
Object.defineProperty(exports, "
|
|
37
|
+
Object.defineProperty(exports, "BG_COLORS", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunk6UWILY7E_cjs.BG_COLORS; }
|
|
40
40
|
});
|
|
41
|
-
Object.defineProperty(exports, "
|
|
41
|
+
Object.defineProperty(exports, "EYE_COLORS", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunk6UWILY7E_cjs.EYE_COLORS; }
|
|
44
44
|
});
|
|
45
|
-
Object.defineProperty(exports, "
|
|
45
|
+
Object.defineProperty(exports, "HAIR_COLORS", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk6UWILY7E_cjs.HAIR_COLORS; }
|
|
48
48
|
});
|
|
49
|
-
Object.defineProperty(exports, "
|
|
49
|
+
Object.defineProperty(exports, "SKIN_COLORS", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk6UWILY7E_cjs.SKIN_COLORS; }
|
|
52
52
|
});
|
|
53
|
-
Object.defineProperty(exports, "
|
|
53
|
+
Object.defineProperty(exports, "blend", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk6UWILY7E_cjs.blend; }
|
|
56
56
|
});
|
|
57
|
-
Object.defineProperty(exports, "
|
|
57
|
+
Object.defineProperty(exports, "buzzOpacity", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk6UWILY7E_cjs.buzzOpacity; }
|
|
60
60
|
});
|
|
61
|
-
Object.defineProperty(exports, "
|
|
61
|
+
Object.defineProperty(exports, "darken", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk6UWILY7E_cjs.darken; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "deriveSkinColors", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return chunk6UWILY7E_cjs.deriveSkinColors; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "effectiveAccessory", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return chunk6UWILY7E_cjs.effectiveAccessory; }
|
|
64
72
|
});
|
|
65
73
|
Object.defineProperty(exports, "generateTraits", {
|
|
66
74
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunk6UWILY7E_cjs.generateTraits; }
|
|
68
76
|
});
|
|
69
77
|
Object.defineProperty(exports, "getTraitLabels", {
|
|
70
78
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunk6UWILY7E_cjs.getTraitLabels; }
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "hexToRgb", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return chunk6UWILY7E_cjs.hexToRgb; }
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "lighten", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () { return chunk6UWILY7E_cjs.lighten; }
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "luminance", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function () { return chunk6UWILY7E_cjs.luminance; }
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "mergeTheme", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () { return chunk6UWILY7E_cjs.mergeTheme; }
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "renderSolFaceBase64", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () { return chunk6UWILY7E_cjs.renderSolFaceBase64; }
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "renderSolFaceDataURI", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () { return chunk6UWILY7E_cjs.renderSolFaceDataURI; }
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "renderSolFaceSVG", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () { return chunk6UWILY7E_cjs.renderSolFaceSVG; }
|
|
72
108
|
});
|
|
73
109
|
Object.defineProperty(exports, "resolveTheme", {
|
|
74
110
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunk6UWILY7E_cjs.resolveTheme; }
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(exports, "rgbToHex", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function () { return chunk6UWILY7E_cjs.rgbToHex; }
|
|
76
116
|
});
|
|
77
117
|
Object.defineProperty(exports, "traitHash", {
|
|
78
118
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunk6UWILY7E_cjs.traitHash; }
|
|
80
120
|
});
|
|
81
121
|
//# sourceMappingURL=index.cjs.map
|
|
82
122
|
//# sourceMappingURL=index.cjs.map
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,63 +1,45 @@
|
|
|
1
|
-
import { R as RenderOptions, b as SolFaceTraits } from '../traits-
|
|
2
|
-
export { B as BG_COLORS, E as EYE_COLORS, H as HAIR_COLORS, S as SKIN_COLORS, a as SolFaceTheme, g as generateTraits, c as getTraitLabels, r as resolveTheme, t as traitHash } from '../traits-
|
|
1
|
+
import { R as RenderOptions, b as SolFaceTraits } from '../traits-QlWuxZDD.cjs';
|
|
2
|
+
export { B as BG_COLORS, E as EYE_COLORS, H as HAIR_COLORS, S as SKIN_COLORS, a as SolFaceTheme, e as effectiveAccessory, g as generateTraits, c as getTraitLabels, m as mergeTheme, r as resolveTheme, t as traitHash } from '../traits-QlWuxZDD.cjs';
|
|
3
|
+
|
|
4
|
+
declare function hexToRgb(hex: string): [number, number, number];
|
|
5
|
+
declare function rgbToHex(r: number, g: number, b: number): string;
|
|
6
|
+
declare function darken(hex: string, pct?: number): string;
|
|
7
|
+
declare function lighten(hex: string, pct?: number): string;
|
|
8
|
+
declare function blend(a: string, b: string, t?: number): string;
|
|
9
|
+
declare function luminance(hex: string): number;
|
|
10
|
+
interface DerivedColors {
|
|
11
|
+
skinHi: string;
|
|
12
|
+
skinLo: string;
|
|
13
|
+
skinMid: string;
|
|
14
|
+
isDark: boolean;
|
|
15
|
+
cheekColor: string;
|
|
16
|
+
cheekOpacity: number;
|
|
17
|
+
lipColor: string;
|
|
18
|
+
noseFill: string;
|
|
19
|
+
browColor: string;
|
|
20
|
+
earFill: string;
|
|
21
|
+
earShadow: string;
|
|
22
|
+
eyeWhiteAdapted: string;
|
|
23
|
+
lidColor: string;
|
|
24
|
+
accessoryColor: string;
|
|
25
|
+
}
|
|
26
|
+
declare function deriveSkinColors(skin: string): DerivedColors;
|
|
27
|
+
/** Compute buzz cut opacity — higher when hair/skin contrast is low */
|
|
28
|
+
declare function buzzOpacity(hairCol: string, skin: string): number;
|
|
3
29
|
|
|
4
30
|
declare function renderSolFaceSVG(walletAddress: string, options?: RenderOptions): string;
|
|
5
31
|
declare function renderSolFaceDataURI(walletAddress: string, options?: RenderOptions): string;
|
|
6
32
|
declare function renderSolFaceBase64(walletAddress: string, options?: RenderOptions): string;
|
|
7
33
|
|
|
8
34
|
interface DescribeOptions {
|
|
9
|
-
/** Include background color in description. Default: true */
|
|
10
35
|
includeBackground?: boolean;
|
|
11
|
-
/** Output format. Default: "paragraph" */
|
|
12
36
|
format?: "paragraph" | "structured" | "compact";
|
|
13
|
-
/** Perspective: how the description is framed. Default: "third" */
|
|
14
37
|
perspective?: "first" | "third";
|
|
15
|
-
/** Optional name to use instead of "This SolFace" / "I". */
|
|
16
38
|
name?: string;
|
|
17
39
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Generate a natural language description of a SolFace avatar.
|
|
20
|
-
*
|
|
21
|
-
* Designed for AI agent system prompts, profile bios, alt text,
|
|
22
|
-
* and anywhere a wallet's visual identity needs to be described in words.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```ts
|
|
26
|
-
* // For an AI agent's system prompt
|
|
27
|
-
* const desc = describeAppearance("7xKXq...", {
|
|
28
|
-
* perspective: "first",
|
|
29
|
-
* name: "Atlas",
|
|
30
|
-
* });
|
|
31
|
-
* // → "I'm Atlas. I have a round face with light peach skin, wide
|
|
32
|
-
* // and expressive blue eyes with elegantly arched eyebrows, and
|
|
33
|
-
* // tall, spiky Solana mint green hair. I'm wearing round glasses
|
|
34
|
-
* // and have a confident smirk."
|
|
35
|
-
*
|
|
36
|
-
* // For alt text
|
|
37
|
-
* const alt = describeAppearance("7xKXq...", { format: "compact" });
|
|
38
|
-
* // → "Round face, light peach skin, blue wide eyes, spiky mint hair, round glasses, smirking"
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
40
|
declare function describeAppearance(walletAddress: string, options?: DescribeOptions): string;
|
|
42
|
-
/**
|
|
43
|
-
* Generate description from pre-computed traits (for when you already have them).
|
|
44
|
-
*/
|
|
45
41
|
declare function describeTraits(traits: SolFaceTraits, options?: DescribeOptions): string;
|
|
46
|
-
/**
|
|
47
|
-
* Generate accessible alt text for a SolFace avatar.
|
|
48
|
-
* Shorter than full description, optimized for screen readers.
|
|
49
|
-
*/
|
|
50
42
|
declare function solFaceAltText(walletAddress: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* Generate a system prompt snippet for an AI agent describing its appearance.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```ts
|
|
56
|
-
* const appearance = agentAppearancePrompt("7xKXq...", "Atlas");
|
|
57
|
-
* // Use in system prompt:
|
|
58
|
-
* // `You are Atlas, an AI agent. ${appearance}`
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
43
|
declare function agentAppearancePrompt(walletAddress: string, agentName?: string): string;
|
|
62
44
|
|
|
63
45
|
interface PNGOptions extends RenderOptions {
|
|
@@ -101,4 +83,4 @@ declare function renderSolFacePNGBrowser(walletAddress: string, options?: PNGOpt
|
|
|
101
83
|
*/
|
|
102
84
|
declare function renderSolFacePNGDataURL(walletAddress: string, options?: PNGOptions): Promise<string>;
|
|
103
85
|
|
|
104
|
-
export { type DescribeOptions, type PNGOptions, RenderOptions, SolFaceTraits, agentAppearancePrompt, describeAppearance, describeTraits, renderSolFaceBase64, renderSolFaceDataURI, renderSolFacePNG, renderSolFacePNGBrowser, renderSolFacePNGDataURL, renderSolFaceSVG, solFaceAltText };
|
|
86
|
+
export { type DerivedColors, type DescribeOptions, type PNGOptions, RenderOptions, SolFaceTraits, agentAppearancePrompt, blend, buzzOpacity, darken, deriveSkinColors, describeAppearance, describeTraits, hexToRgb, lighten, luminance, renderSolFaceBase64, renderSolFaceDataURI, renderSolFacePNG, renderSolFacePNGBrowser, renderSolFacePNGDataURL, renderSolFaceSVG, rgbToHex, solFaceAltText };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,63 +1,45 @@
|
|
|
1
|
-
import { R as RenderOptions, b as SolFaceTraits } from '../traits-
|
|
2
|
-
export { B as BG_COLORS, E as EYE_COLORS, H as HAIR_COLORS, S as SKIN_COLORS, a as SolFaceTheme, g as generateTraits, c as getTraitLabels, r as resolveTheme, t as traitHash } from '../traits-
|
|
1
|
+
import { R as RenderOptions, b as SolFaceTraits } from '../traits-QlWuxZDD.js';
|
|
2
|
+
export { B as BG_COLORS, E as EYE_COLORS, H as HAIR_COLORS, S as SKIN_COLORS, a as SolFaceTheme, e as effectiveAccessory, g as generateTraits, c as getTraitLabels, m as mergeTheme, r as resolveTheme, t as traitHash } from '../traits-QlWuxZDD.js';
|
|
3
|
+
|
|
4
|
+
declare function hexToRgb(hex: string): [number, number, number];
|
|
5
|
+
declare function rgbToHex(r: number, g: number, b: number): string;
|
|
6
|
+
declare function darken(hex: string, pct?: number): string;
|
|
7
|
+
declare function lighten(hex: string, pct?: number): string;
|
|
8
|
+
declare function blend(a: string, b: string, t?: number): string;
|
|
9
|
+
declare function luminance(hex: string): number;
|
|
10
|
+
interface DerivedColors {
|
|
11
|
+
skinHi: string;
|
|
12
|
+
skinLo: string;
|
|
13
|
+
skinMid: string;
|
|
14
|
+
isDark: boolean;
|
|
15
|
+
cheekColor: string;
|
|
16
|
+
cheekOpacity: number;
|
|
17
|
+
lipColor: string;
|
|
18
|
+
noseFill: string;
|
|
19
|
+
browColor: string;
|
|
20
|
+
earFill: string;
|
|
21
|
+
earShadow: string;
|
|
22
|
+
eyeWhiteAdapted: string;
|
|
23
|
+
lidColor: string;
|
|
24
|
+
accessoryColor: string;
|
|
25
|
+
}
|
|
26
|
+
declare function deriveSkinColors(skin: string): DerivedColors;
|
|
27
|
+
/** Compute buzz cut opacity — higher when hair/skin contrast is low */
|
|
28
|
+
declare function buzzOpacity(hairCol: string, skin: string): number;
|
|
3
29
|
|
|
4
30
|
declare function renderSolFaceSVG(walletAddress: string, options?: RenderOptions): string;
|
|
5
31
|
declare function renderSolFaceDataURI(walletAddress: string, options?: RenderOptions): string;
|
|
6
32
|
declare function renderSolFaceBase64(walletAddress: string, options?: RenderOptions): string;
|
|
7
33
|
|
|
8
34
|
interface DescribeOptions {
|
|
9
|
-
/** Include background color in description. Default: true */
|
|
10
35
|
includeBackground?: boolean;
|
|
11
|
-
/** Output format. Default: "paragraph" */
|
|
12
36
|
format?: "paragraph" | "structured" | "compact";
|
|
13
|
-
/** Perspective: how the description is framed. Default: "third" */
|
|
14
37
|
perspective?: "first" | "third";
|
|
15
|
-
/** Optional name to use instead of "This SolFace" / "I". */
|
|
16
38
|
name?: string;
|
|
17
39
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Generate a natural language description of a SolFace avatar.
|
|
20
|
-
*
|
|
21
|
-
* Designed for AI agent system prompts, profile bios, alt text,
|
|
22
|
-
* and anywhere a wallet's visual identity needs to be described in words.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```ts
|
|
26
|
-
* // For an AI agent's system prompt
|
|
27
|
-
* const desc = describeAppearance("7xKXq...", {
|
|
28
|
-
* perspective: "first",
|
|
29
|
-
* name: "Atlas",
|
|
30
|
-
* });
|
|
31
|
-
* // → "I'm Atlas. I have a round face with light peach skin, wide
|
|
32
|
-
* // and expressive blue eyes with elegantly arched eyebrows, and
|
|
33
|
-
* // tall, spiky Solana mint green hair. I'm wearing round glasses
|
|
34
|
-
* // and have a confident smirk."
|
|
35
|
-
*
|
|
36
|
-
* // For alt text
|
|
37
|
-
* const alt = describeAppearance("7xKXq...", { format: "compact" });
|
|
38
|
-
* // → "Round face, light peach skin, blue wide eyes, spiky mint hair, round glasses, smirking"
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
40
|
declare function describeAppearance(walletAddress: string, options?: DescribeOptions): string;
|
|
42
|
-
/**
|
|
43
|
-
* Generate description from pre-computed traits (for when you already have them).
|
|
44
|
-
*/
|
|
45
41
|
declare function describeTraits(traits: SolFaceTraits, options?: DescribeOptions): string;
|
|
46
|
-
/**
|
|
47
|
-
* Generate accessible alt text for a SolFace avatar.
|
|
48
|
-
* Shorter than full description, optimized for screen readers.
|
|
49
|
-
*/
|
|
50
42
|
declare function solFaceAltText(walletAddress: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* Generate a system prompt snippet for an AI agent describing its appearance.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```ts
|
|
56
|
-
* const appearance = agentAppearancePrompt("7xKXq...", "Atlas");
|
|
57
|
-
* // Use in system prompt:
|
|
58
|
-
* // `You are Atlas, an AI agent. ${appearance}`
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
43
|
declare function agentAppearancePrompt(walletAddress: string, agentName?: string): string;
|
|
62
44
|
|
|
63
45
|
interface PNGOptions extends RenderOptions {
|
|
@@ -101,4 +83,4 @@ declare function renderSolFacePNGBrowser(walletAddress: string, options?: PNGOpt
|
|
|
101
83
|
*/
|
|
102
84
|
declare function renderSolFacePNGDataURL(walletAddress: string, options?: PNGOptions): Promise<string>;
|
|
103
85
|
|
|
104
|
-
export { type DescribeOptions, type PNGOptions, RenderOptions, SolFaceTraits, agentAppearancePrompt, describeAppearance, describeTraits, renderSolFaceBase64, renderSolFaceDataURI, renderSolFacePNG, renderSolFacePNGBrowser, renderSolFacePNGDataURL, renderSolFaceSVG, solFaceAltText };
|
|
86
|
+
export { type DerivedColors, type DescribeOptions, type PNGOptions, RenderOptions, SolFaceTraits, agentAppearancePrompt, blend, buzzOpacity, darken, deriveSkinColors, describeAppearance, describeTraits, hexToRgb, lighten, luminance, renderSolFaceBase64, renderSolFaceDataURI, renderSolFacePNG, renderSolFacePNGBrowser, renderSolFacePNGDataURL, renderSolFaceSVG, rgbToHex, solFaceAltText };
|
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { renderSolFacePNG, renderSolFacePNGBrowser, renderSolFacePNGDataURL } from '../chunk-
|
|
2
|
-
export { agentAppearancePrompt, describeAppearance, describeTraits,
|
|
3
|
-
export { BG_COLORS, EYE_COLORS, HAIR_COLORS, SKIN_COLORS, generateTraits, getTraitLabels, resolveTheme, traitHash } from '../chunk-
|
|
1
|
+
export { renderSolFacePNG, renderSolFacePNGBrowser, renderSolFacePNGDataURL } from '../chunk-LRHYF5QN.js';
|
|
2
|
+
export { agentAppearancePrompt, describeAppearance, describeTraits, solFaceAltText } from '../chunk-JS527VKL.js';
|
|
3
|
+
export { BG_COLORS, EYE_COLORS, HAIR_COLORS, SKIN_COLORS, blend, buzzOpacity, darken, deriveSkinColors, effectiveAccessory, generateTraits, getTraitLabels, hexToRgb, lighten, luminance, mergeTheme, renderSolFaceBase64, renderSolFaceDataURI, renderSolFaceSVG, resolveTheme, rgbToHex, traitHash } from '../chunk-HCEE4K4T.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|