solfaces 2.1.1 → 2.2.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 CHANGED
@@ -4,6 +4,8 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dw/solfaces)](https://www.npmjs.com/package/solfaces)
5
5
  [![license](https://img.shields.io/npm/l/solfaces)](https://github.com/jorger3301/SolFaces/blob/main/LICENSE)
6
6
  [![bundle size](https://img.shields.io/bundlephobia/minzip/solfaces)](https://bundlephobia.com/package/solfaces)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org/)
8
+ [![CI](https://github.com/jorger3301/SolFaces/actions/workflows/ci.yml/badge.svg)](https://github.com/jorger3301/SolFaces/actions/workflows/ci.yml)
7
9
 
8
10
  **Deterministic wallet avatars and names for the Solana ecosystem.**
9
11
 
@@ -19,10 +21,10 @@ Built for dApps, AI agents, social features, leaderboards, and anywhere a wallet
19
21
 
20
22
  ## Why SolFaces?
21
23
 
22
- - **Deterministic** — Same wallet always produces the same avatar. No database needed.
24
+ - **Deterministic** — Same wallet address always produces a unique avatar and name. No database needed.
23
25
  - **Zero dependencies** — Core engine has no runtime dependencies.
24
26
  - **~2.56B unique faces** — 11 traits with expanded ranges = massive combination space.
25
- - **SolNames** — Every wallet gets a deterministic, human-friendly name derived via SHA-256 (e.g. "SunnyIcon"). ~1M display names, ~65.5B unique tags.
27
+ - **SolNames** — Every wallet gets a deterministic, human-friendly name derived via SHA-256 (e.g. "Sunny Icon"). ~1M display names, ~65.5B unique tags.
26
28
  - **11 built-in themes** — Default, Dark, Light, Mono, Flat, Transparent, plus 3 Pixel and 2 Glass themes (React).
27
29
  - **Gradient-rich rendering** — Skin-luminance-driven colors, specular highlights, cheek blush, gradient hair, glow overlays.
28
30
  - **Works everywhere** — React, vanilla JS, Node, Python, CDN script tag, edge functions.
@@ -121,13 +123,13 @@ mountSolFace("#avatar", "7xKXqR...", { size: 48 });
121
123
  import { deriveName, deriveIdentity } from "solfaces";
122
124
 
123
125
  deriveName("7xKXqR...");
124
- // → "SunnyIcon" (deterministic, SHA-256 derived)
126
+ // → "Sunny Icon" (deterministic, SHA-256 derived)
125
127
 
126
128
  deriveName("7xKXqR...", "tag");
127
- // → "SunnyIcon#2f95" (unique identifier)
129
+ // → "Sunny Icon#2f95" (unique identifier)
128
130
 
129
131
  deriveName("7xKXqR...", "full");
130
- // → "SunnyIcon-InfiniteOre" (formal contexts)
132
+ // → "Sunny Icon-Infinite Ore" (formal contexts)
131
133
 
132
134
  const id = deriveIdentity("7xKXqR...");
133
135
  // → { short, name, tag, full, adjective, noun, hash, discriminator }
@@ -168,8 +170,8 @@ SHA-256("solnames-v1:" + wallet) → 32 bytes
168
170
  ├─→ Bytes 0-3: seed PRNG → adjective + noun
169
171
  └─→ Bytes 8-9: hex discriminator → "2f95"
170
172
 
171
- Display: WavingMistral
172
- Tag: WavingMistral#2f95
173
+ Display: Waving Mistral
174
+ Tag: Waving Mistral#2f95
173
175
  ```
174
176
 
175
177
  ### Name Formats
@@ -177,9 +179,9 @@ Tag: WavingMistral#2f95
177
179
  | Format | Example | Unique Names | Use Case |
178
180
  |---------|------------------------------|-------------|-----------------------------|
179
181
  | short | "Waving" | 1,000 | Tight UIs, badges |
180
- | display | "WavingMistral" | ~1,000,000 | Default — profiles, feeds |
181
- | tag | "WavingMistral#2f95" | ~65.5B | Unique identifier |
182
- | full | "WavingMistral-InfiniteOre" | ~1T | Formal contexts |
182
+ | display | "Waving Mistral" | ~1,000,000 | Default — profiles, feeds |
183
+ | tag | "Waving Mistral#2f95" | ~65.5B | Unique identifier |
184
+ | full | "Waving Mistral-Infinite Ore" | ~1T | Formal contexts |
183
185
 
184
186
  ### Usage
185
187
 
@@ -187,10 +189,10 @@ Tag: WavingMistral#2f95
187
189
  import { deriveName, deriveIdentity } from "solfaces";
188
190
  // or: import { deriveName } from "solfaces/names";
189
191
 
190
- deriveName("7xKXqR..."); // → "SunnyIcon" (display format)
192
+ deriveName("7xKXqR..."); // → "Sunny Icon" (display format)
191
193
  deriveName("7xKXqR...", "short"); // → "Sunny"
192
- deriveName("7xKXqR...", "tag"); // → "SunnyIcon#2f95"
193
- deriveName("7xKXqR...", "full"); // → "SunnyIcon-InfiniteOre"
194
+ deriveName("7xKXqR...", "tag"); // → "Sunny Icon#2f95"
195
+ deriveName("7xKXqR...", "full"); // → "Sunny Icon-Infinite Ore"
194
196
 
195
197
  const id = deriveIdentity("7xKXqR...");
196
198
  // → { short, name, tag, full, adjective, noun, hash, discriminator }
@@ -222,9 +224,9 @@ import { SolFace } from "solfaces/react";
222
224
  ```ts
223
225
  import { isValidSolName, parseSolName } from "solfaces/names";
224
226
 
225
- isValidSolName("SunnyIcon"); // true
226
- isValidSolName("SunnyIcon#2f95"); // true
227
- parseSolName("SunnyIcon#2f95");
227
+ isValidSolName("Sunny Icon"); // true
228
+ isValidSolName("Sunny Icon#2f95"); // true
229
+ parseSolName("Sunny Icon#2f95");
228
230
  // → { adjective: "Sunny", noun: "Icon", discriminator: "2f95" }
229
231
  ```
230
232
 
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: solfaces
3
- description: Generates deterministic avatars and names for Solana wallet addresses. Use when the user mentions wallet avatars, profile pictures, visual identity, SolFaces, or needs to represent a Solana wallet visually. Provides SVG rendering, natural language descriptions, SHA-256 name derivation, and AI agent identity prompts. 6 tools available.
3
+ description: Generates deterministic avatars and names for Solana wallet addresses. Use when the user mentions wallet avatars, profile pictures, visual identity, SolFaces, Solana PFP, deterministic identity, wallet names, or needs to represent a Solana wallet visually or with a human-readable name. Provides SVG rendering, natural language descriptions, SHA-256 name derivation, and AI agent identity prompts. 6 tools available.
4
4
  ---
5
5
 
6
6
  # SolFaces
@@ -43,6 +43,8 @@ Returns: description string. Auto-populates `name` from `deriveName(wallet, "dis
43
43
  ### `get_solface_traits`
44
44
  Raw trait data with human-readable labels and hash.
45
45
 
46
+ **When to use:** User wants to inspect raw trait values, compare wallets, or build custom rendering logic.
47
+
46
48
  | Parameter | Type | Required | Description |
47
49
  |-----------|------|----------|-------------|
48
50
  | `wallet` | string | Yes | Solana wallet address |
@@ -52,6 +54,8 @@ Returns: `{ traits: SolFaceTraits, labels: Record<string, string>, hash: string,
52
54
  ### `get_agent_identity`
53
55
  System prompt snippet giving an AI agent a visual identity.
54
56
 
57
+ **When to use:** User is building an AI agent and wants to give it a visual identity tied to a wallet.
58
+
55
59
  | Parameter | Type | Required | Description |
56
60
  |-----------|------|----------|-------------|
57
61
  | `wallet` | string | Yes | Agent's wallet address |
@@ -74,6 +78,8 @@ Returns: Without format: `SolNameIdentity` object (short/name/tag/full/adjective
74
78
  ### `list_solface_themes`
75
79
  List available preset themes with descriptions.
76
80
 
81
+ **When to use:** User wants to see available themes or choose a visual style.
82
+
77
83
  No parameters. Returns: Array of `{ name, description, reactOnly }`.
78
84
 
79
85
  ---
@@ -124,8 +130,8 @@ const svg = renderSolFaceSVG("7xKXtg...", { size: 256 });
124
130
  ### Name derivation
125
131
  ```ts
126
132
  import { deriveName, deriveIdentity } from "solfaces";
127
- deriveName("7xKXtg..."); // "SunnyIcon"
128
- deriveName("7xKXtg...", "tag"); // "SunnyIcon#2f95"
133
+ deriveName("7xKXtg..."); // "Sunny Icon"
134
+ deriveName("7xKXtg...", "tag"); // "Sunny Icon#2f95"
129
135
  const id = deriveIdentity("7xKXtg..."); // full identity object
130
136
  ```
131
137
 
@@ -1,52 +1,52 @@
1
1
  'use strict';
2
2
 
3
- var chunk4YFZ4W2Y_cjs = require('../chunk-4YFZ4W2Y.cjs');
3
+ var chunkPVJR3SFG_cjs = require('../chunk-PVJR3SFG.cjs');
4
4
  require('../chunk-TYTBYDQU.cjs');
5
5
  require('../chunk-F54WHRCE.cjs');
6
6
  require('../chunk-6QRDULAO.cjs');
7
- require('../chunk-XXJJH56O.cjs');
7
+ require('../chunk-YGD7EQEX.cjs');
8
8
 
9
9
 
10
10
 
11
11
  Object.defineProperty(exports, "SOLFACE_TOOLS", {
12
12
  enumerable: true,
13
- get: function () { return chunk4YFZ4W2Y_cjs.SOLFACE_TOOLS; }
13
+ get: function () { return chunkPVJR3SFG_cjs.SOLFACE_TOOLS; }
14
14
  });
15
15
  Object.defineProperty(exports, "allToolsAnthropic", {
16
16
  enumerable: true,
17
- get: function () { return chunk4YFZ4W2Y_cjs.allToolsAnthropic; }
17
+ get: function () { return chunkPVJR3SFG_cjs.allToolsAnthropic; }
18
18
  });
19
19
  Object.defineProperty(exports, "allToolsMCP", {
20
20
  enumerable: true,
21
- get: function () { return chunk4YFZ4W2Y_cjs.allToolsMCP; }
21
+ get: function () { return chunkPVJR3SFG_cjs.allToolsMCP; }
22
22
  });
23
23
  Object.defineProperty(exports, "allToolsOpenAI", {
24
24
  enumerable: true,
25
- get: function () { return chunk4YFZ4W2Y_cjs.allToolsOpenAI; }
25
+ get: function () { return chunkPVJR3SFG_cjs.allToolsOpenAI; }
26
26
  });
27
27
  Object.defineProperty(exports, "allToolsVercelAI", {
28
28
  enumerable: true,
29
- get: function () { return chunk4YFZ4W2Y_cjs.allToolsVercelAI; }
29
+ get: function () { return chunkPVJR3SFG_cjs.allToolsVercelAI; }
30
30
  });
31
31
  Object.defineProperty(exports, "handleToolCall", {
32
32
  enumerable: true,
33
- get: function () { return chunk4YFZ4W2Y_cjs.handleToolCall; }
33
+ get: function () { return chunkPVJR3SFG_cjs.handleToolCall; }
34
34
  });
35
35
  Object.defineProperty(exports, "toAnthropic", {
36
36
  enumerable: true,
37
- get: function () { return chunk4YFZ4W2Y_cjs.toAnthropic; }
37
+ get: function () { return chunkPVJR3SFG_cjs.toAnthropic; }
38
38
  });
39
39
  Object.defineProperty(exports, "toMCP", {
40
40
  enumerable: true,
41
- get: function () { return chunk4YFZ4W2Y_cjs.toMCP; }
41
+ get: function () { return chunkPVJR3SFG_cjs.toMCP; }
42
42
  });
43
43
  Object.defineProperty(exports, "toOpenAI", {
44
44
  enumerable: true,
45
- get: function () { return chunk4YFZ4W2Y_cjs.toOpenAI; }
45
+ get: function () { return chunkPVJR3SFG_cjs.toOpenAI; }
46
46
  });
47
47
  Object.defineProperty(exports, "toVercelAI", {
48
48
  enumerable: true,
49
- get: function () { return chunk4YFZ4W2Y_cjs.toVercelAI; }
49
+ get: function () { return chunkPVJR3SFG_cjs.toVercelAI; }
50
50
  });
51
51
  //# sourceMappingURL=index.cjs.map
52
52
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
- export { SOLFACE_TOOLS, allToolsAnthropic, allToolsMCP, allToolsOpenAI, allToolsVercelAI, handleToolCall, toAnthropic, toMCP, toOpenAI, toVercelAI } from '../chunk-66PSL4YO.js';
1
+ export { SOLFACE_TOOLS, allToolsAnthropic, allToolsMCP, allToolsOpenAI, allToolsVercelAI, handleToolCall, toAnthropic, toMCP, toOpenAI, toVercelAI } from '../chunk-74CSG63X.js';
2
2
  import '../chunk-CKHLRORB.js';
3
3
  import '../chunk-3CE7Q44S.js';
4
4
  import '../chunk-DRUSCLEF.js';
5
- import '../chunk-N5DDJ3WQ.js';
5
+ import '../chunk-UTT764K6.js';
6
6
  //# sourceMappingURL=index.js.map
7
7
  //# sourceMappingURL=index.js.map
@@ -2972,7 +2972,7 @@ var NOUNS = Object.freeze([
2972
2972
  var BLOCKED_COMBOS = Object.freeze(
2973
2973
  /* @__PURE__ */ new Set([
2974
2974
  // Add any discovered offensive adj+noun combinations here.
2975
- // Format: "AdjectiveNoun" (PascalCase, concatenated)
2975
+ // Format: "Adjective Noun" (space-separated)
2976
2976
  ])
2977
2977
  );
2978
2978
 
@@ -3018,11 +3018,12 @@ function deriveIdentity(wallet, options) {
3018
3018
  const adj2 = adjectives[Math.floor(rng() * adjectives.length)];
3019
3019
  const noun2 = nouns[Math.floor(rng() * nouns.length)];
3020
3020
  const discriminator = hex.slice(16, 20);
3021
+ const sep = options?.separator ?? " ";
3021
3022
  return {
3022
3023
  short: adj1,
3023
- name: adj1 + noun1,
3024
- tag: adj1 + noun1 + "#" + discriminator,
3025
- full: adj1 + noun1 + "-" + adj2 + noun2,
3024
+ name: adj1 + sep + noun1,
3025
+ tag: adj1 + sep + noun1 + "#" + discriminator,
3026
+ full: adj1 + sep + noun1 + "-" + adj2 + sep + noun2,
3026
3027
  adjective: adj1,
3027
3028
  noun: noun1,
3028
3029
  hash: hex,
@@ -3358,7 +3359,7 @@ var listSolfaceThemes = {
3358
3359
  };
3359
3360
  var deriveSolname = {
3360
3361
  name: "derive_solname",
3361
- description: "Derive a deterministic name from a Solana wallet address using SHA-256 hashing. Returns human-friendly names like 'SunnyIcon'. Same wallet always produces the same name. ~1M display name combinations, ~65.5B unique tag combinations.",
3362
+ description: "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.",
3362
3363
  parameters: {
3363
3364
  type: "object",
3364
3365
  properties: {
@@ -3368,7 +3369,7 @@ var deriveSolname = {
3368
3369
  },
3369
3370
  format: {
3370
3371
  type: "string",
3371
- description: "Name format: 'short' (adjective only), 'display' (adj+noun, default), 'tag' (adj+noun+#hex, unique), 'full' (adj+noun-adj+noun). Omit for full identity bundle.",
3372
+ description: "Name format: 'short' (adjective only), 'display' (adj noun, default), 'tag' (adj noun#hex, unique), 'full' (adj noun-adj noun). Omit for full identity bundle.",
3372
3373
  enum: ["short", "display", "tag", "full"]
3373
3374
  }
3374
3375
  },
@@ -1,7 +1,7 @@
1
1
  import { describeAppearance, agentAppearancePrompt } from './chunk-CKHLRORB.js';
2
2
  import { renderSolFaceSVG, generateTraits, getTraitLabels, traitHash } from './chunk-3CE7Q44S.js';
3
3
  import { getPresetTheme, PRESET_THEMES } from './chunk-DRUSCLEF.js';
4
- import { deriveName, deriveIdentity } from './chunk-N5DDJ3WQ.js';
4
+ import { deriveName, deriveIdentity } from './chunk-UTT764K6.js';
5
5
 
6
6
  // src/agent/tools.ts
7
7
  var generateSolfaceSvg = {
@@ -157,7 +157,7 @@ var listSolfaceThemes = {
157
157
  };
158
158
  var deriveSolname = {
159
159
  name: "derive_solname",
160
- description: "Derive a deterministic name from a Solana wallet address using SHA-256 hashing. Returns human-friendly names like 'SunnyIcon'. Same wallet always produces the same name. ~1M display name combinations, ~65.5B unique tag combinations.",
160
+ description: "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.",
161
161
  parameters: {
162
162
  type: "object",
163
163
  properties: {
@@ -167,7 +167,7 @@ var deriveSolname = {
167
167
  },
168
168
  format: {
169
169
  type: "string",
170
- description: "Name format: 'short' (adjective only), 'display' (adj+noun, default), 'tag' (adj+noun+#hex, unique), 'full' (adj+noun-adj+noun). Omit for full identity bundle.",
170
+ description: "Name format: 'short' (adjective only), 'display' (adj noun, default), 'tag' (adj noun#hex, unique), 'full' (adj noun-adj noun). Omit for full identity bundle.",
171
171
  enum: ["short", "display", "tag", "full"]
172
172
  }
173
173
  },
@@ -248,5 +248,5 @@ function allToolsVercelAI() {
248
248
  }
249
249
 
250
250
  export { SOLFACE_TOOLS, allToolsAnthropic, allToolsMCP, allToolsOpenAI, allToolsVercelAI, handleToolCall, toAnthropic, toMCP, toOpenAI, toVercelAI };
251
- //# sourceMappingURL=chunk-66PSL4YO.js.map
252
- //# sourceMappingURL=chunk-66PSL4YO.js.map
251
+ //# sourceMappingURL=chunk-74CSG63X.js.map
252
+ //# sourceMappingURL=chunk-74CSG63X.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/agent/tools.ts","../src/agent/index.ts"],"names":[],"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,IACN,UAAA,EAAY;AAAA,MACV,MAAA,EAAQ;AAAA,QACN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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-66PSL4YO.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 { 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 'SunnyIcon'. 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"]}
1
+ {"version":3,"sources":["../src/agent/tools.ts","../src/agent/index.ts"],"names":[],"mappings":";;;;;;AAsCA,IAAM,kBAAA,GAAkC;AAAA,EACtC,IAAA,EAAM,sBAAA;AAAA,EACN,WAAA,EACE,8PAAA;AAAA,E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AA,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-74CSG63X.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 { 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"]}
@@ -3,7 +3,7 @@
3
3
  var chunkTYTBYDQU_cjs = require('./chunk-TYTBYDQU.cjs');
4
4
  var chunkF54WHRCE_cjs = require('./chunk-F54WHRCE.cjs');
5
5
  var chunk6QRDULAO_cjs = require('./chunk-6QRDULAO.cjs');
6
- var chunkXXJJH56O_cjs = require('./chunk-XXJJH56O.cjs');
6
+ var chunkYGD7EQEX_cjs = require('./chunk-YGD7EQEX.cjs');
7
7
 
8
8
  // src/agent/tools.ts
9
9
  var generateSolfaceSvg = {
@@ -76,7 +76,7 @@ var describeSolface = {
76
76
  },
77
77
  handler(params) {
78
78
  const wallet = params.wallet;
79
- const name = params.name ?? chunkXXJJH56O_cjs.deriveName(wallet, "display");
79
+ const name = params.name ?? chunkYGD7EQEX_cjs.deriveName(wallet, "display");
80
80
  return chunkTYTBYDQU_cjs.describeAppearance(wallet, {
81
81
  format: params.format ?? "paragraph",
82
82
  perspective: params.perspective ?? "third",
@@ -102,7 +102,7 @@ var getSolfaceTraits = {
102
102
  const traits = chunkF54WHRCE_cjs.generateTraits(wallet);
103
103
  const labels = chunkF54WHRCE_cjs.getTraitLabels(traits);
104
104
  const hash = chunkF54WHRCE_cjs.traitHash(wallet);
105
- const name = chunkXXJJH56O_cjs.deriveName(wallet, "display");
105
+ const name = chunkYGD7EQEX_cjs.deriveName(wallet, "display");
106
106
  return { traits, labels, hash, name };
107
107
  }
108
108
  };
@@ -125,7 +125,7 @@ var getAgentIdentity = {
125
125
  },
126
126
  handler(params) {
127
127
  const wallet = params.wallet;
128
- const agentName = params.agentName ?? chunkXXJJH56O_cjs.deriveName(wallet, "display");
128
+ const agentName = params.agentName ?? chunkYGD7EQEX_cjs.deriveName(wallet, "display");
129
129
  return chunkTYTBYDQU_cjs.agentAppearancePrompt(wallet, agentName);
130
130
  }
131
131
  };
@@ -159,7 +159,7 @@ var listSolfaceThemes = {
159
159
  };
160
160
  var deriveSolname = {
161
161
  name: "derive_solname",
162
- description: "Derive a deterministic name from a Solana wallet address using SHA-256 hashing. Returns human-friendly names like 'SunnyIcon'. Same wallet always produces the same name. ~1M display name combinations, ~65.5B unique tag combinations.",
162
+ description: "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.",
163
163
  parameters: {
164
164
  type: "object",
165
165
  properties: {
@@ -169,7 +169,7 @@ var deriveSolname = {
169
169
  },
170
170
  format: {
171
171
  type: "string",
172
- description: "Name format: 'short' (adjective only), 'display' (adj+noun, default), 'tag' (adj+noun+#hex, unique), 'full' (adj+noun-adj+noun). Omit for full identity bundle.",
172
+ description: "Name format: 'short' (adjective only), 'display' (adj noun, default), 'tag' (adj noun#hex, unique), 'full' (adj noun-adj noun). Omit for full identity bundle.",
173
173
  enum: ["short", "display", "tag", "full"]
174
174
  }
175
175
  },
@@ -179,9 +179,9 @@ var deriveSolname = {
179
179
  const wallet = params.wallet;
180
180
  const format = params.format;
181
181
  if (format) {
182
- return chunkXXJJH56O_cjs.deriveName(wallet, format);
182
+ return chunkYGD7EQEX_cjs.deriveName(wallet, format);
183
183
  }
184
- return chunkXXJJH56O_cjs.deriveIdentity(wallet);
184
+ return chunkYGD7EQEX_cjs.deriveIdentity(wallet);
185
185
  }
186
186
  };
187
187
  var SOLFACE_TOOLS = [
@@ -259,5 +259,5 @@ exports.toAnthropic = toAnthropic;
259
259
  exports.toMCP = toMCP;
260
260
  exports.toOpenAI = toOpenAI;
261
261
  exports.toVercelAI = toVercelAI;
262
- //# sourceMappingURL=chunk-4YFZ4W2Y.cjs.map
263
- //# sourceMappingURL=chunk-4YFZ4W2Y.cjs.map
262
+ //# sourceMappingURL=chunk-PVJR3SFG.cjs.map
263
+ //# sourceMappingURL=chunk-PVJR3SFG.cjs.map
@@ -1 +1 @@
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,kB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N,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-4YFZ4W2Y.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 'SunnyIcon'. 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"]}
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,IACN,UAAA,EAAY;AAAA,MACV,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM,QAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;AAAA,MACA,KAAA,EAAO;AAAA,QACL,IAAA,EAAM,QAAA;AAAA,QACN,WAAA,EACE,wIAAA;AAAA,QACF,IAAA,EAAM,CAAC,SAAA,EAAW,MAAA,EAAQ,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,aAAA,EAAe,OAAA,EAAS,WAAA,EAAa,OAAA,EAAS,YAAA,EAAc,YAAY;AAAA,OAC7H;AAAA,MACA,WAAA,EAAa;AAAA,QACX,IAAA,EAAM,SAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM,QAAA;AAAA,QACN,WAAA,EAAa,4HAAA;AAAA,QACb,IAAA,EAAM,CAAC,MAAA,EAAQ,YAAA,EAAc,MAAM;AAAA;AACrC,KACF;AAAA,IACA,QAAA,EAAU,CAAC,QAAQ;AAAA,GACrB;AAAA,EACA,QAAQ,MAAA,EAAQ;AACd,IAAA,MAAM,SAAS,MAAA,CAAO,MAAA;AACtB,IAAA,MAAM,IAAA,GAAQ,OAAO,IAAA,IAAmB,EAAA;AACxC,I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AAA,CAAK,WAAA;AAAA,IAClB,aAAa,IAAA,CAAK;AAAA,GACpB;AACF;AAEO,SAAS,WAAA,GAAyB;AACvC,EAAA,OAAO,aAAA,CAAc,IAAI,KAAK,CAAA;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-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"]}