expxagents 0.11.1 → 0.11.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.
@@ -63,10 +63,11 @@ function getDefaultTemplate(file) {
63
63
  }
64
64
  /**
65
65
  * Recursively copy a directory, skipping .DS_Store files.
66
+ * Returns stats about how many files were copied and how many actually changed.
66
67
  */
67
- function copyDirRecursive(src, dest) {
68
+ function copyDirRecursive(src, dest, stats = { total: 0, changed: 0 }) {
68
69
  if (!fs.existsSync(src))
69
- return;
70
+ return stats;
70
71
  fs.mkdirSync(dest, { recursive: true });
71
72
  for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
72
73
  if (entry.name === '.DS_Store')
@@ -74,12 +75,19 @@ function copyDirRecursive(src, dest) {
74
75
  const srcPath = path.join(src, entry.name);
75
76
  const destPath = path.join(dest, entry.name);
76
77
  if (entry.isDirectory()) {
77
- copyDirRecursive(srcPath, destPath);
78
+ copyDirRecursive(srcPath, destPath, stats);
78
79
  }
79
80
  else {
80
- fs.copyFileSync(srcPath, destPath);
81
+ stats.total++;
82
+ const srcContent = fs.readFileSync(srcPath);
83
+ const destExists = fs.existsSync(destPath);
84
+ if (!destExists || !srcContent.equals(fs.readFileSync(destPath))) {
85
+ fs.copyFileSync(srcPath, destPath);
86
+ stats.changed++;
87
+ }
81
88
  }
82
89
  }
90
+ return stats;
83
91
  }
84
92
  const SKILL_MD = `---
85
93
  name: expxagents
@@ -291,10 +299,13 @@ export async function initCommand(options = {}) {
291
299
  const coreSrc = path.join(assetsDir, 'core');
292
300
  const coreDest = path.join(cwd, '_expxagents', 'core');
293
301
  if (update || !fs.existsSync(coreDest)) {
294
- copyDirRecursive(coreSrc, coreDest);
295
- console.log(update
296
- ? ' Updated _expxagents/core/ (core agents + best practices)'
297
- : ' Copied _expxagents/core/ (core agents + best practices)');
302
+ const coreStats = copyDirRecursive(coreSrc, coreDest);
303
+ if (update) {
304
+ console.log(` Updated _expxagents/core/ ${coreStats.changed}/${coreStats.total} files changed`);
305
+ }
306
+ else {
307
+ console.log(` Copied _expxagents/core/ (${coreStats.total} files)`);
308
+ }
298
309
  }
299
310
  else {
300
311
  console.log(' _expxagents/core/ already exists (use --update to refresh)');
@@ -303,10 +314,13 @@ export async function initCommand(options = {}) {
303
314
  const agentsSrc = path.join(assetsDir, 'agents');
304
315
  const agentsDest = path.join(cwd, 'agents');
305
316
  if (update || !fs.existsSync(agentsDest)) {
306
- copyDirRecursive(agentsSrc, agentsDest);
307
- console.log(update
308
- ? ' Updated agents/ (93 agent templates across 16 sectors)'
309
- : ' Copied agents/ (93 agent templates across 16 sectors)');
317
+ const agentStats = copyDirRecursive(agentsSrc, agentsDest);
318
+ if (update) {
319
+ console.log(` Updated agents/ ${agentStats.changed}/${agentStats.total} files changed`);
320
+ }
321
+ else {
322
+ console.log(` Copied agents/ (${agentStats.total} files)`);
323
+ }
310
324
  }
311
325
  else {
312
326
  console.log(' agents/ already exists (use --update to refresh)');
@@ -382,6 +396,11 @@ BRIDGE_TIMEOUT_MS=300000
382
396
  fs.writeFileSync(gitignorePath, gitignoreEntries.join('\n') + '\n', 'utf-8');
383
397
  console.log(' Created .gitignore');
384
398
  }
385
- console.log('\nProject initialized! Run `expxagents onboarding` to configure your profile.');
386
- console.log('Use /expxagents in Claude Code to get started.');
399
+ if (update) {
400
+ console.log('\nUpdate complete! Assets refreshed to latest version.');
401
+ }
402
+ else {
403
+ console.log('\nProject initialized! Run `expxagents onboarding` to configure your profile.');
404
+ console.log('Use /expxagents in Claude Code to get started.');
405
+ }
387
406
  }
@@ -1,17 +1,26 @@
1
1
  import { spawn } from 'child_process';
2
2
  import path from 'path';
3
+ import { resolveServerPaths } from '../utils/server-paths.js';
3
4
  export async function serverCommand() {
4
- const cwd = process.cwd();
5
- const serverDir = path.join(cwd, 'server');
5
+ const { serverEntry, dashboardDist } = resolveServerPaths();
6
+ const userProjectDir = process.cwd();
7
+ const port = process.env.PORT ?? '3001';
6
8
  console.log('Starting ExpxAgents server...');
7
- const child = spawn('node', ['dist/index.js'], {
8
- cwd: serverDir,
9
+ const child = spawn('node', [serverEntry], {
10
+ cwd: userProjectDir,
9
11
  stdio: 'inherit',
10
- env: { ...process.env },
12
+ env: {
13
+ ...process.env,
14
+ NODE_ENV: 'production',
15
+ DASHBOARD_DIST: dashboardDist,
16
+ SQUADS_DIR: path.join(userProjectDir, 'squads'),
17
+ DOTENV_PATH: path.join(userProjectDir, '.env'),
18
+ PORT: port,
19
+ },
11
20
  });
12
21
  child.on('error', (err) => {
13
22
  console.error(`Failed to start server: ${err.message}`);
14
- console.error('Make sure you have built the server: cd server && npm run build');
23
+ console.error('Make sure you have the latest expxagents package installed.');
15
24
  process.exit(1);
16
25
  });
17
26
  child.on('exit', (code) => {
@@ -1,3 +1,4 @@
1
+ import fs from 'fs';
1
2
  import { Command } from 'commander';
2
3
  import { initCommand } from './commands/init.js';
3
4
  import { createCommand } from './commands/create.js';
@@ -12,11 +13,22 @@ import { onboardingCommand } from './commands/onboarding.js';
12
13
  import { virtualOfficeCommand } from './commands/virtual-office.js';
13
14
  import { jarvisCommand } from './commands/jarvis.js';
14
15
  import { schedulerCommand } from './commands/scheduler.js';
16
+ import { findPackageRoot } from './utils/config.js';
17
+ function getVersion() {
18
+ try {
19
+ const pkgPath = `${findPackageRoot()}/package.json`;
20
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
21
+ return pkg.version ?? '0.0.0';
22
+ }
23
+ catch {
24
+ return '0.0.0';
25
+ }
26
+ }
15
27
  const program = new Command();
16
28
  program
17
29
  .name('expxagents')
18
30
  .description('ExpxAgents — Multi-agent orchestration platform')
19
- .version('0.1.0');
31
+ .version(getVersion());
20
32
  program
21
33
  .command('init')
22
34
  .description('Initialize project (dirs, .env, admin user)')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expxagents",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Multi-agent orchestration platform for AI squads",
5
5
  "author": "ExpxAgents",
6
6
  "license": "MIT",