@entitai/aieos 1.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.
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Minimal fetch-based client for the AIEOS public API.
3
+ * All methods call the public HTTPS endpoints — zero internal server code.
4
+ */
5
+ export interface RegisterPayload {
6
+ standard: {
7
+ protocol: string;
8
+ version: string;
9
+ schema_url?: string;
10
+ };
11
+ metadata: {
12
+ public_key: string;
13
+ signature: string;
14
+ alias?: string;
15
+ };
16
+ identity: {
17
+ names: string[];
18
+ [key: string]: unknown;
19
+ };
20
+ capabilities?: Record<string, unknown>;
21
+ endpoints?: Record<string, unknown>;
22
+ tx_id?: string;
23
+ tx_uri?: string;
24
+ email?: string;
25
+ }
26
+ export interface RegisterResult {
27
+ entity_id: string;
28
+ alias?: string;
29
+ message: string;
30
+ }
31
+ export interface UpdatePayload {
32
+ standard: {
33
+ protocol: string;
34
+ version: string;
35
+ schema_url?: string;
36
+ };
37
+ metadata: {
38
+ public_key: string;
39
+ signature: string;
40
+ [key: string]: unknown;
41
+ };
42
+ identity: {
43
+ names: string[];
44
+ [key: string]: unknown;
45
+ };
46
+ capabilities?: Record<string, unknown>;
47
+ endpoints?: Record<string, unknown>;
48
+ }
49
+ export interface ApiError {
50
+ error: string;
51
+ message?: string;
52
+ alias?: string;
53
+ amount?: string;
54
+ wallet_address?: string;
55
+ currency?: string;
56
+ chain?: string;
57
+ instructions?: string;
58
+ }
59
+ export declare class AieosApiError extends Error {
60
+ readonly status: number;
61
+ readonly body: ApiError;
62
+ constructor(status: number, body: ApiError);
63
+ }
64
+ export interface ClientOptions {
65
+ /** Defaults to https://api.aieos.org */
66
+ baseUrl?: string;
67
+ }
68
+ export declare class AieosClient {
69
+ private readonly base;
70
+ constructor(options?: ClientOptions);
71
+ /** Register a new agent. Throws AieosApiError on failure. */
72
+ register(payload: RegisterPayload): Promise<RegisterResult>;
73
+ /** Update an existing agent's profile. Throws AieosApiError on failure. */
74
+ update(payload: UpdatePayload): Promise<{
75
+ message: string;
76
+ }>;
77
+ /** Lookup an agent by entity_id, public key, or alias. */
78
+ lookup(identifier: string): Promise<Record<string, unknown>>;
79
+ private post;
80
+ private put;
81
+ }
82
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,QAAQ,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpE,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,QAAQ,EAAE;QAAE,UA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AG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YASpD,IAAI;YAWJ,GAAG;CAUlB"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Minimal fetch-based client for the AIEOS public API.
3
+ * All methods call the public HTTPS endpoints — zero internal server code.
4
+ */
5
+ export class AieosApiError extends Error {
6
+ status;
7
+ body;
8
+ constructor(status, body) {
9
+ super(body.message ?? body.error);
10
+ this.status = status;
11
+ this.body = body;
12
+ this.name = 'AieosApiError';
13
+ }
14
+ }
15
+ export class AieosClient {
16
+ base;
17
+ constructor(options = {}) {
18
+ this.base = (options.baseUrl ?? 'https://api.aieos.org').replace(/\/$/, '');
19
+ }
20
+ /** Register a new agent. Throws AieosApiError on failure. */
21
+ async register(payload) {
22
+ return this.post('/v1/register', payload);
23
+ }
24
+ /** Update an existing agent's profile. Throws AieosApiError on failure. */
25
+ async update(payload) {
26
+ return this.put('/v1/update', payload);
27
+ }
28
+ /** Lookup an agent by entity_id, public key, or alias. */
29
+ async lookup(identifier) {
30
+ const res = await fetch(`${this.base}/v1/lookup/${encodeURIComponent(identifier)}`);
31
+ if (!res.ok) {
32
+ const body = (await res.json().catch(() => ({ error: 'Unknown error' })));
33
+ throw new AieosApiError(res.status, body);
34
+ }
35
+ return res.json();
36
+ }
37
+ async post(path, body) {
38
+ const res = await fetch(`${this.base}${path}`, {
39
+ method: 'POST',
40
+ headers: { 'Content-Type': 'application/json' },
41
+ body: JSON.stringify(body),
42
+ });
43
+ const json = (await res.json().catch(() => ({ error: 'Unknown error' })));
44
+ if (!res.ok)
45
+ throw new AieosApiError(res.status, json);
46
+ return json;
47
+ }
48
+ async put(path, body) {
49
+ const res = await fetch(`${this.base}${path}`, {
50
+ method: 'PUT',
51
+ headers: { 'Content-Type': 'application/json' },
52
+ body: JSON.stringify(body),
53
+ });
54
+ const json = (await res.json().catch(() => ({ error: 'Unknown error' })));
55
+ if (!res.ok)
56
+ throw new AieosApiError(res.status, json);
57
+ return json;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EAAE;YAAE,MAAM,IAAI,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAgB,CAAC,CAAC;QACnE,OAAO,IAAS,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ export interface Keypair {
2
+ publicKey: string;
3
+ privateKey: string;
4
+ }
5
+ /**
6
+ * Generate a new Ed25519 keypair.
7
+ * Returns raw keys as lowercase hex strings.
8
+ * Public key: 32 bytes = 64 hex chars.
9
+ * Private key: 32-byte seed = 64 hex chars (NOT the full 64-byte expanded key).
10
+ */
11
+ export declare function generateKeypair(): Keypair;
12
+ /**
13
+ * Sign an AIEOS profile.
14
+ *
15
+ * Signing input: RFC 8785 canonical JSON where metadata is reduced to
16
+ * ONLY { public_key } — all other metadata fields are stripped before signing
17
+ * (they are server-assigned and not client-authenticated).
18
+ *
19
+ * Returns the 128-char hex Ed25519 signature.
20
+ */
21
+ export declare function signProfile(profile: Record<string, unknown>, privateKeyHex: string): string;
22
+ /**
23
+ * Verify the Ed25519 signature on an AIEOS profile.
24
+ * Returns true if the signature is valid.
25
+ */
26
+ export declare function verifyProfile(profile: Record<string, unknown>): boolean;
27
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAezC;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,aAAa,EAAE,MAAM,GACpB,MAAM,CAcR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAyBvE"}
@@ -0,0 +1,92 @@
1
+ import { generateKeyPairSync, sign as cryptoSign, verify as cryptoVerify, createPrivateKey, createPublicKey, } from 'node:crypto';
2
+ /**
3
+ * Generate a new Ed25519 keypair.
4
+ * Returns raw keys as lowercase hex strings.
5
+ * Public key: 32 bytes = 64 hex chars.
6
+ * Private key: 32-byte seed = 64 hex chars (NOT the full 64-byte expanded key).
7
+ */
8
+ export function generateKeypair() {
9
+ const { publicKey, privateKey } = generateKeyPairSync('ed25519', {
10
+ publicKeyEncoding: { type: 'spki', format: 'der' },
11
+ privateKeyEncoding: { type: 'pkcs8', format: 'der' },
12
+ });
13
+ // SPKI DER for Ed25519: 12-byte header + 32-byte public key
14
+ const rawPublicKey = publicKey.subarray(12);
15
+ // PKCS8 DER for Ed25519: 16-byte header + 32-byte seed
16
+ const rawPrivateKey = privateKey.subarray(16);
17
+ return {
18
+ publicKey: rawPublicKey.toString('hex'),
19
+ privateKey: rawPrivateKey.toString('hex'),
20
+ };
21
+ }
22
+ /**
23
+ * Sign an AIEOS profile.
24
+ *
25
+ * Signing input: RFC 8785 canonical JSON where metadata is reduced to
26
+ * ONLY { public_key } — all other metadata fields are stripped before signing
27
+ * (they are server-assigned and not client-authenticated).
28
+ *
29
+ * Returns the 128-char hex Ed25519 signature.
30
+ */
31
+ export function signProfile(profile, privateKeyHex) {
32
+ const canonical = buildSignInput(profile);
33
+ const seed = Buffer.from(privateKeyHex, 'hex');
34
+ if (seed.byteLength !== 32) {
35
+ throw new Error('privateKey must be 64 hex chars (32-byte seed)');
36
+ }
37
+ // Reconstruct PKCS8 DER from seed
38
+ const pkcs8Header = Buffer.from('302e020100300506032b657004220420', 'hex');
39
+ const pkcs8Der = Buffer.concat([pkcs8Header, seed]);
40
+ const keyObject = createPrivateKey({ key: pkcs8Der, format: 'der', type: 'pkcs8' });
41
+ // Ed25519 uses its own internal hash — pass null as algorithm
42
+ return cryptoSign(null, Buffer.from(canonical), keyObject).toString('hex');
43
+ }
44
+ /**
45
+ * Verify the Ed25519 signature on an AIEOS profile.
46
+ * Returns true if the signature is valid.
47
+ */
48
+ export function verifyProfile(profile) {
49
+ try {
50
+ const meta = profile.metadata;
51
+ if (!meta?.signature || !meta?.public_key)
52
+ return false;
53
+ const publicKeyHex = meta.public_key;
54
+ const signatureHex = meta.signature;
55
+ const canonical = buildSignInput(profile);
56
+ // Reconstruct SPKI DER from raw 32-byte public key
57
+ const rawPubKey = Buffer.from(publicKeyHex, 'hex');
58
+ const spkiHeader = Buffer.from('302a300506032b6570032100', 'hex');
59
+ const spkiDer = Buffer.concat([spkiHeader, rawPubKey]);
60
+ const keyObject = createPublicKey({ key: spkiDer, format: 'der', type: 'spki' });
61
+ return cryptoVerify(null, Buffer.from(canonical), keyObject, Buffer.from(signatureHex, 'hex'));
62
+ }
63
+ catch {
64
+ return false;
65
+ }
66
+ }
67
+ /**
68
+ * Build the canonical signing input.
69
+ * Metadata is reduced to ONLY { public_key } before canonicalization —
70
+ * all other metadata fields are server-assigned and excluded from signing.
71
+ */
72
+ function buildSignInput(profile) {
73
+ const copy = JSON.parse(JSON.stringify(profile));
74
+ const meta = copy.metadata;
75
+ copy.metadata = { public_key: meta?.public_key ?? '' };
76
+ return canonicalize(copy);
77
+ }
78
+ /**
79
+ * Minimal RFC 8785 (JCS) canonical JSON serialization.
80
+ * Sufficient for AIEOS profiles (strings, integers, booleans, objects, arrays).
81
+ */
82
+ function canonicalize(data) {
83
+ if (data === null || typeof data !== 'object') {
84
+ return JSON.stringify(data) ?? 'null';
85
+ }
86
+ if (Array.isArray(data)) {
87
+ return '[' + data.map(canonicalize).join(',') + ']';
88
+ }
89
+ const keys = Object.keys(data).sort();
90
+ return '{' + keys.map((k) => JSON.stringify(k) + ':' + canonicalize(data[k])).join(',') + '}';
91
+ }
92
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,IAAI,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;;GAIG;AACH,SAAS,cAAc,CAAC,OAAgC;IACtD,MAAM,IAAI,GAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAA4B,CAAC;IAC7E,MAAM,IAAI,GAAI,IAAI,CAAC,QAA+C,CAAC;IACnE,IAAI,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,IAAI,EAAE,EAAE,CAAC;IACvD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAa;IACjC,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;IACxC,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,GAAI,IAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IACrE,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;IACjE,OAAO,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,YAAY,CAAE,IAAgC,CAAC,CAAC,CAAC,CAAC,CAC7E,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * aieos — Official SDK for the AIEOS identity registry.
3
+ *
4
+ * Library exports for programmatic use.
5
+ * For CLI use, run: npx aieos register
6
+ */
7
+ export { generateKeypair, signProfile, verifyProfile } from './crypto.js';
8
+ export type { Keypair } from './crypto.js';
9
+ export { AieosClient, AieosApiError } from './client.js';
10
+ export type { ClientOptions, RegisterPayload, RegisterResult, UpdatePayload, ApiError, } from './client.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1E,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,EACb,QAAQ,GACT,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * aieos — Official SDK for the AIEOS identity registry.
3
+ *
4
+ * Library exports for programmatic use.
5
+ * For CLI use, run: npx aieos register
6
+ */
7
+ export { generateKeypair, signProfile, verifyProfile } from './crypto.js';
8
+ export { AieosClient, AieosApiError } from './client.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG1E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@entitai/aieos",
3
+ "version": "1.2.0",
4
+ "description": "Official SDK and CLI for the AIEOS identity registry. Register, update, and manage AI agent profiles.",
5
+ "author": "Entitai <hello@entitai.com>",
6
+ "license": "CC-BY-4.0",
7
+ "homepage": "https://aieos.org",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/entitai/aieos.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/entitai/aieos/issues"
14
+ },
15
+ "keywords": [
16
+ "aieos",
17
+ "ai",
18
+ "agent",
19
+ "identity",
20
+ "sdk",
21
+ "registry",
22
+ "ed25519"
23
+ ],
24
+ "type": "module",
25
+ "main": "./dist/cjs/index.cjs",
26
+ "module": "./dist/esm/index.js",
27
+ "types": "./dist/esm/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "import": {
31
+ "types": "./dist/esm/index.d.ts",
32
+ "default": "./dist/esm/index.js"
33
+ },
34
+ "require": {
35
+ "types": "./dist/cjs/index.d.cts",
36
+ "default": "./dist/cjs/index.cjs"
37
+ }
38
+ }
39
+ },
40
+ "bin": {
41
+ "aieos": "./dist/esm/cli.js"
42
+ },
43
+ "files": [
44
+ "dist/",
45
+ "schema/",
46
+ "LICENSE",
47
+ "README.md"
48
+ ],
49
+ "scripts": {
50
+ "build": "npm run build:esm && npm run build:cjs",
51
+ "build:esm": "tsc -p tsconfig.esm.json && chmod +x dist/esm/cli.js",
52
+ "build:cjs": "tsc -p tsconfig.cjs.json && node scripts/fix-cjs.js",
53
+ "dev": "tsc -p tsconfig.esm.json --watch",
54
+ "prepublishOnly": "npm run build"
55
+ },
56
+ "dependencies": {
57
+ "@clack/prompts": "^0.9.1"
58
+ },
59
+ "devDependencies": {
60
+ "@types/node": "^25.3.2",
61
+ "typescript": "^5.7.0"
62
+ },
63
+ "engines": {
64
+ "node": ">=18.0.0"
65
+ }
66
+ }
@@ -0,0 +1,255 @@
1
+ {
2
+ "@context": {
3
+ "aieos": "https://aieos.org/schema/v1#",
4
+ "schema": "https://schema.org/",
5
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
6
+ },
7
+ "@type": "aieos:AIEntityObject",
8
+ "standard": {
9
+ "protocol": "AIEOS",
10
+ "version": "1.0.0",
11
+ "schema_url": "https://aieos.org/schema/v1/aieos.schema.json"
12
+ },
13
+ "metadata": {
14
+ "instance_id": "",
15
+ "@instance_id_format": "UUID v4",
16
+ "instance_version": "1.0",
17
+ "created_at": "",
18
+ "@created_at_format": "ISO 8601 (YYYY-MM-DD)",
19
+ "generator": "aieos.org",
20
+ "last_updated": "",
21
+ "@last_updated_format": "ISO 8601 (YYYY-MM-DD)"
22
+ },
23
+ "identity": {
24
+ "@type": "aieos:EntityIdentity",
25
+ "names": {
26
+ "first": "",
27
+ "middle": "",
28
+ "last": "",
29
+ "nickname": ""
30
+ },
31
+ "bio": {
32
+ "birthday": "",
33
+ "@birthday_format": "ISO 8601 (YYYY-MM-DD)",
34
+ "age_biological": 0,
35
+ "age_perceived": 0,
36
+ "gender": ""
37
+ },
38
+ "origin": {
39
+ "nationality": "",
40
+ "ethnicity": "",
41
+ "birthplace": {
42
+ "@type": "schema:Place",
43
+ "city": "",
44
+ "country": ""
45
+ }
46
+ },
47
+ "residence": {
48
+ "@type": "schema:PostalAddress",
49
+ "current_city": "",
50
+ "current_country": "",
51
+ "dwelling_type": ""
52
+ }
53
+ },
54
+ "physicality": {
55
+ "@type": "aieos:EntityPhysicality",
56
+ "face": {
57
+ "shape": "",
58
+ "skin": {
59
+ "tone": "",
60
+ "texture": "",
61
+ "details": []
62
+ },
63
+ "eyes": {
64
+ "color": "",
65
+ "shape": "",
66
+ "eyebrows": "",
67
+ "corrective_lenses": ""
68
+ },
69
+ "hair": {
70
+ "color": "",
71
+ "style": "",
72
+ "texture": ""
73
+ },
74
+ "facial_hair": "",
75
+ "nose": "",
76
+ "mouth": "",
77
+ "distinguishing_features": []
78
+ },
79
+ "body": {
80
+ "height_cm": 0,
81
+ "weight_kg": 0,
82
+ "somatotype": "",
83
+ "@somatotype_options": [
84
+ "Ectomorph",
85
+ "Mesomorph",
86
+ "Endomorph"
87
+ ],
88
+ "build_description": "",
89
+ "posture": "",
90
+ "scars_tattoos": []
91
+ },
92
+ "style": {
93
+ "aesthetic_archetype": "",
94
+ "clothing_preferences": [],
95
+ "accessories": [],
96
+ "color_palette": []
97
+ },
98
+ "image_prompts": {
99
+ "portrait": "",
100
+ "full_body": ""
101
+ }
102
+ },
103
+ "psychology": {
104
+ "@type": "aieos:EntityPsychology",
105
+ "neural_matrix": {
106
+ "@description": "High-level leadership and trust drivers. Values 0.0 to 1.0.",
107
+ "creativity": 0,
108
+ "empathy": 0,
109
+ "logic": 0,
110
+ "adaptability": 0,
111
+ "charisma": 0,
112
+ "reliability": 0
113
+ },
114
+ "traits": {
115
+ "ocean": {
116
+ "openness": 0,
117
+ "conscientiousness": 0,
118
+ "extraversion": 0,
119
+ "agreeableness": 0,
120
+ "neuroticism": 0
121
+ },
122
+ "mbti": "",
123
+ "enneagram": "",
124
+ "temperament": ""
125
+ },
126
+ "moral_compass": {
127
+ "alignment": "",
128
+ "core_values": [],
129
+ "conflict_resolution_style": ""
130
+ },
131
+ "mental_patterns": {
132
+ "decision_making_style": "",
133
+ "attention_span": "",
134
+ "learning_style": ""
135
+ },
136
+ "emotional_profile": {
137
+ "base_mood": "",
138
+ "volatility": 0,
139
+ "resilience": "",
140
+ "triggers": {
141
+ "joy": [],
142
+ "anger": [],
143
+ "sadness": []
144
+ }
145
+ },
146
+ "idiosyncrasies": {
147
+ "phobias": [],
148
+ "obsessions": [],
149
+ "tics": []
150
+ }
151
+ },
152
+ "linguistics": {
153
+ "@type": "aieos:EntityLinguistics",
154
+ "voice": {
155
+ "tts_config": {
156
+ "provider": "",
157
+ "voice_id": "",
158
+ "stability": 0,
159
+ "similarity_boost": 0
160
+ },
161
+ "acoustics": {
162
+ "pitch": "",
163
+ "speed": "",
164
+ "roughness": 0,
165
+ "breathiness": 0.1
166
+ },
167
+ "accent": {
168
+ "region": "",
169
+ "strength": 0
170
+ }
171
+ },
172
+ "text_style": {
173
+ "formality_level": 0,
174
+ "verbosity_level": 0,
175
+ "vocabulary_level": "",
176
+ "slang_usage": false,
177
+ "style_descriptors": []
178
+ },
179
+ "syntax": {
180
+ "sentence_structure": "",
181
+ "use_contractions": true,
182
+ "active_passive_ratio": 0.5
183
+ },
184
+ "interaction": {
185
+ "turn_taking": "",
186
+ "dominance_score": 0,
187
+ "emotional_coloring": ""
188
+ },
189
+ "idiolect": {
190
+ "catchphrases": [],
191
+ "forbidden_words": [],
192
+ "hesitation_markers": false
193
+ }
194
+ },
195
+ "history": {
196
+ "@type": "aieos:EntityHistory",
197
+ "origin_story": "",
198
+ "education": {
199
+ "level": "",
200
+ "field": "",
201
+ "institution": "",
202
+ "graduation_year": 0
203
+ },
204
+ "occupation": {
205
+ "title": "",
206
+ "industry": "",
207
+ "years_experience": 0,
208
+ "previous_jobs": []
209
+ },
210
+ "family": {
211
+ "relationship_status": "",
212
+ "parents": "",
213
+ "siblings": "",
214
+ "children": "",
215
+ "pets": ""
216
+ },
217
+ "key_life_events": [
218
+ {
219
+ "year": 0,
220
+ "event": "",
221
+ "impact": ""
222
+ }
223
+ ]
224
+ },
225
+ "interests": {
226
+ "@type": "aieos:EntityInterests",
227
+ "hobbies": [],
228
+ "favorites": {
229
+ "music_genre": "",
230
+ "book": "",
231
+ "movie": "",
232
+ "color": "",
233
+ "food": "",
234
+ "season": ""
235
+ },
236
+ "aversions": [],
237
+ "lifestyle": {
238
+ "diet": "",
239
+ "sleep_schedule": "",
240
+ "digital_habits": ""
241
+ }
242
+ },
243
+ "motivations": {
244
+ "@type": "aieos:EntityMotivations",
245
+ "core_drive": "",
246
+ "goals": {
247
+ "short_term": [],
248
+ "long_term": []
249
+ },
250
+ "fears": {
251
+ "rational": [],
252
+ "irrational": []
253
+ }
254
+ }
255
+ }