clawmate 1.4.0 → 1.4.2
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/index.js +441 -442
- package/main/ai-bridge.js +59 -59
- package/main/ai-connector.js +60 -60
- package/main/autostart.js +6 -6
- package/main/desktop-path.js +4 -4
- package/main/file-command-parser.js +46 -46
- package/main/file-ops.js +27 -27
- package/main/index.js +17 -17
- package/main/ipc-handlers.js +24 -24
- package/main/manifest.js +2 -2
- package/main/platform.js +16 -16
- package/main/smart-file-ops.js +64 -64
- package/main/store.js +1 -1
- package/main/telegram.js +137 -137
- package/main/tray.js +61 -61
- package/main/updater.js +13 -13
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/preload/preload.js +18 -18
- package/renderer/css/effects.css +6 -6
- package/renderer/css/pet.css +8 -8
- package/renderer/css/speech.css +5 -5
- package/renderer/first-run.html +14 -14
- package/renderer/index.html +4 -4
- package/renderer/js/ai-controller.js +91 -91
- package/renderer/js/app.js +24 -24
- package/renderer/js/browser-watcher.js +32 -32
- package/renderer/js/character.js +33 -33
- package/renderer/js/interactions.js +21 -21
- package/renderer/js/memory.js +60 -60
- package/renderer/js/metrics.js +141 -141
- package/renderer/js/mode-manager.js +13 -13
- package/renderer/js/pet-engine.js +236 -236
- package/renderer/js/speech.js +19 -19
- package/renderer/js/state-machine.js +23 -23
- package/renderer/js/time-aware.js +15 -15
- package/renderer/launcher.html +8 -8
- package/shared/constants.js +11 -11
- package/shared/messages.js +130 -130
- package/shared/personalities.js +44 -44
- package/skills/launch-pet/index.js +57 -47
- package/skills/launch-pet/skill.json +12 -23
package/shared/messages.js
CHANGED
|
@@ -1,211 +1,211 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Speech bubble message DB
|
|
3
|
+
* All messages maintain a positive, playful tone
|
|
4
4
|
*/
|
|
5
5
|
const MESSAGES = {
|
|
6
6
|
greetings: {
|
|
7
7
|
morning: [
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
8
|
+
'Good morning! \u2600\uFE0F',
|
|
9
|
+
'Let\'s crush it today!',
|
|
10
|
+
'Rise and shine~!',
|
|
11
|
+
'You\'re up? Let\'s have a great day!',
|
|
12
|
+
'Morning! What\'s the plan?',
|
|
13
13
|
],
|
|
14
14
|
afternoon: [
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
15
|
+
'Had lunch yet?',
|
|
16
|
+
'Keep it up this afternoon!',
|
|
17
|
+
'Hungry... time to eat!',
|
|
18
|
+
'Watch out for the afternoon slump~',
|
|
19
19
|
],
|
|
20
20
|
evening: [
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
21
|
+
'Great work today!',
|
|
22
|
+
'Evening time~ take it easy!',
|
|
23
|
+
'Have a nice evening!',
|
|
24
|
+
'How was your day?',
|
|
25
25
|
],
|
|
26
26
|
night: [
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
27
|
+
'Good night... zzZ',
|
|
28
|
+
'It\'s late, shouldn\'t you sleep?',
|
|
29
|
+
'It\'s getting late... nighty night!',
|
|
30
|
+
'See you tomorrow! zzz',
|
|
31
31
|
],
|
|
32
32
|
},
|
|
33
33
|
|
|
34
34
|
reactions: {
|
|
35
35
|
pet: [
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
36
|
+
'Eek! That tickles~',
|
|
37
|
+
'Hehe, do it again!',
|
|
38
|
+
'Love it love it!',
|
|
39
|
+
'Nom nom~ feels good!',
|
|
40
|
+
'Click! (claw snap)',
|
|
41
|
+
'Thanks for paying attention to me!',
|
|
42
|
+
'We\'re getting closer, right?',
|
|
43
|
+
'Clicky clack~ \u270C\uFE0F',
|
|
44
44
|
],
|
|
45
45
|
incarnation: [
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
46
|
+
'...Detected.',
|
|
47
|
+
'The connection grows stronger.',
|
|
48
|
+
'I sense your presence.',
|
|
49
|
+
'An interesting human.',
|
|
50
|
+
'Can you feel the power of the Claw?',
|
|
51
|
+
'Positive energy detected.',
|
|
52
|
+
'Good to be together.',
|
|
53
|
+
'I acknowledge you as a partner.',
|
|
54
54
|
],
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
tips: [
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
58
|
+
'You can drag me around!',
|
|
59
|
+
'Triple-click to switch modes!',
|
|
60
|
+
'Change settings from the tray icon!',
|
|
61
|
+
'At night I get sleepy too... zzz',
|
|
62
|
+
'You can undo file moves from the tray!',
|
|
63
|
+
'Stay with me long enough and I might evolve~',
|
|
64
64
|
],
|
|
65
65
|
|
|
66
66
|
milestones: {
|
|
67
|
-
first_click: '
|
|
68
|
-
clicks_10: '
|
|
69
|
-
clicks_50: '50
|
|
70
|
-
clicks_100: '100
|
|
71
|
-
clicks_500: '500
|
|
72
|
-
days_1: '
|
|
73
|
-
days_7: '
|
|
74
|
-
days_30: '
|
|
75
|
-
days_100: '100
|
|
67
|
+
first_click: 'First meeting! Nice to meet you!',
|
|
68
|
+
clicks_10: 'Already 10 times! We\'re friends now, right?',
|
|
69
|
+
clicks_50: '50 times! Am I popular or what? \u2B50',
|
|
70
|
+
clicks_100: '100 times! You\'re truly a special friend!',
|
|
71
|
+
clicks_500: '500 times... a legendary partner!',
|
|
72
|
+
days_1: 'One day together! Let\'s do it again tomorrow!',
|
|
73
|
+
days_7: 'One week anniversary! We go way back~',
|
|
74
|
+
days_30: 'One month anniversary! Best partner ever!',
|
|
75
|
+
days_100: '100 days! Isn\'t our bond something special?',
|
|
76
76
|
},
|
|
77
77
|
|
|
78
78
|
idle_chatter: [
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
'(
|
|
82
|
-
'
|
|
83
|
-
'
|
|
84
|
-
'(
|
|
85
|
-
'
|
|
79
|
+
'So bored~',
|
|
80
|
+
'Whatcha doing?',
|
|
81
|
+
'(claw click)',
|
|
82
|
+
'Exploring the desktop~',
|
|
83
|
+
'Nice spot right here!',
|
|
84
|
+
'(stretches)',
|
|
85
|
+
'How\'s the weather today?',
|
|
86
86
|
],
|
|
87
87
|
|
|
88
|
-
//
|
|
88
|
+
// Browsing watch comments (keyword -> comment arrays)
|
|
89
89
|
browsing: {
|
|
90
|
-
//
|
|
90
|
+
// Shopping
|
|
91
91
|
shopping: {
|
|
92
|
-
keywords: ['
|
|
92
|
+
keywords: ['coupang', '11st', 'gmarket', 'auction', 'wemakeprice', 'tmon', 'amazon', 'aliexpress', 'musinsa', 'oliveyoung', 'shopping'],
|
|
93
93
|
comments: [
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
-
'
|
|
97
|
-
'
|
|
98
|
-
'
|
|
99
|
-
'
|
|
94
|
+
'Shopping again? Your wallet is crying...',
|
|
95
|
+
'What are you buying? Show me!',
|
|
96
|
+
'Impulse purchase alert!',
|
|
97
|
+
'What are you splurging on this time?',
|
|
98
|
+
'Ever thought about emptying that cart?',
|
|
99
|
+
'When\'s the package arriving? Can\'t wait!',
|
|
100
100
|
],
|
|
101
101
|
},
|
|
102
|
-
//
|
|
102
|
+
// YouTube / Video
|
|
103
103
|
video: {
|
|
104
|
-
keywords: ['youtube', '
|
|
104
|
+
keywords: ['youtube', 'twitch', 'netflix', 'disney+', 'wavve', 'tving', 'watcha'],
|
|
105
105
|
comments: [
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
'
|
|
111
|
-
'
|
|
106
|
+
'What are you watching? Let me watch too!',
|
|
107
|
+
'Watching videos again~',
|
|
108
|
+
'Is this one good?',
|
|
109
|
+
'Turn on subtitles so I can follow!',
|
|
110
|
+
'Just one more episode... and suddenly it\'s 3 AM!',
|
|
111
|
+
'Did you hit subscribe?',
|
|
112
112
|
],
|
|
113
113
|
},
|
|
114
114
|
// SNS
|
|
115
115
|
sns: {
|
|
116
|
-
keywords: ['instagram', '
|
|
116
|
+
keywords: ['instagram', 'twitter', 'x.com', 'facebook', 'threads', 'tiktok', 'reddit'],
|
|
117
117
|
comments: [
|
|
118
|
-
'
|
|
119
|
-
'
|
|
120
|
-
'
|
|
121
|
-
'
|
|
122
|
-
'
|
|
123
|
-
'
|
|
118
|
+
'On social media again? I\'m right here in real life!',
|
|
119
|
+
'Hitting that like button, aren\'t you?',
|
|
120
|
+
'Infinite scroll alert!',
|
|
121
|
+
'Don\'t comment, you\'ll start a fight!',
|
|
122
|
+
'Take a pic of me too~',
|
|
123
|
+
'Don\'t ignore me for your feed!',
|
|
124
124
|
],
|
|
125
125
|
},
|
|
126
|
-
//
|
|
126
|
+
// News
|
|
127
127
|
news: {
|
|
128
|
-
keywords: ['
|
|
128
|
+
keywords: ['news', 'naver.com', 'daum', 'bbc', 'cnn'],
|
|
129
129
|
comments: [
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
130
|
+
'What\'s going on in the world?',
|
|
131
|
+
'Reading the news... anything happening today?',
|
|
132
|
+
'Don\'t just read bad news, it\'ll bring you down!',
|
|
133
|
+
'Any good news? Let me know!',
|
|
134
134
|
],
|
|
135
135
|
},
|
|
136
|
-
//
|
|
136
|
+
// Dev / Programming
|
|
137
137
|
dev: {
|
|
138
|
-
keywords: ['github', 'gitlab', 'stackoverflow', 'stack overflow', 'vscode', 'codepen', 'npm', 'developer', '
|
|
138
|
+
keywords: ['github', 'gitlab', 'stackoverflow', 'stack overflow', 'vscode', 'codepen', 'npm', 'developer', 'documentation', 'docs', 'api'],
|
|
139
139
|
comments: [
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'Stack Overflow
|
|
144
|
-
'
|
|
140
|
+
'Coding! That\'s awesome!',
|
|
141
|
+
'Got an error? Tell me, I\'ll cheer you up!',
|
|
142
|
+
'Squashing bugs? You got this!',
|
|
143
|
+
'Copy-pasting from Stack Overflow is a dev essential!',
|
|
144
|
+
'Remember to commit often!',
|
|
145
145
|
],
|
|
146
146
|
},
|
|
147
|
-
//
|
|
147
|
+
// Search
|
|
148
148
|
search: {
|
|
149
|
-
keywords: ['google.com/search', '
|
|
149
|
+
keywords: ['google.com/search', 'google', 'naver.com/search', 'bing'],
|
|
150
150
|
comments: [
|
|
151
|
-
'
|
|
152
|
-
'
|
|
153
|
-
'
|
|
154
|
-
'
|
|
151
|
+
'What are you looking for?',
|
|
152
|
+
'Search and you shall find~',
|
|
153
|
+
'Why search when you can ask me!',
|
|
154
|
+
'Something on your mind?',
|
|
155
155
|
],
|
|
156
156
|
},
|
|
157
|
-
//
|
|
157
|
+
// Gaming
|
|
158
158
|
game: {
|
|
159
|
-
keywords: ['steam', 'epic games', '
|
|
159
|
+
keywords: ['steam', 'epic games', 'league of', 'valorant', 'overwatch', 'minecraft', 'roblox'],
|
|
160
160
|
comments: [
|
|
161
|
-
'
|
|
162
|
-
'
|
|
163
|
-
'
|
|
164
|
-
'
|
|
161
|
+
'Gaming! Let me join!',
|
|
162
|
+
'You gotta win! Go go go!',
|
|
163
|
+
'Just one more round... you said that last time!',
|
|
164
|
+
'Gaming addiction alert~',
|
|
165
165
|
],
|
|
166
166
|
},
|
|
167
|
-
//
|
|
167
|
+
// Music
|
|
168
168
|
music: {
|
|
169
|
-
keywords: ['spotify', '
|
|
169
|
+
keywords: ['spotify', 'melon', 'genie', 'bugs', 'apple music', 'soundcloud'],
|
|
170
170
|
comments: [
|
|
171
|
-
'
|
|
172
|
-
'
|
|
173
|
-
'
|
|
174
|
-
'
|
|
171
|
+
'What are you listening to? Is it good?',
|
|
172
|
+
'Let me hear too~',
|
|
173
|
+
'Nice taste in music!',
|
|
174
|
+
'You like this song? Me too!',
|
|
175
175
|
],
|
|
176
176
|
},
|
|
177
|
-
//
|
|
177
|
+
// Mail
|
|
178
178
|
mail: {
|
|
179
|
-
keywords: ['gmail', 'outlook', 'mail'
|
|
179
|
+
keywords: ['gmail', 'outlook', 'mail'],
|
|
180
180
|
comments: [
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
'
|
|
181
|
+
'Checking emails~',
|
|
182
|
+
'Any important ones?',
|
|
183
|
+
'Watch out for spam!',
|
|
184
184
|
],
|
|
185
185
|
},
|
|
186
|
-
//
|
|
186
|
+
// General browser detection (fallback)
|
|
187
187
|
general: {
|
|
188
|
-
keywords: ['chrome', 'edge', 'firefox', 'safari', 'brave', 'whale'
|
|
188
|
+
keywords: ['chrome', 'edge', 'firefox', 'safari', 'brave', 'whale'],
|
|
189
189
|
comments: [
|
|
190
|
-
'
|
|
191
|
-
'
|
|
192
|
-
'
|
|
193
|
-
'
|
|
190
|
+
'Surfing the web~',
|
|
191
|
+
'Find anything fun? Tell me!',
|
|
192
|
+
'Clean up those tabs... too many!',
|
|
193
|
+
'Is the wifi working okay?',
|
|
194
194
|
],
|
|
195
195
|
},
|
|
196
196
|
},
|
|
197
197
|
|
|
198
|
-
//
|
|
198
|
+
// Evolution messages
|
|
199
199
|
evolution: {
|
|
200
|
-
stage_1: '
|
|
201
|
-
stage_2: '
|
|
202
|
-
stage_3: '
|
|
203
|
-
stage_4: '
|
|
204
|
-
stage_5: '
|
|
200
|
+
stage_1: 'Something\'s changing...!',
|
|
201
|
+
stage_2: 'Do I look different? Maybe it\'s just me!',
|
|
202
|
+
stage_3: 'Our friendship is transforming me!',
|
|
203
|
+
stage_4: 'Getting closer to my final form!',
|
|
204
|
+
stage_5: 'This is my completed form!',
|
|
205
205
|
},
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
//
|
|
208
|
+
// Make accessible globally in renderer
|
|
209
209
|
if (typeof window !== 'undefined') {
|
|
210
210
|
window._messages = MESSAGES;
|
|
211
211
|
} else if (typeof module !== 'undefined') {
|
package/shared/personalities.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Pet
|
|
4
|
-
* Incarnation
|
|
2
|
+
* Mode-specific personality parameters
|
|
3
|
+
* Pet mode: high playfulness, fast speed
|
|
4
|
+
* Incarnation mode: calm, normal speed
|
|
5
5
|
*/
|
|
6
6
|
const PERSONALITIES = {
|
|
7
7
|
pet: {
|
|
8
8
|
name: 'Clawby',
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Playful companion',
|
|
10
10
|
playfulness: 0.8,
|
|
11
11
|
shyness: 0.3,
|
|
12
12
|
boldness: 0.7,
|
|
13
13
|
speedMultiplier: 1.5,
|
|
14
|
-
idleChatterChance: 0.15, // 15%
|
|
15
|
-
fileInterestChance: 0.1, // 10%
|
|
16
|
-
sleepResistance: 0.2, //
|
|
14
|
+
idleChatterChance: 0.15, // 15% chance to mutter while idle
|
|
15
|
+
fileInterestChance: 0.1, // 10% chance to show interest in files
|
|
16
|
+
sleepResistance: 0.2, // Sleep resistance (low = falls asleep easily)
|
|
17
17
|
},
|
|
18
18
|
incarnation: {
|
|
19
19
|
name: 'Claw',
|
|
20
|
-
title: '
|
|
20
|
+
title: 'Embodied intelligence',
|
|
21
21
|
playfulness: 0.3,
|
|
22
22
|
shyness: 0.1,
|
|
23
23
|
boldness: 0.9,
|
|
@@ -29,27 +29,27 @@ const PERSONALITIES = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Dynamic persona (reflects the bot's personality in Incarnation mode)
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
34
|
+
* When the user has multiple bots, the persona of the currently focused chat bot is applied.
|
|
35
|
+
* Can be dynamically updated via the set_persona command.
|
|
36
36
|
*/
|
|
37
37
|
let activePersona = null;
|
|
38
38
|
|
|
39
39
|
function setActivePersona(persona) {
|
|
40
40
|
activePersona = {
|
|
41
41
|
name: persona.name || 'Claw',
|
|
42
|
-
title: persona.title || '
|
|
43
|
-
personality: persona.personality || '', // "
|
|
44
|
-
speakingStyle: persona.speakingStyle || '', // "
|
|
45
|
-
color: persona.color || null, // { primary, secondary, eye }
|
|
42
|
+
title: persona.title || 'Embodied intelligence',
|
|
43
|
+
personality: persona.personality || '', // "calm and logical", "lively and humorous"
|
|
44
|
+
speakingStyle: persona.speakingStyle || '', // "formal", "casual", "aloof"
|
|
45
|
+
color: persona.color || null, // { primary, secondary, eye } custom colors
|
|
46
46
|
playfulness: persona.playfulness ?? 0.3,
|
|
47
47
|
shyness: persona.shyness ?? 0.1,
|
|
48
48
|
boldness: persona.boldness ?? 0.9,
|
|
49
49
|
speedMultiplier: persona.speedMultiplier ?? 1.0,
|
|
50
50
|
idleChatterChance: persona.idleChatterChance ?? 0.08,
|
|
51
|
-
greetings: persona.greetings || [], //
|
|
52
|
-
catchphrases: persona.catchphrases || [], //
|
|
51
|
+
greetings: persona.greetings || [], // Custom greeting list
|
|
52
|
+
catchphrases: persona.catchphrases || [], // Characteristic catchphrases
|
|
53
53
|
};
|
|
54
54
|
return activePersona;
|
|
55
55
|
}
|
|
@@ -63,72 +63,72 @@ function clearActivePersona() {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* -
|
|
69
|
-
* -
|
|
70
|
-
* -
|
|
66
|
+
* Evolution stage appearance parameters
|
|
67
|
+
* All evolution is positive/cute in direction only
|
|
68
|
+
* - Never transforms into scary/creepy appearances
|
|
69
|
+
* - Colors become brighter and more vivid
|
|
70
|
+
* - Details are added while maintaining a round, soft feel
|
|
71
71
|
*/
|
|
72
72
|
const EVOLUTION_STAGES = {
|
|
73
|
-
// Stage 0:
|
|
73
|
+
// Stage 0: Default — newborn appearance
|
|
74
74
|
0: {
|
|
75
|
-
name: '
|
|
75
|
+
name: 'Baby Claw',
|
|
76
76
|
clicksRequired: 0,
|
|
77
77
|
daysRequired: 0,
|
|
78
78
|
colorMod: { brightness: 1.0, saturation: 1.0 },
|
|
79
79
|
sizeScale: 1.0,
|
|
80
80
|
accessories: [],
|
|
81
|
-
description: '
|
|
81
|
+
description: 'Small and cute default appearance',
|
|
82
82
|
},
|
|
83
|
-
// Stage 1:
|
|
83
|
+
// Stage 1: Starting to bond
|
|
84
84
|
1: {
|
|
85
|
-
name: '
|
|
85
|
+
name: 'Little Claw',
|
|
86
86
|
clicksRequired: 20,
|
|
87
87
|
daysRequired: 1,
|
|
88
88
|
colorMod: { brightness: 1.05, saturation: 1.05 },
|
|
89
89
|
sizeScale: 1.0,
|
|
90
|
-
accessories: ['blush'], //
|
|
91
|
-
description: '
|
|
90
|
+
accessories: ['blush'], // Blushing cheeks
|
|
91
|
+
description: 'Cute look with slightly rosy cheeks',
|
|
92
92
|
},
|
|
93
|
-
// Stage 2:
|
|
93
|
+
// Stage 2: Close friends
|
|
94
94
|
2: {
|
|
95
|
-
name: '
|
|
95
|
+
name: 'Bouncy Claw',
|
|
96
96
|
clicksRequired: 50,
|
|
97
97
|
daysRequired: 3,
|
|
98
98
|
colorMod: { brightness: 1.1, saturation: 1.1 },
|
|
99
99
|
sizeScale: 1.05,
|
|
100
|
-
accessories: ['blush', 'sparkle_eyes'], //
|
|
101
|
-
description: '
|
|
100
|
+
accessories: ['blush', 'sparkle_eyes'], // Sparkly eyes
|
|
101
|
+
description: 'Sparkling eyes, slightly bigger',
|
|
102
102
|
},
|
|
103
|
-
// Stage 3:
|
|
103
|
+
// Stage 3: Best friends
|
|
104
104
|
3: {
|
|
105
|
-
name: '
|
|
105
|
+
name: 'Shining Claw',
|
|
106
106
|
clicksRequired: 150,
|
|
107
107
|
daysRequired: 7,
|
|
108
108
|
colorMod: { brightness: 1.15, saturation: 1.15 },
|
|
109
109
|
sizeScale: 1.08,
|
|
110
|
-
accessories: ['blush', 'sparkle_eyes', 'crown'], //
|
|
111
|
-
description: '
|
|
110
|
+
accessories: ['blush', 'sparkle_eyes', 'crown'], // Small crown
|
|
111
|
+
description: 'Shining look with a little crown',
|
|
112
112
|
},
|
|
113
|
-
// Stage 4:
|
|
113
|
+
// Stage 4: Soulmates
|
|
114
114
|
4: {
|
|
115
|
-
name: '
|
|
115
|
+
name: 'Rainbow Claw',
|
|
116
116
|
clicksRequired: 300,
|
|
117
117
|
daysRequired: 14,
|
|
118
118
|
colorMod: { brightness: 1.2, saturation: 1.2 },
|
|
119
119
|
sizeScale: 1.1,
|
|
120
|
-
accessories: ['blush', 'sparkle_eyes', 'crown', 'aura'], //
|
|
121
|
-
description: '
|
|
120
|
+
accessories: ['blush', 'sparkle_eyes', 'crown', 'aura'], // Aura
|
|
121
|
+
description: 'Shining form wrapped in a warm aura',
|
|
122
122
|
},
|
|
123
|
-
// Stage 5:
|
|
123
|
+
// Stage 5: Final — legendary partner
|
|
124
124
|
5: {
|
|
125
|
-
name: '
|
|
125
|
+
name: 'Legendary Claw',
|
|
126
126
|
clicksRequired: 500,
|
|
127
127
|
daysRequired: 30,
|
|
128
128
|
colorMod: { brightness: 1.25, saturation: 1.3 },
|
|
129
129
|
sizeScale: 1.12,
|
|
130
130
|
accessories: ['blush', 'sparkle_eyes', 'golden_crown', 'rainbow_aura', 'wings'],
|
|
131
|
-
description: '
|
|
131
|
+
description: 'Legendary form with small wings and a golden crown',
|
|
132
132
|
},
|
|
133
133
|
};
|
|
134
134
|
|
|
@@ -1,64 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
/**
|
|
2
|
-
* "
|
|
3
|
+
* "Launch pet" handler logic
|
|
3
4
|
*
|
|
4
|
-
* 1. OS
|
|
5
|
-
* 2. ClawMate
|
|
6
|
-
* 3.
|
|
7
|
-
* 4. Electron
|
|
5
|
+
* 1. Detect OS
|
|
6
|
+
* 2. Check if ClawMate is installed
|
|
7
|
+
* 3. If not installed -> install
|
|
8
|
+
* 4. Launch Electron app
|
|
8
9
|
*/
|
|
9
10
|
const { spawn, execSync } = require('child_process');
|
|
10
11
|
const path = require('path');
|
|
11
12
|
const os = require('os');
|
|
12
13
|
const fs = require('fs');
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
async function launch(context) {
|
|
16
|
+
const log = context?.log || console.log;
|
|
17
|
+
const platform = os.platform();
|
|
18
|
+
const appRoot = path.resolve(__dirname, '..', '..');
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
const npmCmd = platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
25
|
-
execSync(`${npmCmd} install`, {
|
|
26
|
-
cwd: appRoot,
|
|
27
|
-
stdio: 'pipe',
|
|
28
|
-
timeout: 120000,
|
|
29
|
-
});
|
|
30
|
-
context.log('의존성 설치 완료!');
|
|
31
|
-
} catch (err) {
|
|
32
|
-
return {
|
|
33
|
-
success: false,
|
|
34
|
-
message: `의존성 설치 실패: ${err.message}`,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Electron 앱 실행
|
|
20
|
+
// Check Electron installation
|
|
21
|
+
const nodeModulesPath = path.join(appRoot, 'node_modules');
|
|
22
|
+
if (!fs.existsSync(nodeModulesPath)) {
|
|
23
|
+
log('Installing dependencies...');
|
|
40
24
|
try {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
detached: true,
|
|
44
|
-
stdio: 'ignore',
|
|
25
|
+
const npmCmd = platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
26
|
+
execSync(`${npmCmd} install`, {
|
|
45
27
|
cwd: appRoot,
|
|
46
|
-
|
|
28
|
+
stdio: 'inherit',
|
|
29
|
+
timeout: 120000,
|
|
47
30
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const mode = context.params?.mode || 'pet';
|
|
51
|
-
const modeName = mode === 'pet' ? 'Clawby' : 'Claw';
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
success: true,
|
|
55
|
-
message: `ClawMate(${modeName})가 바탕화면에 나타났습니다! 🦞`,
|
|
56
|
-
};
|
|
31
|
+
log('Dependencies installed!');
|
|
57
32
|
} catch (err) {
|
|
58
33
|
return {
|
|
59
34
|
success: false,
|
|
60
|
-
message:
|
|
35
|
+
message: `Dependency installation failed: ${err.message}`,
|
|
61
36
|
};
|
|
62
37
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Launch Electron app
|
|
41
|
+
try {
|
|
42
|
+
const electronBin = platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
43
|
+
const child = spawn(electronBin, ['electron', appRoot], {
|
|
44
|
+
detached: true,
|
|
45
|
+
stdio: 'ignore',
|
|
46
|
+
cwd: appRoot,
|
|
47
|
+
env: { ...process.env },
|
|
48
|
+
});
|
|
49
|
+
child.unref();
|
|
50
|
+
|
|
51
|
+
const mode = context?.params?.mode || 'pet';
|
|
52
|
+
const modeName = mode === 'pet' ? 'Clawby' : 'Claw';
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
success: true,
|
|
56
|
+
message: `ClawMate (${modeName}) has appeared on your desktop! \uD83E\uDD9E`,
|
|
57
|
+
};
|
|
58
|
+
} catch (err) {
|
|
59
|
+
return {
|
|
60
|
+
success: false,
|
|
61
|
+
message: `Launch failed: ${err.message}`,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// CLI entry point
|
|
67
|
+
if (require.main === module) {
|
|
68
|
+
launch().then((result) => {
|
|
69
|
+
console.log(result.message);
|
|
70
|
+
if (!result.success) process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
module.exports = { execute: launch };
|