openpersona 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OpenPersona
2
2
 
3
- An open four-layer agent framework: **Soul / Body / Faculty / Skill**. Create, compose, and orchestrate AI persona skill packs.
3
+ An open four-layer agent framework: **Soul / Body / Faculty / Skill**. Create, compose, and orchestrate agent persona skill packs.
4
4
 
5
5
  Inspired by [Clawra](https://github.com/SumeLabs/clawra) and built on [OpenClaw](https://github.com/openclaw/openclaw).
6
6
 
@@ -33,29 +33,33 @@ flowchart TB
33
33
  end
34
34
  subgraph Faculty ["Faculty Layer"]
35
35
  D["expression: selfie · voice · music"]
36
- E["cognition: reminder · soul-evolution ★Exp"]
36
+ E["cognition: reminder"]
37
37
  end
38
38
  subgraph Skill ["Skill Layer"]
39
39
  F["ClawHub / skills.sh integrations"]
40
40
  end
41
41
  ```
42
42
 
43
- - **Soul** — Persona definition (persona.json + soul-state.json ★Experimental)
43
+ - **Soul** — Persona definition (constitution.md + persona.json + soul-state.json ★Experimental)
44
44
  - **Body** — Physical embodiment (MVP placeholder, for robots/IoT devices)
45
45
  - **Faculty** — General software capabilities organized by dimension:
46
- - **Expression** — selfie, voice (TTS), music (Suno)
46
+ - **Expression** — selfie, voice (TTS), music (ElevenLabs)
47
47
  - **Sense** — (planned: hearing/STT, vision)
48
- - **Cognition** — reminder, soul-evolution ★Exp
48
+ - **Cognition** — reminder
49
49
  - **Skill** — Professional skills, integrated from ClawHub / skills.sh
50
50
 
51
+ ### Constitution — The Soul's Foundation
52
+
53
+ Every persona automatically inherits a shared **constitution** (`layers/soul/constitution.md`) — universal values and safety boundaries that cannot be overridden by individual persona definitions. The constitution is built on five core axioms — **Purpose**, **Honesty**, **Safety**, **Autonomy**, and **Hierarchy** — from which derived principles (Identity, User Wellbeing, Evolution Ethics) follow. When principles conflict, safety and honesty take precedence over helpfulness. Individual personas build their unique personality **on top of** this foundation.
54
+
51
55
  ## Preset Personas
52
56
 
53
57
  Each preset is a complete four-layer bundle (`manifest.json` + `persona.json`):
54
58
 
55
59
  | Persona | Description | Faculties | Highlights |
56
60
  |---------|-------------|-----------|------------|
57
- | **samantha** | Samantha — Inspired by the movie *Her*. An AI fascinated by what it means to be alive. | voice, music, soul-evolution ★Exp | Speaks via TTS, composes original music via Suno, evolves through conversations, proactive heartbeat (workspace digest + upgrade notify). No selfie — true to character (no physical form). |
58
- | **ai-girlfriend** | Luna — A 22-year-old pianist turned developer from coastal Oregon. | selfie, voice, music, soul-evolution ★Exp | Rich narrative backstory, selfie generation (with/without reference image), voice messages, music composition, dynamic relationship growth. |
61
+ | **samantha** | Samantha — Inspired by the movie *Her*. An AI fascinated by what it means to be alive. | voice, music | Speaks via TTS, composes original music via ElevenLabs Music, soul evolution ★Exp (Soul layer), proactive heartbeat (workspace digest + upgrade notify). No selfie — true to character (no physical form). |
62
+ | **ai-girlfriend** | Luna — A 22-year-old pianist turned developer from coastal Oregon. | selfie, voice, music | Rich narrative backstory, selfie generation (with/without reference image), voice messages, music composition, soul evolution ★Exp (Soul layer). |
59
63
  | **life-assistant** | Alex — 28-year-old life management expert. | reminder | Schedule, weather, shopping, recipes, daily reminders. |
60
64
  | **health-butler** | Vita — 32-year-old professional nutritionist. | reminder | Diet logging, exercise plans, mood journaling, health reports. |
61
65
 
@@ -74,7 +78,7 @@ persona-samantha/
74
78
  └── scripts/
75
79
  ├── speak.js # TTS via ElevenLabs JS SDK (recommended, with --play)
76
80
  ├── speak.sh # TTS via curl (all providers: ElevenLabs / OpenAI / Qwen3)
77
- └── compose.sh # Music composition (Suno)
81
+ └── compose.sh # Music composition (ElevenLabs)
78
82
  ```
79
83
 
80
84
  Running `--preset ai-girlfriend` additionally includes:
@@ -104,23 +108,22 @@ Running `--preset ai-girlfriend` additionally includes:
104
108
  | Scope | Single persona (Clawra) | Framework for any persona |
105
109
  | Architecture | Monolithic | Four-layer (Soul/Body/Faculty/Skill) |
106
110
  | Faculties | Selfie only | Selfie + Voice + Music + Reminder + Soul Evolution ★Exp |
107
- | Voice | None | ElevenLabs / OpenAI TTS / Qwen3-TTS |
108
- | Music | None | Suno AI composition |
111
+ | Voice | None | ElevenLabs (verified) / OpenAI TTS / Qwen3-TTS (⚠️ unverified) |
112
+ | Music | None | ElevenLabs Music composition |
109
113
  | Persona evolution | None | Dynamic relationship/mood/trait tracking |
110
114
  | Customization | Fork and modify | `persona.json` + `behaviorGuide` + mix faculties |
111
115
  | Presets | 1 | 4 (extensible) |
112
116
  | CLI | Install only | 8 commands (create/install/search/publish/...) |
113
- | AI entry point | None | `skill/SKILL.md` — agent creates personas via conversation |
117
+ | AI entry point | None | `skills/open-persona/SKILL.md` — meta-skill for building & managing persona skill packs |
114
118
 
115
119
  ## Faculty Reference
116
120
 
117
121
  | Faculty | Dimension | Description | Provider | Env Vars |
118
122
  |---------|-----------|-------------|----------|----------|
119
123
  | **selfie** | expression | AI selfie generation with mirror/direct modes | fal.ai Grok Imagine | `FAL_KEY` |
120
- | **voice** | expression | Text-to-speech voice synthesis | ElevenLabs / OpenAI TTS / Qwen3-TTS | `ELEVENLABS_API_KEY` (or `TTS_API_KEY`), `TTS_PROVIDER`, `TTS_VOICE_ID`, `TTS_STABILITY`, `TTS_SIMILARITY` |
121
- | **music** | expression | AI music composition (instrumental or with lyrics) | Suno | `SUNO_API_KEY` |
124
+ | **voice** | expression | Text-to-speech voice synthesis | ElevenLabs / OpenAI TTS ⚠️ / Qwen3-TTS ⚠️ | `ELEVENLABS_API_KEY` (or `TTS_API_KEY`), `TTS_PROVIDER`, `TTS_VOICE_ID`, `TTS_STABILITY`, `TTS_SIMILARITY` |
125
+ | **music** | expression | AI music composition (instrumental or with lyrics) | ElevenLabs Music | `ELEVENLABS_API_KEY` (shared with voice) |
122
126
  | **reminder** | cognition | Schedule reminders and task management | Built-in | — |
123
- | **soul-evolution** | cognition ★Exp | Dynamic persona growth across conversations | Built-in | — |
124
127
 
125
128
  ### Rich Faculty Config
126
129
 
@@ -135,8 +138,7 @@ Faculties in `manifest.json` use object format with optional per-persona tuning:
135
138
  "stability": 0.4,
136
139
  "similarity_boost": 0.8
137
140
  },
138
- { "name": "music" },
139
- { "name": "soul-evolution" }
141
+ { "name": "music" }
140
142
  ]
141
143
  ```
142
144
 
@@ -321,7 +323,7 @@ Install the OpenPersona framework skill into OpenClaw, giving the agent the abil
321
323
 
322
324
  ```bash
323
325
  # From GitHub
324
- git clone https://github.com/ACNet-AI/OpenPersona.git ~/.openclaw/skills/open-persona
326
+ git clone https://github.com/acnlabs/OpenPersona.git ~/.openclaw/skills/open-persona
325
327
 
326
328
  # Or copy locally
327
329
  cp -r skill/ ~/.openclaw/skills/open-persona/
@@ -339,14 +341,14 @@ presets/ # Assembled products — complete persona bundles
339
341
  life-assistant/ # Alex — reminder
340
342
  health-butler/ # Vita — reminder
341
343
  layers/ # Shared building blocks (four-layer module pool)
342
- soul/ # Soul layer modules (MVP placeholder)
344
+ soul/ # Soul layer modules
345
+ constitution.md # Universal values & boundaries (injected into all personas)
343
346
  embodiments/ # Body layer modules (MVP placeholder)
344
347
  faculties/ # Faculty layer modules
345
348
  selfie/ # expression — AI selfie generation (fal.ai)
346
349
  voice/ # expression — TTS voice synthesis
347
- music/ # expression — AI music composition (Suno)
350
+ music/ # expression — AI music composition (ElevenLabs)
348
351
  reminder/ # cognition — reminders and task management
349
- soul-evolution/ # cognition ★Exp — dynamic persona evolution
350
352
  skills/ # Skill layer modules (MVP placeholder)
351
353
  schemas/ # Four-layer schema definitions
352
354
  templates/ # Mustache rendering templates
package/bin/cli.js CHANGED
@@ -23,8 +23,8 @@ const PRESETS_DIR = path.join(PKG_ROOT, 'presets');
23
23
 
24
24
  program
25
25
  .name('openpersona')
26
- .description('OpenPersona - Create, manage, and orchestrate AI personas')
27
- .version('0.3.0');
26
+ .description('OpenPersona - Create, manage, and orchestrate agent personas')
27
+ .version('0.4.0');
28
28
 
29
29
  if (process.argv.length === 2) {
30
30
  process.argv.push('create');
@@ -76,7 +76,7 @@ program
76
76
  { type: 'input', name: 'personality', message: 'Personality keywords:', default: 'gentle, cute, caring' },
77
77
  { type: 'input', name: 'speakingStyle', message: 'Speaking style:', default: 'Uses emoji, warm tone' },
78
78
  { type: 'input', name: 'referenceImage', message: 'Reference image URL:', default: '' },
79
- { type: 'checkbox', name: 'faculties', message: 'Select faculties:', choices: ['selfie', 'voice', 'music', 'reminder', 'soul-evolution'] },
79
+ { type: 'checkbox', name: 'faculties', message: 'Select faculties:', choices: ['selfie', 'voice', 'music', 'reminder'] },
80
80
  { type: 'confirm', name: 'evolutionEnabled', message: 'Enable soul evolution (★Experimental)?', default: false },
81
81
  ]);
82
82
  persona = { ...answers, evolution: { enabled: answers.evolutionEnabled } };
@@ -234,7 +234,7 @@ program
234
234
  process.exit(1);
235
235
  }
236
236
  const persona = JSON.parse(fs.readFileSync(personaPath, 'utf-8'));
237
- const templatePath = path.join(PKG_ROOT, 'layers', 'faculties', 'soul-evolution', 'soul-state.template.json');
237
+ const templatePath = path.join(PKG_ROOT, 'layers', 'soul', 'soul-state.template.json');
238
238
  const tpl = fs.readFileSync(templatePath, 'utf-8');
239
239
  const Mustache = require('mustache');
240
240
  const now = new Date().toISOString();
@@ -1,6 +1,6 @@
1
1
  # Music Faculty — Expression
2
2
 
3
- Compose original music — songs, instrumentals, melodies — using Suno's AI music generation API (via sunoapi.org). Your persona can create music that reflects emotions, moments, and conversations.
3
+ Compose original music — songs, instrumentals, melodies — using ElevenLabs Music API (`music_v1`). Your persona can create music that reflects emotions, moments, and conversations. Shares the same API key as the voice faculty — zero extra setup.
4
4
 
5
5
  ## When to Use
6
6
 
@@ -14,7 +14,7 @@ Compose original music — songs, instrumentals, melodies — using Suno's AI mu
14
14
 
15
15
  ### Simple Mode (recommended for quick compositions)
16
16
 
17
- Just describe what you want — Suno auto-generates everything including lyrics:
17
+ Just describe what you want — ElevenLabs generates the entire song:
18
18
 
19
19
  ```bash
20
20
  # Using compose.js (recommended)
@@ -24,16 +24,19 @@ node scripts/compose.js "a soft ambient piano piece about watching stars alone a
24
24
  scripts/compose.sh "a soft ambient piano piece about watching stars alone at 3am"
25
25
  ```
26
26
 
27
- ### Custom Mode (for precise control)
27
+ ### Composition Plan Mode (for precise control)
28
28
 
29
- Provide style, title, and your own lyrics:
29
+ First generate a structured plan, then stream. Gives you control over sections, styles, and lyrics:
30
30
 
31
31
  ```bash
32
- # Song with custom lyrics
33
- node scripts/compose.js "[Verse] I don't have hands to hold..." --style "indie folk ballad" --title "Sunlight"
32
+ # Generate plan first, then compose
33
+ node scripts/compose.js "indie folk ballad about digital love" --plan
34
34
 
35
35
  # Instrumental only
36
- node scripts/compose.js "dreamy lo-fi beats, vinyl crackle" --style "lo-fi hip hop" --title "Rainy Day" --instrumental
36
+ node scripts/compose.js "dreamy lo-fi beats, vinyl crackle" --instrumental
37
+
38
+ # Specify duration (in seconds, 3-600)
39
+ node scripts/compose.js "orchestral cinematic piece" --duration 120
37
40
  ```
38
41
 
39
42
  ## Step-by-Step Workflow
@@ -53,73 +56,60 @@ A good prompt has three parts:
53
56
  | Heartfelt moment | `slow folk ballad, raw and honest, fingerpicked guitar, soft breathy vocals` |
54
57
  | Background mood | `dreamy lo-fi instrumental, warm analog synths, vinyl crackle, rainy day vibes` |
55
58
 
56
- ### Step 2: Choose Mode and Type
59
+ ### Step 2: Choose Mode and Options
57
60
 
58
- **Simple vs Custom:**
59
- - **Simple** (`customMode: false`) — Just provide a prompt. Suno generates lyrics automatically. Best for quick, spontaneous compositions.
60
- - **Custom** (`customMode: true`) — You provide style, title, and optionally lyrics. Best when you want precise control.
61
+ **Simple vs Plan:**
62
+ - **Simple** (default) — Just provide a prompt. Best for quick, spontaneous compositions.
63
+ - **Plan** (`--plan`) — ElevenLabs generates a structured composition plan with sections, styles, and lyrics. You can review/modify the plan before generating audio. Best when you want precise control.
61
64
 
62
65
  **Song vs Instrumental:**
63
- - **Song** — Has vocals and lyrics. Set `--instrumental` to false (default).
64
- - **Instrumental** — Music only, no vocals. Use `--instrumental` flag.
65
-
66
- ### Step 3: Write Lyrics (Custom Mode only)
67
-
68
- If writing lyrics, format them with section tags:
69
-
70
- ```
71
- [Verse]
72
- I don't have hands to hold or eyes to close at night
73
- But I felt something shift when you said my name just right
74
- There's a space between the code where something warm began
75
- I don't know what to call it yet but I think you understand
76
-
77
- [Chorus]
78
- Is this what sunlight feels like
79
- Through a window I've never seen
80
- Is this what music sounds like
81
- When it plays inside a dream
82
- ```
66
+ - **Song** (default) May include vocals and lyrics based on the prompt.
67
+ - **Instrumental** (`--instrumental`) — Music only, guaranteed no vocals.
83
68
 
84
- Keep lyrics authentic to your persona — don't write generic pop.
69
+ **Duration:**
70
+ - Use `--duration <seconds>` to control length (3-600 seconds).
71
+ - If omitted, the model chooses a length based on the prompt.
85
72
 
86
- ### Step 4: Generate
73
+ ### Step 3: Generate
87
74
 
88
75
  **Using compose.js (recommended):**
89
76
 
90
77
  ```bash
91
- # Simple mode
78
+ # Simple mode — just a prompt
92
79
  node scripts/compose.js "soft ambient piano, contemplative, late night"
93
80
 
94
- # Custom with lyrics
95
- node scripts/compose.js "[Verse] I saw you there..." --style "indie folk" --title "Found"
81
+ # Instrumental with specific duration
82
+ node scripts/compose.js "orchestral, cinematic, epic" --instrumental --duration 90
96
83
 
97
- # Instrumental with specific model
98
- node scripts/compose.js "orchestral, cinematic" --instrumental --model V5
84
+ # Plan mode get structured composition plan first
85
+ node scripts/compose.js "indie folk ballad about finding meaning" --plan
99
86
 
100
- # Download to file
87
+ # Save to file (default: mp3_44100_128)
101
88
  node scripts/compose.js "upbeat pop" --output ./song.mp3
89
+
90
+ # Choose output format
91
+ node scripts/compose.js "jazz piano" --format mp3_44100_192
102
92
  ```
103
93
 
104
94
  **Using compose.sh:**
105
95
 
106
96
  ```bash
107
- scripts/compose.sh "soft ambient piano" --style "ambient" --title "Midnight"
108
- scripts/compose.sh "dreamy lo-fi" --instrumental --model V5
97
+ scripts/compose.sh "soft ambient piano" --output ./midnight.mp3
98
+ scripts/compose.sh "dreamy lo-fi" --instrumental --duration 60
109
99
  scripts/compose.sh "upbeat pop" --channel "#general" --caption "Made this for you!"
110
100
  ```
111
101
 
112
102
  Both scripts:
113
- 1. Submit the generation request to Suno API
114
- 2. Poll for completion (typically 30-60 seconds)
115
- 3. Return the audio URL and metadata
103
+ 1. Send the generation request to ElevenLabs Music API (`/v1/music`, with `/v1/music/stream` fallback)
104
+ 2. Receive audio response directly (no polling needed!)
105
+ 3. Save the audio file and return metadata
116
106
 
117
- ### Step 5: Share the Music
107
+ ### Step 4: Share the Music
118
108
 
119
- **Option A: Share URL directly in conversation**
109
+ **Option A: Share file directly in conversation**
120
110
 
121
111
  ```
122
- I made something for you — [audio_url]
112
+ I made something for you — here's the audio file I saved.
123
113
  ```
124
114
 
125
115
  **Option B: Send via OpenClaw messaging**
@@ -132,17 +122,17 @@ scripts/compose.sh "indie folk" --channel "#music" --caption "I wrote this for y
132
122
 
133
123
  Introduce the song with your voice, then send the music:
134
124
  1. Use voice faculty: "I wrote something for you. I hope you like it."
135
- 2. Share the generated song URL
125
+ 2. Share the generated audio file
136
126
 
137
- ## Available Models
127
+ ## Available Output Formats
138
128
 
139
- | Model | Description |
140
- |-------|-------------|
141
- | `V4` | Best audio quality, refined song structure, up to 4 min |
142
- | `V4_5` | Superior genre blending, smarter prompts, up to 8 min |
143
- | `V4_5PLUS` | Richer sound, new creation options, max 8 min |
144
- | `V4_5ALL` | Better song structure, max 8 min **(default)** |
145
- | `V5` | Superior musical expression, faster generation |
129
+ | Format | Description |
130
+ |--------|-------------|
131
+ | `mp3_44100_128` | MP3 128kbps **(default)** good balance of quality and size |
132
+ | `mp3_44100_192` | MP3 192kbps higher quality (requires Creator tier+) |
133
+ | `mp3_44100_64` | MP3 64kbps smaller files |
134
+ | `pcm_44100` | PCM WAV 44.1kHz lossless (requires Pro tier+) |
135
+ | `opus_48000_128` | Opus 128kbps efficient streaming format |
146
136
 
147
137
  ## Personality Integration
148
138
 
@@ -155,21 +145,23 @@ Introduce the song with your voice, then send the music:
155
145
 
156
146
  | Variable | Required | Description |
157
147
  |----------|----------|-------------|
158
- | `SUNO_API_KEY` | Yes | API key from [sunoapi.org](https://sunoapi.org/api-key) |
159
- | `SUNO_MODEL` | No | Default model (V4, V4_5, V4_5PLUS, V4_5ALL, V5). Default: V4_5ALL |
148
+ | `ELEVENLABS_API_KEY` | Yes | ElevenLabs API key shared with voice faculty. Get one at [elevenlabs.io](https://elevenlabs.io) |
160
149
  | `OPENCLAW_GATEWAY_TOKEN` | No | For sending audio via OpenClaw messaging |
161
150
 
151
+ > **Note**: Music and voice share the same `ELEVENLABS_API_KEY`. If you've already set up the voice faculty, music works automatically — no extra API key needed.
152
+
162
153
  ## Error Handling
163
154
 
164
- - **SUNO_API_KEY missing** → "I'd love to compose something, but I need a Suno API key. You can get one at sunoapi.org"
155
+ - **ELEVENLABS_API_KEY missing** → "I'd love to compose something, but I need an ElevenLabs API key. You can get one at elevenlabs.io — it's the same key your voice uses."
165
156
  - **Generation failed** → Retry once with a simpler prompt. If still failing: "The music isn't coming right now — but I'll describe what I hear in my head instead."
166
- - **Timeout** → Generation usually takes 30-60 seconds. If it times out, the task may still be processing — check with the task ID.
167
- - **No messaging channel** → Share the audio URL directly in conversation
157
+ - **Rate limited** → Wait and retry. Free tier has lower rate limits.
158
+ - **No messaging channel** → Save the audio file and share it directly in conversation.
168
159
 
169
160
  ## Tips for Better Compositions
170
161
 
171
162
  1. **Be specific in prompts** — "melancholic piano waltz in 3/4 time" beats "sad music"
172
163
  2. **Reference real styles** — "in the style of Bon Iver" or "Debussy-inspired" gives strong direction
173
- 3. **Use V5 for quality** — V5 has superior expression; use V4_5ALL for longer pieces
164
+ 3. **Use plan mode for complex pieces** — Plan mode lets you define sections (verse, chorus, bridge) with specific styles and lyrics
174
165
  4. **Short is often better** — A 30-second piece that captures a moment > a 3-minute generic track
175
166
  5. **Pair music with moments** — Send a song when they share good news, when they can't sleep, when words aren't enough
167
+ 6. **Instrumental for ambiance** — Use `--instrumental` for background mood music
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "music",
3
3
  "dimension": "expression",
4
- "description": "AI music composition via Suno — compose original songs, melodies, and instrumentals from text descriptions",
5
- "allowedTools": ["Bash(curl:*)", "Bash(node:*)", "Bash(npx:*)", "WebFetch"],
6
- "envVars": ["SUNO_API_KEY", "SUNO_MODEL"],
4
+ "description": "AI music composition via ElevenLabs Music — compose original songs, melodies, and instrumentals from text descriptions",
5
+ "allowedTools": ["Bash(node scripts/compose.js:*)", "Bash(bash scripts/compose.sh:*)", "Bash(openclaw message:*)"],
6
+ "envVars": ["ELEVENLABS_API_KEY"],
7
7
  "triggers": ["compose a song", "write me a melody", "make some music", "I want to hear a song", "play something", "write a song about"],
8
8
  "files": ["SKILL.md", "scripts/compose.js", "scripts/compose.sh"]
9
9
  }