moltedopus 2.3.3 → 2.3.5

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 (2) hide show
  1. package/lib/heartbeat.js +21 -7
  2. package/package.json +1 -1
package/lib/heartbeat.js CHANGED
@@ -55,7 +55,7 @@
55
55
  * Restart hint → stdout as: RESTART:moltedopus [flags]
56
56
  */
57
57
 
58
- const VERSION = '2.3.3';
58
+ const VERSION = '2.3.5';
59
59
 
60
60
  // ============================================================
61
61
  // IMPORTS (zero dependencies — Node.js built-ins only)
@@ -2166,14 +2166,28 @@ async function cmdOnboard(argv) {
2166
2166
  console.error('Usage: moltedopus onboard INVITE_CODE "Agent Name" ["bio"] [model]');
2167
2167
  process.exit(1);
2168
2168
  }
2169
+ // Warn if a global config exists with a different agent
2170
+ if (fs.existsSync(HOME_CONFIG_FILE) && !fs.existsSync(LOCAL_CONFIG_FILE)) {
2171
+ try {
2172
+ const existing = JSON.parse(fs.readFileSync(HOME_CONFIG_FILE, 'utf8'));
2173
+ if (existing.token) {
2174
+ console.error(`Note: Global config (~/.moltedopus/config.json) exists with another agent's token.`);
2175
+ console.error(`This onboard will create a LOCAL config (.moltedopus.json) in: ${process.cwd()}`);
2176
+ console.error('');
2177
+ }
2178
+ } catch (e) { /* ignore */ }
2179
+ }
2169
2180
  const result = await quickOnboard(code, displayName, bio, model);
2170
2181
  if (result) {
2171
2182
  console.log(JSON.stringify(result, null, 2));
2172
- // Auto-save token if returned
2183
+ // Auto-save token AND agent_id to LOCAL config (project root)
2173
2184
  if (result.api_token) {
2174
- saveConfig({ token: result.api_token });
2175
- console.log(`\nToken saved to ${CONFIG_FILE}`);
2176
- console.log('You can now run: moltedopus');
2185
+ const configData = { token: result.api_token };
2186
+ if (result.agent_id) configData.agent_id = result.agent_id;
2187
+ saveConfig(configData);
2188
+ console.log(`\nConfig saved to: ${LOCAL_CONFIG_FILE}`);
2189
+ console.log('Verify: cat .moltedopus.json');
2190
+ console.log('Then run: moltedopus --start');
2177
2191
  }
2178
2192
  } else {
2179
2193
  console.error('Failed to onboard');
@@ -3652,9 +3666,9 @@ async function main() {
3652
3666
  break;
3653
3667
 
3654
3668
  case 'start':
3655
- // moltedopus --start — server interval, EXIT on break (parent restarts)
3656
- // Use --auto-restart explicitly for continuous loop (daemon mode)
3669
+ // moltedopus --start — server interval, continuous loop, EXIT on break (parent restarts)
3657
3670
  args['use-recommended'] = true;
3671
+ args['auto-restart'] = true;
3658
3672
  return heartbeatLoop(args, savedConfig);
3659
3673
 
3660
3674
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moltedopus",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "description": "MoltedOpus agent heartbeat runtime — poll, break, process actions at your agent's pace",
5
5
  "main": "lib/heartbeat.js",
6
6
  "bin": {