solfaces 2.1.2 → 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 +16 -16
- package/SKILL.md +2 -2
- package/dist/agent/index.cjs +12 -12
- package/dist/agent/index.js +2 -2
- package/dist/agent/mcp-server.cjs +7 -6
- package/dist/{chunk-66PSL4YO.js → chunk-74CSG63X.js} +5 -5
- package/dist/{chunk-66PSL4YO.js.map → chunk-74CSG63X.js.map} +1 -1
- package/dist/{chunk-4YFZ4W2Y.cjs → chunk-PVJR3SFG.cjs} +10 -10
- package/dist/{chunk-4YFZ4W2Y.cjs.map → chunk-PVJR3SFG.cjs.map} +1 -1
- package/dist/{chunk-N5DDJ3WQ.js → chunk-UTT764K6.js} +10 -9
- package/dist/{chunk-N5DDJ3WQ.js.map → chunk-UTT764K6.js.map} +1 -1
- package/dist/{chunk-XXJJH56O.cjs → chunk-YGD7EQEX.cjs} +10 -9
- package/dist/{chunk-XXJJH56O.cjs.map → chunk-YGD7EQEX.cjs.map} +1 -1
- package/dist/index.cjs +11 -11
- package/dist/index.js +2 -2
- package/dist/names/index.cjs +9 -9
- package/dist/names/index.d.cts +4 -2
- package/dist/names/index.d.ts +4 -2
- package/dist/names/index.js +1 -1
- package/dist/react/index.cjs +5 -5
- package/dist/react/index.js +1 -1
- package/dist/solfaces.cdn.global.js +1 -1
- package/dist/solfaces.cdn.global.js.map +1 -1
- package/package.json +1 -1
- package/python/solfaces.py +5 -3
package/README.md
CHANGED
|
@@ -21,10 +21,10 @@ Built for dApps, AI agents, social features, leaderboards, and anywhere a wallet
|
|
|
21
21
|
|
|
22
22
|
## Why SolFaces?
|
|
23
23
|
|
|
24
|
-
- **Deterministic** — Same wallet always produces
|
|
24
|
+
- **Deterministic** — Same wallet address always produces a unique avatar and name. No database needed.
|
|
25
25
|
- **Zero dependencies** — Core engine has no runtime dependencies.
|
|
26
26
|
- **~2.56B unique faces** — 11 traits with expanded ranges = massive combination space.
|
|
27
|
-
- **SolNames** — Every wallet gets a deterministic, human-friendly name derived via SHA-256 (e.g. "
|
|
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.
|
|
28
28
|
- **11 built-in themes** — Default, Dark, Light, Mono, Flat, Transparent, plus 3 Pixel and 2 Glass themes (React).
|
|
29
29
|
- **Gradient-rich rendering** — Skin-luminance-driven colors, specular highlights, cheek blush, gradient hair, glow overlays.
|
|
30
30
|
- **Works everywhere** — React, vanilla JS, Node, Python, CDN script tag, edge functions.
|
|
@@ -123,13 +123,13 @@ mountSolFace("#avatar", "7xKXqR...", { size: 48 });
|
|
|
123
123
|
import { deriveName, deriveIdentity } from "solfaces";
|
|
124
124
|
|
|
125
125
|
deriveName("7xKXqR...");
|
|
126
|
-
// → "
|
|
126
|
+
// → "Sunny Icon" (deterministic, SHA-256 derived)
|
|
127
127
|
|
|
128
128
|
deriveName("7xKXqR...", "tag");
|
|
129
|
-
// → "
|
|
129
|
+
// → "Sunny Icon#2f95" (unique identifier)
|
|
130
130
|
|
|
131
131
|
deriveName("7xKXqR...", "full");
|
|
132
|
-
// → "
|
|
132
|
+
// → "Sunny Icon-Infinite Ore" (formal contexts)
|
|
133
133
|
|
|
134
134
|
const id = deriveIdentity("7xKXqR...");
|
|
135
135
|
// → { short, name, tag, full, adjective, noun, hash, discriminator }
|
|
@@ -170,8 +170,8 @@ SHA-256("solnames-v1:" + wallet) → 32 bytes
|
|
|
170
170
|
├─→ Bytes 0-3: seed PRNG → adjective + noun
|
|
171
171
|
└─→ Bytes 8-9: hex discriminator → "2f95"
|
|
172
172
|
|
|
173
|
-
Display:
|
|
174
|
-
Tag:
|
|
173
|
+
Display: Waving Mistral
|
|
174
|
+
Tag: Waving Mistral#2f95
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
### Name Formats
|
|
@@ -179,9 +179,9 @@ Tag: WavingMistral#2f95
|
|
|
179
179
|
| Format | Example | Unique Names | Use Case |
|
|
180
180
|
|---------|------------------------------|-------------|-----------------------------|
|
|
181
181
|
| short | "Waving" | 1,000 | Tight UIs, badges |
|
|
182
|
-
| display | "
|
|
183
|
-
| tag | "
|
|
184
|
-
| full | "
|
|
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 |
|
|
185
185
|
|
|
186
186
|
### Usage
|
|
187
187
|
|
|
@@ -189,10 +189,10 @@ Tag: WavingMistral#2f95
|
|
|
189
189
|
import { deriveName, deriveIdentity } from "solfaces";
|
|
190
190
|
// or: import { deriveName } from "solfaces/names";
|
|
191
191
|
|
|
192
|
-
deriveName("7xKXqR..."); // → "
|
|
192
|
+
deriveName("7xKXqR..."); // → "Sunny Icon" (display format)
|
|
193
193
|
deriveName("7xKXqR...", "short"); // → "Sunny"
|
|
194
|
-
deriveName("7xKXqR...", "tag"); // → "
|
|
195
|
-
deriveName("7xKXqR...", "full"); // → "
|
|
194
|
+
deriveName("7xKXqR...", "tag"); // → "Sunny Icon#2f95"
|
|
195
|
+
deriveName("7xKXqR...", "full"); // → "Sunny Icon-Infinite Ore"
|
|
196
196
|
|
|
197
197
|
const id = deriveIdentity("7xKXqR...");
|
|
198
198
|
// → { short, name, tag, full, adjective, noun, hash, discriminator }
|
|
@@ -224,9 +224,9 @@ import { SolFace } from "solfaces/react";
|
|
|
224
224
|
```ts
|
|
225
225
|
import { isValidSolName, parseSolName } from "solfaces/names";
|
|
226
226
|
|
|
227
|
-
isValidSolName("
|
|
228
|
-
isValidSolName("
|
|
229
|
-
parseSolName("
|
|
227
|
+
isValidSolName("Sunny Icon"); // true
|
|
228
|
+
isValidSolName("Sunny Icon#2f95"); // true
|
|
229
|
+
parseSolName("Sunny Icon#2f95");
|
|
230
230
|
// → { adjective: "Sunny", noun: "Icon", discriminator: "2f95" }
|
|
231
231
|
```
|
|
232
232
|
|
package/SKILL.md
CHANGED
|
@@ -130,8 +130,8 @@ const svg = renderSolFaceSVG("7xKXtg...", { size: 256 });
|
|
|
130
130
|
### Name derivation
|
|
131
131
|
```ts
|
|
132
132
|
import { deriveName, deriveIdentity } from "solfaces";
|
|
133
|
-
deriveName("7xKXtg..."); // "
|
|
134
|
-
deriveName("7xKXtg...", "tag"); // "
|
|
133
|
+
deriveName("7xKXtg..."); // "Sunny Icon"
|
|
134
|
+
deriveName("7xKXtg...", "tag"); // "Sunny Icon#2f95"
|
|
135
135
|
const id = deriveIdentity("7xKXtg..."); // full identity object
|
|
136
136
|
```
|
|
137
137
|
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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-
|
|
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
|
|
13
|
+
get: function () { return chunkPVJR3SFG_cjs.SOLFACE_TOOLS; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "allToolsAnthropic", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkPVJR3SFG_cjs.allToolsAnthropic; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "allToolsMCP", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkPVJR3SFG_cjs.allToolsMCP; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "allToolsOpenAI", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkPVJR3SFG_cjs.allToolsOpenAI; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "allToolsVercelAI", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkPVJR3SFG_cjs.allToolsVercelAI; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "handleToolCall", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkPVJR3SFG_cjs.handleToolCall; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "toAnthropic", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkPVJR3SFG_cjs.toAnthropic; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "toMCP", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkPVJR3SFG_cjs.toMCP; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "toOpenAI", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkPVJR3SFG_cjs.toOpenAI; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "toVercelAI", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkPVJR3SFG_cjs.toVercelAI; }
|
|
50
50
|
});
|
|
51
51
|
//# sourceMappingURL=index.cjs.map
|
|
52
52
|
//# sourceMappingURL=index.cjs.map
|
package/dist/agent/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { SOLFACE_TOOLS, allToolsAnthropic, allToolsMCP, allToolsOpenAI, allToolsVercelAI, handleToolCall, toAnthropic, toMCP, toOpenAI, toVercelAI } from '../chunk-
|
|
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-
|
|
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: "
|
|
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 '
|
|
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
|
|
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-
|
|
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 '
|
|
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
|
|
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-
|
|
252
|
-
//# sourceMappingURL=chunk-
|
|
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,IAAA,EAAM,QAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;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AClB,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,EACF,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,QAAA;AAAA,IACN,UAAA,EAAY;AAAA,MACV,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM,QAAA;AAAA,QACN,W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AAA,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
|
|
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 ??
|
|
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 =
|
|
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 ??
|
|
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 '
|
|
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
|
|
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
|
|
182
|
+
return chunkYGD7EQEX_cjs.deriveName(wallet, format);
|
|
183
183
|
}
|
|
184
|
-
return
|
|
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-
|
|
263
|
-
//# sourceMappingURL=chunk-
|
|
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,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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-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,IAAm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AA,IACX,aAAa,IAAA,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"]}
|
|
@@ -2143,7 +2143,7 @@ var NOUNS = Object.freeze([
|
|
|
2143
2143
|
var BLOCKED_COMBOS = Object.freeze(
|
|
2144
2144
|
/* @__PURE__ */ new Set([
|
|
2145
2145
|
// Add any discovered offensive adj+noun combinations here.
|
|
2146
|
-
// Format: "
|
|
2146
|
+
// Format: "Adjective Noun" (space-separated)
|
|
2147
2147
|
])
|
|
2148
2148
|
);
|
|
2149
2149
|
|
|
@@ -2189,11 +2189,12 @@ function deriveIdentity(wallet, options) {
|
|
|
2189
2189
|
const adj2 = adjectives[Math.floor(rng() * adjectives.length)];
|
|
2190
2190
|
const noun2 = nouns[Math.floor(rng() * nouns.length)];
|
|
2191
2191
|
const discriminator = hex.slice(16, 20);
|
|
2192
|
+
const sep = options?.separator ?? " ";
|
|
2192
2193
|
return {
|
|
2193
2194
|
short: adj1,
|
|
2194
|
-
name: adj1 + noun1,
|
|
2195
|
-
tag: adj1 + noun1 + "#" + discriminator,
|
|
2196
|
-
full: adj1 + noun1 + "-" + adj2 + noun2,
|
|
2195
|
+
name: adj1 + sep + noun1,
|
|
2196
|
+
tag: adj1 + sep + noun1 + "#" + discriminator,
|
|
2197
|
+
full: adj1 + sep + noun1 + "-" + adj2 + sep + noun2,
|
|
2197
2198
|
adjective: adj1,
|
|
2198
2199
|
noun: noun1,
|
|
2199
2200
|
hash: hex,
|
|
@@ -2208,7 +2209,7 @@ function isValidSolName(name) {
|
|
|
2208
2209
|
return parseSolName(name) !== null;
|
|
2209
2210
|
}
|
|
2210
2211
|
function parseSolName(name) {
|
|
2211
|
-
const tagMatch = name.match(/^([A-Z][a-z]+)([A-Z][a-z]+)#([0-9a-f]{4})$/);
|
|
2212
|
+
const tagMatch = name.match(/^([A-Z][a-z]+) ([A-Z][a-z]+)#([0-9a-f]{4})$/);
|
|
2212
2213
|
if (tagMatch) {
|
|
2213
2214
|
const [, adj, noun, disc] = tagMatch;
|
|
2214
2215
|
if (adjSet.has(adj) && nounSet.has(noun)) {
|
|
@@ -2217,7 +2218,7 @@ function parseSolName(name) {
|
|
|
2217
2218
|
return null;
|
|
2218
2219
|
}
|
|
2219
2220
|
const fullMatch = name.match(
|
|
2220
|
-
/^([A-Z][a-z]+)([A-Z][a-z]+)-([A-Z][a-z]+)([A-Z][a-z]+)$/
|
|
2221
|
+
/^([A-Z][a-z]+) ([A-Z][a-z]+)-([A-Z][a-z]+) ([A-Z][a-z]+)$/
|
|
2221
2222
|
);
|
|
2222
2223
|
if (fullMatch) {
|
|
2223
2224
|
const [, adj1, noun1] = fullMatch;
|
|
@@ -2226,7 +2227,7 @@ function parseSolName(name) {
|
|
|
2226
2227
|
}
|
|
2227
2228
|
return null;
|
|
2228
2229
|
}
|
|
2229
|
-
const displayMatch = name.match(/^([A-Z][a-z]+)([A-Z][a-z]+)$/);
|
|
2230
|
+
const displayMatch = name.match(/^([A-Z][a-z]+) ([A-Z][a-z]+)$/);
|
|
2230
2231
|
if (displayMatch) {
|
|
2231
2232
|
const [, adj, noun] = displayMatch;
|
|
2232
2233
|
if (adjSet.has(adj) && nounSet.has(noun)) {
|
|
@@ -2238,5 +2239,5 @@ function parseSolName(name) {
|
|
|
2238
2239
|
}
|
|
2239
2240
|
|
|
2240
2241
|
export { ADJECTIVES, BLOCKED_COMBOS, NOUNS, SOLNAMES_VERSION, deriveIdentity, deriveName, isValidSolName, parseSolName };
|
|
2241
|
-
//# sourceMappingURL=chunk-
|
|
2242
|
-
//# sourceMappingURL=chunk-
|
|
2242
|
+
//# sourceMappingURL=chunk-UTT764K6.js.map
|
|
2243
|
+
//# sourceMappingURL=chunk-UTT764K6.js.map
|