@exreve/exk 1.0.9 → 1.0.11

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/dist/index.js CHANGED
@@ -941,7 +941,7 @@ async function runDaemon(foreground = false, email) {
941
941
  socket?.emit('fs:list:response', { success: false, error: error.message });
942
942
  }
943
943
  });
944
- // File write handler
944
+ // File write handler - supports text (utf-8) and binary (base64) files
945
945
  socket.on('fs:write', async (data) => {
946
946
  try {
947
947
  const { filePath, content, encoding = 'utf-8' } = data;
@@ -953,8 +953,14 @@ async function runDaemon(foreground = false, email) {
953
953
  // Ensure directory exists
954
954
  const dir = path.dirname(filePath);
955
955
  await fs.mkdir(dir, { recursive: true });
956
- // Write file
957
- await fs.writeFile(filePath, content, encoding);
956
+ // Write file - support base64 encoding for binary files
957
+ if (encoding === 'base64') {
958
+ const buffer = Buffer.from(content, 'base64');
959
+ await fs.writeFile(filePath, buffer);
960
+ }
961
+ else {
962
+ await fs.writeFile(filePath, content, encoding);
963
+ }
958
964
  socket?.emit('fs:write:response', { success: true });
959
965
  }
960
966
  catch (err) {
@@ -2586,6 +2592,34 @@ program
2586
2592
  execSync(`pm2 start "${exkBin}" --name cli --interpreter none -- daemon`, {
2587
2593
  stdio: 'inherit'
2588
2594
  });
2595
+ // Configure pm2 to start on boot (creates systemd/launchd service)
2596
+ let startupConfigured = false;
2597
+ try {
2598
+ const startupResult = execSync('pm2 startup 2>&1', { encoding: 'utf-8' });
2599
+ if (startupResult.includes('sudo') || startupResult.includes('[PM2] You have to run')) {
2600
+ // pm2 startup needs sudo - try running the suggested command
2601
+ const match = startupResult.match(/(sudo .+)/);
2602
+ if (match) {
2603
+ console.log('\n⚙ PM2 startup requires admin privileges.');
2604
+ console.log('Run this command to enable auto-start on reboot:');
2605
+ console.log(` ${match[1]}`);
2606
+ }
2607
+ }
2608
+ else {
2609
+ startupConfigured = true;
2610
+ }
2611
+ }
2612
+ catch (err) {
2613
+ const execErr = err;
2614
+ const output = execErr.stderr || '';
2615
+ const match = output.match(/(sudo .+)/);
2616
+ if (match) {
2617
+ console.log('\n⚙ PM2 startup requires admin privileges.');
2618
+ console.log('Run this command to enable auto-start on reboot:');
2619
+ console.log(` ${match[1]}`);
2620
+ }
2621
+ // Non-critical - pm2 startup may need sudo
2622
+ }
2589
2623
  // Save pm2 process list for auto-restart on reboot
2590
2624
  try {
2591
2625
  execSync('pm2 save', { stdio: 'inherit' });
@@ -2595,6 +2629,9 @@ program
2595
2629
  }
2596
2630
  console.log('\n✓ exk installation complete!');
2597
2631
  console.log('The service is now running in the background.');
2632
+ if (startupConfigured) {
2633
+ console.log('✓ Auto-start on reboot is configured.');
2634
+ }
2598
2635
  console.log('\nUseful commands:');
2599
2636
  console.log(' pm2 logs cli - View logs');
2600
2637
  console.log(' pm2 restart cli - Restart service');
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exreve/exk",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "exk - Control Claude CLI with voice and programmable interfaces",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,8 +33,8 @@
33
33
  "url": ""
34
34
  },
35
35
  "dependencies": {
36
- "@anthropic-ai/claude-agent-sdk": "^0.1.23",
37
- "@anthropic-ai/sdk": "^0.74.0",
36
+ "@anthropic-ai/claude-agent-sdk": "^0.2.87",
37
+ "@anthropic-ai/sdk": "^0.80.0",
38
38
  "@fastify/static": "^9.0.0",
39
39
  "@xenova/transformers": "^2.17.2",
40
40
  "chokidar": "^3.6.0",