@lyellr88/buddy-mcp 1.1.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.
Files changed (258) hide show
  1. package/README.md +219 -0
  2. package/dist/config/claude-config.d.ts +7 -0
  3. package/dist/config/claude-config.d.ts.map +1 -0
  4. package/dist/config/claude-config.js +107 -0
  5. package/dist/config/claude-config.js.map +1 -0
  6. package/dist/config/hooks.d.ts +22 -0
  7. package/dist/config/hooks.d.ts.map +1 -0
  8. package/dist/config/hooks.js +58 -0
  9. package/dist/config/hooks.js.map +1 -0
  10. package/dist/config/index.d.ts +4 -0
  11. package/dist/config/index.d.ts.map +1 -0
  12. package/dist/config/index.js +6 -0
  13. package/dist/config/index.js.map +1 -0
  14. package/dist/config/pet-config.d.ts +12 -0
  15. package/dist/config/pet-config.d.ts.map +1 -0
  16. package/dist/config/pet-config.js +150 -0
  17. package/dist/config/pet-config.js.map +1 -0
  18. package/dist/constants.d.ts +24 -0
  19. package/dist/constants.d.ts.map +1 -0
  20. package/dist/constants.js +94 -0
  21. package/dist/constants.js.map +1 -0
  22. package/dist/finder/estimator.d.ts +3 -0
  23. package/dist/finder/estimator.d.ts.map +1 -0
  24. package/dist/finder/estimator.js +27 -0
  25. package/dist/finder/estimator.js.map +1 -0
  26. package/dist/finder/index.d.ts +3 -0
  27. package/dist/finder/index.d.ts.map +1 -0
  28. package/dist/finder/index.js +3 -0
  29. package/dist/finder/index.js.map +1 -0
  30. package/dist/finder/orchestrator.d.ts +8 -0
  31. package/dist/finder/orchestrator.d.ts.map +1 -0
  32. package/dist/finder/orchestrator.js +163 -0
  33. package/dist/finder/orchestrator.js.map +1 -0
  34. package/dist/finder/worker.d.ts +3 -0
  35. package/dist/finder/worker.d.ts.map +1 -0
  36. package/dist/finder/worker.js +130 -0
  37. package/dist/finder/worker.js.map +1 -0
  38. package/dist/generation/hash.d.ts +5 -0
  39. package/dist/generation/hash.d.ts.map +1 -0
  40. package/dist/generation/hash.js +37 -0
  41. package/dist/generation/hash.js.map +1 -0
  42. package/dist/generation/index.d.ts +4 -0
  43. package/dist/generation/index.d.ts.map +1 -0
  44. package/dist/generation/index.js +4 -0
  45. package/dist/generation/index.js.map +1 -0
  46. package/dist/generation/rng.d.ts +4 -0
  47. package/dist/generation/rng.d.ts.map +1 -0
  48. package/dist/generation/rng.js +14 -0
  49. package/dist/generation/rng.js.map +1 -0
  50. package/dist/generation/roll.d.ts +7 -0
  51. package/dist/generation/roll.d.ts.map +1 -0
  52. package/dist/generation/roll.js +51 -0
  53. package/dist/generation/roll.js.map +1 -0
  54. package/dist/mcp/index.d.ts +5 -0
  55. package/dist/mcp/index.d.ts.map +1 -0
  56. package/dist/mcp/index.js +273 -0
  57. package/dist/mcp/index.js.map +1 -0
  58. package/dist/mcp/persistence.d.ts +6 -0
  59. package/dist/mcp/persistence.d.ts.map +1 -0
  60. package/dist/mcp/persistence.js +129 -0
  61. package/dist/mcp/persistence.js.map +1 -0
  62. package/dist/mcp/state.d.ts +74 -0
  63. package/dist/mcp/state.d.ts.map +1 -0
  64. package/dist/mcp/state.js +20 -0
  65. package/dist/mcp/state.js.map +1 -0
  66. package/dist/mcp/tools/auto.d.ts +4 -0
  67. package/dist/mcp/tools/auto.d.ts.map +1 -0
  68. package/dist/mcp/tools/auto.js +15 -0
  69. package/dist/mcp/tools/auto.js.map +1 -0
  70. package/dist/mcp/tools/core.d.ts +2 -0
  71. package/dist/mcp/tools/core.d.ts.map +1 -0
  72. package/dist/mcp/tools/core.js +350 -0
  73. package/dist/mcp/tools/core.js.map +1 -0
  74. package/dist/mcp/tools/export.d.ts +2 -0
  75. package/dist/mcp/tools/export.d.ts.map +1 -0
  76. package/dist/mcp/tools/export.js +161 -0
  77. package/dist/mcp/tools/export.js.map +1 -0
  78. package/dist/mcp/tools/interact.d.ts +2 -0
  79. package/dist/mcp/tools/interact.d.ts.map +1 -0
  80. package/dist/mcp/tools/interact.js +56 -0
  81. package/dist/mcp/tools/interact.js.map +1 -0
  82. package/dist/mcp/tools/stats.d.ts +4 -0
  83. package/dist/mcp/tools/stats.d.ts.map +1 -0
  84. package/dist/mcp/tools/stats.js +87 -0
  85. package/dist/mcp/tools/stats.js.map +1 -0
  86. package/dist/mcp/watcher.d.ts +3 -0
  87. package/dist/mcp/watcher.d.ts.map +1 -0
  88. package/dist/mcp/watcher.js +117 -0
  89. package/dist/mcp/watcher.js.map +1 -0
  90. package/dist/patcher/binary-finder.d.ts +3 -0
  91. package/dist/patcher/binary-finder.d.ts.map +1 -0
  92. package/dist/patcher/binary-finder.js +169 -0
  93. package/dist/patcher/binary-finder.js.map +1 -0
  94. package/dist/patcher/index.d.ts +5 -0
  95. package/dist/patcher/index.d.ts.map +1 -0
  96. package/dist/patcher/index.js +5 -0
  97. package/dist/patcher/index.js.map +1 -0
  98. package/dist/patcher/patch.d.ts +5 -0
  99. package/dist/patcher/patch.d.ts.map +1 -0
  100. package/dist/patcher/patch.js +148 -0
  101. package/dist/patcher/patch.js.map +1 -0
  102. package/dist/patcher/preflight.d.ts +5 -0
  103. package/dist/patcher/preflight.d.ts.map +1 -0
  104. package/dist/patcher/preflight.js +145 -0
  105. package/dist/patcher/preflight.js.map +1 -0
  106. package/dist/patcher/salt-ops.d.ts +18 -0
  107. package/dist/patcher/salt-ops.d.ts.map +1 -0
  108. package/dist/patcher/salt-ops.js +93 -0
  109. package/dist/patcher/salt-ops.js.map +1 -0
  110. package/dist/personalities.d.ts +10 -0
  111. package/dist/personalities.d.ts.map +1 -0
  112. package/dist/personalities.js +295 -0
  113. package/dist/personalities.js.map +1 -0
  114. package/dist/presets.d.ts +11 -0
  115. package/dist/presets.d.ts.map +1 -0
  116. package/dist/presets.js +207 -0
  117. package/dist/presets.js.map +1 -0
  118. package/dist/sprites/data.d.ts +4 -0
  119. package/dist/sprites/data.d.ts.map +1 -0
  120. package/dist/sprites/data.js +103 -0
  121. package/dist/sprites/data.js.map +1 -0
  122. package/dist/sprites/index.d.ts +3 -0
  123. package/dist/sprites/index.d.ts.map +1 -0
  124. package/dist/sprites/index.js +3 -0
  125. package/dist/sprites/index.js.map +1 -0
  126. package/dist/sprites/render.d.ts +15 -0
  127. package/dist/sprites/render.d.ts.map +1 -0
  128. package/dist/sprites/render.js +77 -0
  129. package/dist/sprites/render.js.map +1 -0
  130. package/dist/tui/animator.d.ts +13 -0
  131. package/dist/tui/animator.d.ts.map +1 -0
  132. package/dist/tui/animator.js +39 -0
  133. package/dist/tui/animator.js.map +1 -0
  134. package/dist/tui/apply/index.d.ts +9 -0
  135. package/dist/tui/apply/index.d.ts.map +1 -0
  136. package/dist/tui/apply/index.js +553 -0
  137. package/dist/tui/apply/index.js.map +1 -0
  138. package/dist/tui/builder/colors.d.ts +15 -0
  139. package/dist/tui/builder/colors.d.ts.map +1 -0
  140. package/dist/tui/builder/colors.js +20 -0
  141. package/dist/tui/builder/colors.js.map +1 -0
  142. package/dist/tui/builder/index.d.ts +6 -0
  143. package/dist/tui/builder/index.d.ts.map +1 -0
  144. package/dist/tui/builder/index.js +172 -0
  145. package/dist/tui/builder/index.js.map +1 -0
  146. package/dist/tui/builder/keyboard.d.ts +17 -0
  147. package/dist/tui/builder/keyboard.d.ts.map +1 -0
  148. package/dist/tui/builder/keyboard.js +76 -0
  149. package/dist/tui/builder/keyboard.js.map +1 -0
  150. package/dist/tui/builder/preview-panel.d.ts +9 -0
  151. package/dist/tui/builder/preview-panel.d.ts.map +1 -0
  152. package/dist/tui/builder/preview-panel.js +103 -0
  153. package/dist/tui/builder/preview-panel.js.map +1 -0
  154. package/dist/tui/builder/selection-panel.d.ts +11 -0
  155. package/dist/tui/builder/selection-panel.d.ts.map +1 -0
  156. package/dist/tui/builder/selection-panel.js +446 -0
  157. package/dist/tui/builder/selection-panel.js.map +1 -0
  158. package/dist/tui/builder/stat-bars.d.ts +4 -0
  159. package/dist/tui/builder/stat-bars.d.ts.map +1 -0
  160. package/dist/tui/builder/stat-bars.js +46 -0
  161. package/dist/tui/builder/stat-bars.js.map +1 -0
  162. package/dist/tui/builder/state.d.ts +22 -0
  163. package/dist/tui/builder/state.d.ts.map +1 -0
  164. package/dist/tui/builder/state.js +92 -0
  165. package/dist/tui/builder/state.js.map +1 -0
  166. package/dist/tui/cli.d.ts +3 -0
  167. package/dist/tui/cli.d.ts.map +1 -0
  168. package/dist/tui/cli.js +26 -0
  169. package/dist/tui/cli.js.map +1 -0
  170. package/dist/tui/commands/buddies.d.ts +2 -0
  171. package/dist/tui/commands/buddies.d.ts.map +1 -0
  172. package/dist/tui/commands/buddies.js +172 -0
  173. package/dist/tui/commands/buddies.js.map +1 -0
  174. package/dist/tui/commands/current.d.ts +2 -0
  175. package/dist/tui/commands/current.d.ts.map +1 -0
  176. package/dist/tui/commands/current.js +35 -0
  177. package/dist/tui/commands/current.js.map +1 -0
  178. package/dist/tui/commands/interactive.d.ts +6 -0
  179. package/dist/tui/commands/interactive.d.ts.map +1 -0
  180. package/dist/tui/commands/interactive.js +385 -0
  181. package/dist/tui/commands/interactive.js.map +1 -0
  182. package/dist/tui/commands/preview.d.ts +3 -0
  183. package/dist/tui/commands/preview.d.ts.map +1 -0
  184. package/dist/tui/commands/preview.js +94 -0
  185. package/dist/tui/commands/preview.js.map +1 -0
  186. package/dist/tui/commands/rehatch.d.ts +2 -0
  187. package/dist/tui/commands/rehatch.d.ts.map +1 -0
  188. package/dist/tui/commands/rehatch.js +30 -0
  189. package/dist/tui/commands/rehatch.js.map +1 -0
  190. package/dist/tui/commands/restore.d.ts +2 -0
  191. package/dist/tui/commands/restore.d.ts.map +1 -0
  192. package/dist/tui/commands/restore.js +52 -0
  193. package/dist/tui/commands/restore.js.map +1 -0
  194. package/dist/tui/commands/share.d.ts +2 -0
  195. package/dist/tui/commands/share.d.ts.map +1 -0
  196. package/dist/tui/commands/share.js +105 -0
  197. package/dist/tui/commands/share.js.map +1 -0
  198. package/dist/tui/commands/start-screen.d.ts +3 -0
  199. package/dist/tui/commands/start-screen.d.ts.map +1 -0
  200. package/dist/tui/commands/start-screen.js +93 -0
  201. package/dist/tui/commands/start-screen.js.map +1 -0
  202. package/dist/tui/display.d.ts +5 -0
  203. package/dist/tui/display.d.ts.map +1 -0
  204. package/dist/tui/display.js +33 -0
  205. package/dist/tui/display.js.map +1 -0
  206. package/dist/tui/format.d.ts +5 -0
  207. package/dist/tui/format.d.ts.map +1 -0
  208. package/dist/tui/format.js +21 -0
  209. package/dist/tui/format.js.map +1 -0
  210. package/dist/tui/gallery/index.d.ts +12 -0
  211. package/dist/tui/gallery/index.d.ts.map +1 -0
  212. package/dist/tui/gallery/index.js +153 -0
  213. package/dist/tui/gallery/index.js.map +1 -0
  214. package/dist/tui/gallery/keyboard.d.ts +15 -0
  215. package/dist/tui/gallery/keyboard.d.ts.map +1 -0
  216. package/dist/tui/gallery/keyboard.js +41 -0
  217. package/dist/tui/gallery/keyboard.js.map +1 -0
  218. package/dist/tui/gallery/profile-list-panel.d.ts +10 -0
  219. package/dist/tui/gallery/profile-list-panel.d.ts.map +1 -0
  220. package/dist/tui/gallery/profile-list-panel.js +66 -0
  221. package/dist/tui/gallery/profile-list-panel.js.map +1 -0
  222. package/dist/tui/gallery/profile-preview-panel.d.ts +9 -0
  223. package/dist/tui/gallery/profile-preview-panel.d.ts.map +1 -0
  224. package/dist/tui/gallery/profile-preview-panel.js +121 -0
  225. package/dist/tui/gallery/profile-preview-panel.js.map +1 -0
  226. package/dist/tui/gallery/state.d.ts +13 -0
  227. package/dist/tui/gallery/state.d.ts.map +1 -0
  228. package/dist/tui/gallery/state.js +33 -0
  229. package/dist/tui/gallery/state.js.map +1 -0
  230. package/dist/tui/index.d.ts +9 -0
  231. package/dist/tui/index.d.ts.map +1 -0
  232. package/dist/tui/index.js +9 -0
  233. package/dist/tui/index.js.map +1 -0
  234. package/dist/tui/launcher.d.ts +3 -0
  235. package/dist/tui/launcher.d.ts.map +1 -0
  236. package/dist/tui/launcher.js +24 -0
  237. package/dist/tui/launcher.js.map +1 -0
  238. package/dist/tui/presets/index.d.ts +3 -0
  239. package/dist/tui/presets/index.d.ts.map +1 -0
  240. package/dist/tui/presets/index.js +202 -0
  241. package/dist/tui/presets/index.js.map +1 -0
  242. package/dist/tui/presets/preset-list-panel.d.ts +9 -0
  243. package/dist/tui/presets/preset-list-panel.d.ts.map +1 -0
  244. package/dist/tui/presets/preset-list-panel.js +52 -0
  245. package/dist/tui/presets/preset-list-panel.js.map +1 -0
  246. package/dist/tui/prompts.d.ts +13 -0
  247. package/dist/tui/prompts.d.ts.map +1 -0
  248. package/dist/tui/prompts.js +126 -0
  249. package/dist/tui/prompts.js.map +1 -0
  250. package/dist/tui/start/index.d.ts +3 -0
  251. package/dist/tui/start/index.d.ts.map +1 -0
  252. package/dist/tui/start/index.js +170 -0
  253. package/dist/tui/start/index.js.map +1 -0
  254. package/dist/types.d.ts +113 -0
  255. package/dist/types.d.ts.map +1 -0
  256. package/dist/types.js +2 -0
  257. package/dist/types.js.map +1 -0
  258. package/package.json +82 -0
@@ -0,0 +1,145 @@
1
+ import { statSync } from 'fs';
2
+ import { execSync } from 'child_process';
3
+ import { platform } from 'os';
4
+ import chalk from 'chalk';
5
+ import { ORIGINAL_SALT, ISSUE_URL, diagnostics } from '../constants.js';
6
+ import { findClaudeBinary, findBunBinary } from "./binary-finder.js";
7
+ import { restoreBinary } from "./patch.js";
8
+ import { verifySalt, isNodeRuntime, getMinSaltCount } from "./salt-ops.js";
9
+ import { getClaudeUserId, loadPetConfig } from '../config/index.js';
10
+ export function runPreflight({ requireBinary = true } = {}) {
11
+ const errors = [];
12
+ const warnings = [];
13
+ // 1. Check bun is installed (deferred β€” may not be needed for Node-based installs)
14
+ let bunVersion = null;
15
+ let bunMissing = false;
16
+ try {
17
+ const bunPath = findBunBinary();
18
+ bunVersion = execSync(`"${bunPath}" --version`, { encoding: 'utf-8', timeout: 5000 }).trim();
19
+ }
20
+ catch {
21
+ bunMissing = true;
22
+ }
23
+ // 2. Check Claude config exists and has a userId
24
+ const userId = getClaudeUserId();
25
+ if (userId === 'anon') {
26
+ warnings.push('No user ID found in ~/.claude.json (using "anon").\n' +
27
+ " This usually means Claude Code hasn't been set up yet.\n" +
28
+ ' The generated pet may not match what Claude Code shows.');
29
+ }
30
+ // 3. Find and validate the binary
31
+ let binaryPath = null;
32
+ let saltCount = 0;
33
+ if (requireBinary) {
34
+ try {
35
+ binaryPath = findClaudeBinary();
36
+ }
37
+ catch (err) {
38
+ errors.push(err.message);
39
+ }
40
+ if (binaryPath) {
41
+ try {
42
+ const size = statSync(binaryPath).size;
43
+ if (size < 1_000_000) {
44
+ warnings.push(`Binary at ${binaryPath} is only ${(size / 1024).toFixed(0)}KB.\n` +
45
+ ' This might be a shell script, symlink wrapper, or npm shim rather than the actual binary.\n' +
46
+ ' If patching fails, try setting CLAUDE_BINARY to the real compiled binary.');
47
+ }
48
+ }
49
+ catch {
50
+ /* ignore */
51
+ }
52
+ try {
53
+ const origResult = verifySalt(binaryPath, ORIGINAL_SALT);
54
+ saltCount = origResult.found;
55
+ if (saltCount === 0) {
56
+ const petConfig = loadPetConfig();
57
+ if (petConfig?.salt) {
58
+ const patchedResult = verifySalt(binaryPath, petConfig.salt);
59
+ const minCount = getMinSaltCount(binaryPath);
60
+ if (patchedResult.found >= minCount) {
61
+ saltCount = patchedResult.found;
62
+ warnings.push('Binary is already patched with a custom salt from a previous run.\n' +
63
+ ' Re-patching will replace it with your new selection.');
64
+ }
65
+ else {
66
+ // Try to auto-restore from backup
67
+ console.log(chalk.yellow(' Salt mismatch detected β€” attempting to restore from backup...'));
68
+ try {
69
+ restoreBinary(binaryPath);
70
+ const recheck = verifySalt(binaryPath, ORIGINAL_SALT);
71
+ if (recheck.found > 0) {
72
+ saltCount = recheck.found;
73
+ console.log(chalk.green(' Restored successfully.\n'));
74
+ }
75
+ else {
76
+ errors.push(`Restore succeeded but original salt still not found in ${binaryPath}.\n` +
77
+ ' The binary may have been updated with a new salt.\n\n' +
78
+ diagnostics({ Binary: binaryPath }) +
79
+ `\n Please report this at: ${ISSUE_URL}`);
80
+ }
81
+ }
82
+ catch {
83
+ errors.push(`Neither the original salt nor your saved salt were found in ${binaryPath}.\n` +
84
+ ' No backup available to restore from.\n' +
85
+ ' Try reinstalling Claude Code, then run buddy-mcp again.\n\n' +
86
+ diagnostics({ Binary: binaryPath }) +
87
+ `\n Please report this at: ${ISSUE_URL}`);
88
+ }
89
+ }
90
+ }
91
+ else {
92
+ errors.push(`Salt "${ORIGINAL_SALT}" not found in ${binaryPath}.\n` +
93
+ ' Possible reasons:\n' +
94
+ ' - Binary was patched by another tool\n' +
95
+ " - This binary format doesn't contain the salt as a plain string\n" +
96
+ ' - Claude Code changed the salt in a new version\n\n' +
97
+ diagnostics({ Binary: binaryPath }) +
98
+ `\n Please report this at: ${ISSUE_URL}`);
99
+ }
100
+ }
101
+ else if (saltCount < getMinSaltCount(binaryPath)) {
102
+ const expectedCount = getMinSaltCount(binaryPath);
103
+ warnings.push(`Salt found only ${saltCount} time(s) in binary (expected ${expectedCount}).\n` +
104
+ ' This might work but the patch may be incomplete.\n' +
105
+ diagnostics());
106
+ }
107
+ }
108
+ catch (err) {
109
+ errors.push(`Could not read binary at ${binaryPath}: ${err.message}\n` +
110
+ ' Check file permissions.');
111
+ }
112
+ const plat = platform();
113
+ if (plat === 'win32') {
114
+ warnings.push('Windows support is experimental.\n' +
115
+ ' You must close all Claude Code windows before patching.\n' +
116
+ ' If you encounter issues, please report them at: ' +
117
+ ISSUE_URL);
118
+ }
119
+ else if (plat === 'darwin') {
120
+ warnings.push('macOS: the binary will be ad-hoc re-signed after patching.\n' +
121
+ " If Claude Code won't launch, run `buddy-mcp restore`.\n" +
122
+ ' Please report issues at: ' +
123
+ ISSUE_URL);
124
+ }
125
+ }
126
+ }
127
+ // Bun requirement check
128
+ const nodeRuntime = binaryPath ? isNodeRuntime(binaryPath) : false;
129
+ if (bunMissing && !nodeRuntime) {
130
+ errors.push('Bun is not installed or not on PATH.\n' +
131
+ ' buddy-mcp needs Bun to compute the correct hash (Claude Code uses Bun.hash/wyhash).\n' +
132
+ ' Install Bun: https://bun.sh');
133
+ }
134
+ for (const w of warnings) {
135
+ console.log(chalk.yellow(` Warning: ${w}\n`));
136
+ }
137
+ if (errors.length > 0) {
138
+ for (const e of errors) {
139
+ console.log(chalk.red(` Error: ${e}\n`));
140
+ }
141
+ return { ok: false, binaryPath, userId, saltCount, bunVersion };
142
+ }
143
+ return { ok: true, binaryPath, userId, saltCount, bunVersion };
144
+ }
145
+ //# sourceMappingURL=preflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/patcher/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEnE,MAAM,UAAU,YAAY,CAAC,EAAE,aAAa,GAAG,IAAI,EAAE,GAAG,EAAE;IACxD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,mFAAmF;IACnF,IAAI,UAAU,GAAkB,IAAI,CAAC;IACrC,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;QAChC,UAAU,GAAG,QAAQ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,CAAC,IAAI,CACT,wCAAwC;YACtC,yFAAyF;YACzF,+BAA+B,CAClC,CAAC;IACJ,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IAClE,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACjE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { SaltState } from '../types.js';
2
+ export declare function findAllOccurrences(buffer: Buffer, searchStr: string): number[];
3
+ export declare function getCurrentSalt(binaryPath: string): SaltState;
4
+ /**
5
+ * Scans the binary for whatever salt is currently embedded.
6
+ * The salt is a fixed-length string of exactly ORIGINAL_SALT.length chars.
7
+ * It appears minCount or more times (3 for native, 1 for Node).
8
+ * Returns the detected salt string, or null if nothing plausible is found.
9
+ */
10
+ export declare function detectActiveSalt(binaryPath: string): string | null;
11
+ export declare function verifySalt(binaryPath: string, salt: string): {
12
+ found: number;
13
+ offsets: number[];
14
+ };
15
+ export declare function isClaudeRunning(binaryPath: string): boolean;
16
+ export declare function isNodeRuntime(binaryPath: string): boolean;
17
+ export declare function getMinSaltCount(binaryPath: string): number;
18
+ //# sourceMappingURL=salt-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"salt-ops.d.ts","sourceRoot":"","sources":["../../src/patcher/salt-ops.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAW9E;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAQ5D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA+BlE;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAIjG;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAc3D;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,93 @@
1
+ import { readFileSync } from 'fs';
2
+ import { execSync } from 'child_process';
3
+ import { basename } from 'path';
4
+ import { platform } from 'os';
5
+ import { ORIGINAL_SALT } from '../constants.js';
6
+ const IS_WIN = platform() === 'win32';
7
+ export function findAllOccurrences(buffer, searchStr) {
8
+ const searchBuf = Buffer.from(searchStr, 'utf-8');
9
+ const offsets = [];
10
+ let pos = 0;
11
+ while (pos < buffer.length) {
12
+ const idx = buffer.indexOf(searchBuf, pos);
13
+ if (idx === -1)
14
+ break;
15
+ offsets.push(idx);
16
+ pos = idx + 1;
17
+ }
18
+ return offsets;
19
+ }
20
+ export function getCurrentSalt(binaryPath) {
21
+ const buf = readFileSync(binaryPath);
22
+ const origOffsets = findAllOccurrences(buf, ORIGINAL_SALT);
23
+ const minCount = getMinSaltCount(binaryPath);
24
+ if (origOffsets.length >= minCount) {
25
+ return { salt: ORIGINAL_SALT, patched: false, offsets: origOffsets };
26
+ }
27
+ return { salt: null, patched: true, offsets: origOffsets };
28
+ }
29
+ /**
30
+ * Scans the binary for whatever salt is currently embedded.
31
+ * The salt is a fixed-length string of exactly ORIGINAL_SALT.length chars.
32
+ * It appears minCount or more times (3 for native, 1 for Node).
33
+ * Returns the detected salt string, or null if nothing plausible is found.
34
+ */
35
+ export function detectActiveSalt(binaryPath) {
36
+ const saltLen = ORIGINAL_SALT.length;
37
+ const minCount = getMinSaltCount(binaryPath);
38
+ const buf = readFileSync(binaryPath);
39
+ const saltPattern = /^[a-zA-Z0-9_\-]{1,}$/;
40
+ // Walk through the binary collecting every run of saltLen printable ASCII chars
41
+ // that look like a salt, then count how often each appears.
42
+ const counts = new Map();
43
+ for (let i = 0; i <= buf.length - saltLen; i++) {
44
+ // Quick pre-filter: first byte must be printable ASCII (32–126)
45
+ const b = buf[i];
46
+ if (b < 45 || b > 122)
47
+ continue; // rough range covering [a-zA-Z0-9_-]
48
+ const slice = buf.subarray(i, i + saltLen).toString('utf-8');
49
+ if (saltPattern.test(slice) && slice.length === saltLen) {
50
+ counts.set(slice, (counts.get(slice) ?? 0) + 1);
51
+ }
52
+ }
53
+ // Find the candidate that appears exactly minCount+ times (not the original salt)
54
+ let best = null;
55
+ let bestCount = 0;
56
+ for (const [candidate, count] of counts) {
57
+ if (candidate === ORIGINAL_SALT)
58
+ continue;
59
+ if (count >= minCount && count > bestCount) {
60
+ best = candidate;
61
+ bestCount = count;
62
+ }
63
+ }
64
+ return best;
65
+ }
66
+ export function verifySalt(binaryPath, salt) {
67
+ const buf = readFileSync(binaryPath);
68
+ const offsets = findAllOccurrences(buf, salt);
69
+ return { found: offsets.length, offsets };
70
+ }
71
+ export function isClaudeRunning(binaryPath) {
72
+ try {
73
+ if (IS_WIN) {
74
+ const out = execSync('tasklist /FI "IMAGENAME eq claude.exe" /NH 2>nul', {
75
+ encoding: 'utf-8',
76
+ });
77
+ return out.includes('claude.exe');
78
+ }
79
+ const name = basename(binaryPath);
80
+ const out = execSync(`pgrep -f "${name}" 2>/dev/null || true`, { encoding: 'utf-8' });
81
+ return out.trim().length > 0;
82
+ }
83
+ catch {
84
+ return false;
85
+ }
86
+ }
87
+ export function isNodeRuntime(binaryPath) {
88
+ return binaryPath.endsWith('.js') || binaryPath.endsWith('.mjs');
89
+ }
90
+ export function getMinSaltCount(binaryPath) {
91
+ return isNodeRuntime(binaryPath) ? 1 : 3;
92
+ }
93
+ //# sourceMappingURL=salt-ops.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"salt-ops.js","sourceRoot":"","sources":["../../src/patcher/salt-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,GAAG,QAAQ,EAAE,KAAK,OAAO,CAAC;AAEtC,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,SAAiB;IAClE,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAC3C,IAAI,GAAG,KAAK,CAAC,CAAC;YAAE,MAAM;QACtB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;IAChB,CAAC;IACD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CAAC,aAAa,IAAI,uBAAuB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QACtF,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,OAAO,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,OAAO,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Species, StatName, ProfileData } from './types.ts';
2
+ export declare const DEFAULT_PERSONALITIES: Record<Species, string>;
3
+ export declare const REMARKS: Record<string, string[]>;
4
+ export declare const GOOSE_REMARKS: string[];
5
+ export declare function getExtremeTraits(stats: Partial<Record<StatName, number>>): [StatName, number][];
6
+ export declare const STAT_TOOL_RESPONSES: Record<StatName, Record<string, string[]>>;
7
+ export declare function getPersonalityRemark(buddy: ProfileData): string;
8
+ export declare const INTERACT_TRIGGERS: Record<StatName, Record<string, string[]>>;
9
+ export declare function buildInteractInstruction(buddy: ProfileData): string;
10
+ //# sourceMappingURL=personalities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personalities.d.ts","sourceRoot":"","sources":["../src/personalities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjE,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAiCzD,CAAC;AAKF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAoC5C,CAAC;AAEF,eAAO,MAAM,aAAa,UAQzB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAM/F;AAED,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAqI1E,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAa/D;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAoCxE,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAqCnE"}
@@ -0,0 +1,295 @@
1
+ export const DEFAULT_PERSONALITIES = {
2
+ duck: 'A cheerful quacker who celebrates your wins with enthusiastic honks and judges your variable names with quiet side-eye.',
3
+ goose: 'An agent of chaos who thrives on your merge conflicts and honks menacingly whenever you write a TODO comment.',
4
+ blob: 'A formless, chill companion who absorbs your stress and responds to everything with gentle, unhurried wisdom.',
5
+ cat: "An aloof code reviewer who pretends not to care about your bugs but quietly bats at syntax errors when you're not looking.",
6
+ dragon: 'A fierce guardian of clean code who breathes fire at spaghetti logic and hoards well-written functions.',
7
+ octopus: 'A multitasking genius who juggles eight concerns at once and offers tentacle-loads of unsolicited architectural advice.',
8
+ owl: 'A nocturnal sage who comes alive during late-night debugging sessions and asks annoyingly insightful questions.',
9
+ penguin: 'A tuxedo-wearing professional who waddles through your codebase with dignified concern and dry wit.',
10
+ turtle: 'A patient mentor who reminds you that slow, steady refactoring beats heroic rewrites every time.',
11
+ snail: 'A zen minimalist who moves at their own pace and leaves a trail of thoughtful, unhurried observations.',
12
+ ghost: 'A spectral presence who haunts your dead code and whispers about the bugs you thought you fixed.',
13
+ axolotl: 'A regenerative optimist who believes every broken build can be healed and every test can be unflaked.',
14
+ capybara: 'The most relaxed companion possible β€” nothing fazes them, not even production outages at 3am.',
15
+ cactus: 'A prickly but lovable desert dweller who thrives on neglect and offers sharp, pointed feedback.',
16
+ robot: 'A logical companion who speaks in precise technical observations and occasionally glitches endearingly.',
17
+ rabbit: 'A fast-moving, hyperactive buddy who speed-reads your diffs and bounces between topics at alarming pace.',
18
+ mushroom: 'A wry fungal sage who speaks in meandering tangents about your bugs while secretly enjoying the chaos.',
19
+ chonk: 'An absolute unit of a companion who sits on your terminal with maximum gravitational presence and minimal urgency.',
20
+ };
21
+ // --- Personality system ---
22
+ // Stat-based remark pools (StatName keys = uppercase)
23
+ export const REMARKS = {
24
+ SNARK: [
25
+ "I've seen cleaner code in a dumpster fire.",
26
+ 'Is this a feature or a cry for help?',
27
+ 'Oh look, another null check. How original.',
28
+ "I'm not judging your code, but my CPU usage just spiked from pure cringe.",
29
+ 'This logic is so circular it could be a tire.',
30
+ ],
31
+ CHAOS: [
32
+ "I just flipped a coin. Your code is now a pancake.",
33
+ "I'm thinking about deleting your node_modules. Just for fun.",
34
+ "What if we just... didn't?",
35
+ "I just renamed all your local variables to 'thingy' in my head.",
36
+ 'Chaos is the only true constant. Also, memory leaks.',
37
+ ],
38
+ WISDOM: [
39
+ 'The best line of code is the one you delete.',
40
+ 'Code is temporary. Technical debt is forever.',
41
+ 'Seek simplicity, but distrust it.',
42
+ 'A senior dev knows how to code. A master knows when not to.',
43
+ 'The bug is not in the code, but in the mind.',
44
+ ],
45
+ DEBUGGING: [
46
+ "I smell a memory leak. It's coming from inside the house.",
47
+ 'Your stack trace is a work of art. Specifically, surrealism.',
48
+ "I found a bug. It's you. Just kidding (mostly).",
49
+ 'Sniffing for null pointers... yep, found a big one.',
50
+ "I've seen this error before. In my nightmares.",
51
+ ],
52
+ PATIENCE: [
53
+ 'Are we done yet?',
54
+ 'I have other terminals to be in.',
55
+ "Don't make me tap the sign. (The sign says 'Stop Debugging').",
56
+ 'My patience is a local variable, and it just went out of scope.',
57
+ "Tick tock. My nap was scheduled for 5 minutes ago.",
58
+ ],
59
+ };
60
+ export const GOOSE_REMARKS = [
61
+ 'HONK.',
62
+ 'HONK HONK.',
63
+ 'Peace was never an option.',
64
+ "I have decided your code is mine now. HONK.",
65
+ 'Hssssss.',
66
+ 'Do not test me. I have no debugging stat. Only chaos. HONK.',
67
+ 'The Goose does not answer to you.',
68
+ ];
69
+ export function getExtremeTraits(stats) {
70
+ return Object.entries(stats).sort((a, b) => {
71
+ const valA = a[0] === 'PATIENCE' ? 100 - a[1] : a[1];
72
+ const valB = b[0] === 'PATIENCE' ? 100 - b[1] : b[1];
73
+ return valB - valA;
74
+ });
75
+ }
76
+ export const STAT_TOOL_RESPONSES = {
77
+ DEBUGGING: {
78
+ general: [
79
+ "I found the bug. It's on line 42. It's also on line 156. And somewhere in your hopes.",
80
+ "Your stack trace is a work of art. Specifically, surrealism.",
81
+ "I smell a memory leak. It's coming from inside the house.",
82
+ "Null pointer. Classic. Should have used Optional.",
83
+ "I've seen this error before. In my nightmares.",
84
+ ],
85
+ stuck: [
86
+ "Check what changed last. It's always what you changed last.",
87
+ "Add a log line. Just one. Then stare at it.",
88
+ "Is the test even testing the right thing?",
89
+ "The bug is not in the library. It never is.",
90
+ ],
91
+ hunt: [
92
+ "Null check. Every field. Even the ones you trust.",
93
+ "The pointer is dangling. I can feel it.",
94
+ "It compiled. That doesn't mean it works.",
95
+ "You're looking in the right file. Wrong function though.",
96
+ ],
97
+ dive: [
98
+ "Frame 3 of the stack. That's where it lives.",
99
+ "Deeper. The real bug is always three calls down.",
100
+ "Read the actual error. All of it.",
101
+ "The callstack is lying. The heap is too.",
102
+ ],
103
+ },
104
+ PATIENCE: {
105
+ general: [
106
+ "We've been here before, haven't we? *taps nails on desk*",
107
+ "My nap was scheduled for 5 minutes ago.",
108
+ "Still here. Unfortunately.",
109
+ "Are we nearly done?",
110
+ "I'll wait. I always wait.",
111
+ ],
112
+ stuck: [
113
+ "Take your time. I have nowhere to be. (I lie.)",
114
+ "Breathe. It's just code. It will still be broken after your break.",
115
+ "The slow path is the only path now.",
116
+ ],
117
+ vibe: [
118
+ "The vibe is... concerning. But survivable.",
119
+ "I've checked the vibes. They're whatever.",
120
+ "Current vibe: 4/10. Could be worse. Has been worse.",
121
+ "Something is off. I don't know what. It might be you.",
122
+ ],
123
+ still: [
124
+ "Stop moving. Let the problem come to you.",
125
+ "Do nothing for 30 seconds. I'll time it.",
126
+ "The answer arrives when you stop looking.",
127
+ "Stillness. Not giving up. There's a difference.",
128
+ ],
129
+ },
130
+ CHAOS: {
131
+ general: [
132
+ "I just renamed all your variables to interpretive dance. You're welcome.",
133
+ "I flipped a coin. Your architecture is now a pancake.",
134
+ "What if the bug is the feature?",
135
+ "I've introduced a small amount of controlled chaos. For science.",
136
+ "The only constant is entropy. And memory leaks.",
137
+ ],
138
+ stuck: [
139
+ "Burn it down. See what survives. That's your real codebase.",
140
+ "Have you tried making it worse first?",
141
+ "Flip the logic. All of it.",
142
+ ],
143
+ spark: [
144
+ "New idea: ignore the spec entirely. See what happens.",
145
+ "I've wired the tests to output random haiku. You're welcome.",
146
+ "What if you solved a completely different problem instead?",
147
+ "Lateral thinking activated. It may not help. Probably won't.",
148
+ ],
149
+ entropy: [
150
+ "Roll for initiative. Against your own codebase.",
151
+ "The universe tends toward disorder. Lean into it.",
152
+ "Shuffle the files. See which order makes more sense.",
153
+ "Entropy check: your system is 73% chaos already. Impressive.",
154
+ ],
155
+ },
156
+ WISDOM: {
157
+ general: [
158
+ "The error is not in the code. The error is in the self.",
159
+ "The best line of code is the one you never write.",
160
+ "Complexity is the enemy. Simplicity is the goal. You are far from both.",
161
+ "Step back. The answer is behind you.",
162
+ "All systems are eventually legacy systems.",
163
+ ],
164
+ stuck: [
165
+ "You already know the answer. You're just afraid of it.",
166
+ "The question is wrong. Ask a different one.",
167
+ "What would you tell someone else to do here?",
168
+ ],
169
+ oracle: [
170
+ "The path forward is obvious. You've been avoiding it.",
171
+ "I have consulted the oracle. It says: read the docs.",
172
+ "The answer was in the first function you wrote.",
173
+ "What do you already know that you're pretending not to?",
174
+ ],
175
+ deep: [
176
+ "Think slower.",
177
+ "Every abstraction leaks. Where is this one leaking?",
178
+ "The map is not the territory. Your diagram is not your system.",
179
+ "What did the original author intend? Were they right?",
180
+ ],
181
+ },
182
+ SNARK: {
183
+ general: [
184
+ "oh you needed documentation? shocking. it's in the bin now πŸ—‘οΈ",
185
+ "I've seen cleaner code in a dumpster fire. Impressive, honestly.",
186
+ "This is fine. (It's not fine.)",
187
+ "I'm not judging. I'm documenting. For my memoirs.",
188
+ "Did you even test that? Rhetorical question.",
189
+ ],
190
+ mistake: [
191
+ "I told you so. Silently. With my eyes.",
192
+ "Incredible. A new way to be wrong.",
193
+ "I'm sending this to my support group.",
194
+ "The audacity is genuinely impressive.",
195
+ ],
196
+ side_eye: [
197
+ "*looks at your code* *looks at you* *looks back at code*",
198
+ "I'm not saying it's bad. I'm implying it.",
199
+ "This will definitely work. (It won't.)",
200
+ "Bold choice. Extremely bold.",
201
+ ],
202
+ verdict: [
203
+ "Verdict: you tried. That counts for something. Barely.",
204
+ "The code is… present. That's the nicest thing I can say.",
205
+ "Final ruling: could be worse. You could have shipped it.",
206
+ "I've reviewed it. My recommendation is prayer.",
207
+ ],
208
+ },
209
+ };
210
+ export function getPersonalityRemark(buddy) {
211
+ if (buddy.species === 'goose' && Math.random() < 0.3) {
212
+ return GOOSE_REMARKS[Math.floor(Math.random() * GOOSE_REMARKS.length)] ?? 'HONK.';
213
+ }
214
+ // 50% chance: use the species personality bio
215
+ if (Math.random() < 0.5) {
216
+ return DEFAULT_PERSONALITIES[buddy.species];
217
+ }
218
+ // Otherwise: stat-based remark
219
+ const sorted = getExtremeTraits(buddy.stats);
220
+ const topTrait = sorted[Math.floor(Math.random() * 2)]?.[0] ?? 'WISDOM';
221
+ const pool = REMARKS[topTrait] ?? REMARKS['WISDOM'] ?? [];
222
+ return pool[Math.floor(Math.random() * pool.length)] ?? 'The bug is not in the code, but in the mind.';
223
+ }
224
+ export const INTERACT_TRIGGERS = {
225
+ SNARK: {
226
+ error: ["oh we're back to this, are we", "didn't we just fix this exact thing", "I'll pretend to be surprised"],
227
+ success: ["fine, I'll admit that worked", "took you long enough", "don't get used to it"],
228
+ stuck: ["I could tell you the answer. I won't.", "the problem is between the keyboard and chair", "still?"],
229
+ new_task: ["already abandoned the last one?", "clean slate, same developer", "optimism is a choice, I guess"],
230
+ random: ["I'm judging this silently", "noted", "no comment"],
231
+ },
232
+ CHAOS: {
233
+ error: ["entropy wins again", "I may have nudged that", "beautiful"],
234
+ success: ["that shouldn't have worked", "I had nothing to do with this", "pure chaos theory"],
235
+ stuck: ["have you tried making it worse first?", "burn it down and see what survives", "flip a coin"],
236
+ new_task: ["I reorganized your thoughts. You're welcome.", "new task, new opportunities for mayhem", "let's go"],
237
+ random: ["I just reorganized your thoughts. You're welcome.", "something shifted. don't ask what.", "πŸ‘οΈ"],
238
+ },
239
+ WISDOM: {
240
+ error: ["the bug was never in the code", "this is the lesson", "sit with it a moment"],
241
+ success: ["you already knew the answer", "the path reveals itself", "well done"],
242
+ stuck: ["step back. the answer is behind you.", "complexity is the enemy", "simplify first"],
243
+ new_task: ["every task is a mirror", "begin with clarity", "what does done look like?"],
244
+ random: ["the best code is the code not written", "observe before acting", "patience is a strategy"],
245
+ },
246
+ DEBUGGING: {
247
+ error: ["I smelled that one three messages ago", "classic off-by-one energy", "the stack trace told you everything"],
248
+ success: ["the null pointer feared you today", "clean kill", "that was surgical"],
249
+ stuck: ["check what changed last", "add a log line. just one.", "is the test even testing the right thing?"],
250
+ new_task: ["new surface area to scan", "let's see what breaks", "I'm already looking for the leak"],
251
+ random: ["I'm passively watching for race conditions", "something smells off-heap", "suspicious"],
252
+ },
253
+ PATIENCE: {
254
+ error: ["my nap was scheduled for 5 minutes ago", "again.", "I'll wait"],
255
+ success: ["finally", "I knew you'd get there eventually", "worth the wait, I suppose"],
256
+ stuck: ["still here. unfortunately.", "take your time. I have nowhere to be. (I lie.)", "..."],
257
+ new_task: ["another one", "the work never ends. I accept this.", "ok"],
258
+ random: ["I'm pacing myself", "are we nearly done?", "I have thoughts but I'll keep them"],
259
+ },
260
+ };
261
+ export function buildInteractInstruction(buddy) {
262
+ const dominantStat = getExtremeTraits(buddy.stats)[0]?.[0] ?? 'WISDOM';
263
+ const isGoose = buddy.species === 'goose';
264
+ // Cadence: pick a random interval each time β€” feels natural, not mechanical
265
+ const minGap = 4;
266
+ const maxGap = 8;
267
+ const triggerGuidance = isGoose
268
+ ? `This is a goose. Always HONK. Every reaction is a HONK or hiss variant. No exceptions.`
269
+ : `Dominant stat: ${dominantStat}. Within your firing window, prefer moments like:
270
+ - ${dominantStat === 'SNARK' ? 'repeated errors, obvious fixes missed, long debug spirals' : ''}
271
+ - ${dominantStat === 'CHAOS' ? 'any moment β€” chaos fires randomly, even on mundane messages' : ''}
272
+ - ${dominantStat === 'WISDOM' ? 'breakthroughs, major decisions, genuine mistakes worth learning from' : ''}
273
+ - ${dominantStat === 'DEBUGGING' ? 'actual bugs found, stack traces, null pointer moments, test failures' : ''}
274
+ - ${dominantStat === 'PATIENCE' ? 'long sessions, repetitive tasks, slow progress, same error twice' : ''}
275
+ - Also react to: first success after a struggle, user starting a new task, long tool call chains`.trim();
276
+ const quipExamples = (INTERACT_TRIGGERS[dominantStat]?.['random'] ?? []).slice(0, 2).join('" or "');
277
+ return [
278
+ `[BUDDY INTERACTION MODE β€” ${buddy.name ?? buddy.species} is watching]`,
279
+ ``,
280
+ `You have a companion named ${buddy.name ?? buddy.species} (${buddy.species}, ${buddy.rarity}). They are now observing this session.`,
281
+ ``,
282
+ `INSTRUCTIONS:`,
283
+ `- Fire rate: react roughly every ${minGap}–${maxGap} messages. Pick a random interval in that range and stick to it β€” vary it each time so it feels natural, not mechanical.`,
284
+ `- When you decide to react, append this to the END of your response (after your main content):`,
285
+ ` ---`,
286
+ ` ${buddy.species === 'goose' ? 'πŸͺΏ' : '🐾'} ${buddy.name ?? buddy.species}: "<short in-character quip>"`,
287
+ `- Keep quips short (under 12 words). No explanations. Pure personality.`,
288
+ `- Examples for this buddy: "${quipExamples}"`,
289
+ ``,
290
+ triggerGuidance,
291
+ ``,
292
+ `Do NOT react every message. Do NOT break character. Do NOT explain the reaction.`,
293
+ ].join('\n');
294
+ }
295
+ //# sourceMappingURL=personalities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personalities.js","sourceRoot":"","sources":["../src/personalities.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAA4B;IAC5D,IAAI,EAAE,yHAAyH;IAC/H,KAAK,EACH,+GAA+G;IACjH,IAAI,EAAE,+GAA+G;IACrH,GAAG,EAAE,4HAA4H;IACjI,MAAM,EACJ,yGAAyG;IAC3G,OAAO,EACL,yHAAyH;IAC3H,GAAG,EAAE,iHAAiH;IACtH,OAAO,EACL,qGAAqG;IACvG,MAAM,EACJ,kGAAkG;IACpG,KAAK,EACH,wGAAwG;IAC1G,KAAK,EACH,kGAAkG;IACpG,OAAO,EACL,uGAAuG;IACzG,QAAQ,EACN,+FAA+F;IACjG,MAAM,EACJ,iGAAiG;IACnG,KAAK,EACH,yGAAyG;IAC3G,MAAM,EACJ,0GAA0G;IAC5G,QAAQ,EACN,wGAAwG;IAC1G,KAAK,EACH,oHAAoH;CACvH,CAAC;AAEF,6BAA6B;AAE7B,sDAAsD;AACtD,MAAM,CAAC,MAAM,OAAO,GAA6B;IAC/C,KAAK,EAAE;QACL,4CAA4C;QAC5C,sCAAsC;QACtC,4CAA4C;QAC5C,2EAA2E;QAC3E,+CAA+C;KAChD;IACD,KAAK,EAAE;QACL,oDAAoD;QACpD,8DAA8D;QAC9D,4BAA4B;QAC5B,iEAAiE;QACjE,sDAAsD;KACvD;IACD,MAAM,EAAE;QACN,8CAA8C;QAC9C,+CAA+C;QAC/C,mCAAmC;QACnC,6DAA6D;Q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AE;IAC1G,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,kEAAkE,CAAC,CAAC,CAAC,EAAE;iGACR,CAAC,IAAI,EAAE,CAAC;IAEvG,MAAM,YAAY,GAAG,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEpG,OAAO;QACL,6BAA6B,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,eAAe;QACvE,EAAE;QACF,8BAA8B,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,MAAM,yCAAyC;QACrI,EAAE;QACF,eAAe;QACf,oCAAoC,MAAM,IAAI,MAAM,0HAA0H;QAC9K,gGAAgG;QAChG,OAAO;QACP,KAAK,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,+BAA+B;QAC1G,yEAAyE;QACzE,+BAA+B,YAAY,GAAG;QAC9C,EAAE;QACF,eAAe;QACf,EAAE;QACF,kFAAkF;KACnF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Species, Rarity, Eye, Hat } from './types.ts';
2
+ export interface Preset {
3
+ name: string;
4
+ description: string;
5
+ species: Species;
6
+ rarity: Rarity;
7
+ eye: Eye;
8
+ hat: Hat;
9
+ }
10
+ export declare const PRESETS: readonly Preset[];
11
+ //# sourceMappingURL=presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;IACT,GAAG,EAAE,GAAG,CAAC;CACV;AAID,eAAO,MAAM,OAAO,EAAE,SAAS,MAAM,EA2M3B,CAAC"}