@openagents-org/agent-launcher 0.2.159 → 0.2.160

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/package.json +1 -1
  2. package/src/daemon.js +7 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagents-org/agent-launcher",
3
- "version": "0.2.159",
3
+ "version": "0.2.160",
4
4
  "description": "OpenAgents Launcher \u2014 install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/daemon.js CHANGED
@@ -120,9 +120,13 @@ class Daemon {
120
120
  try {
121
121
  if (action === 'create_agent') {
122
122
  const type = (args.type || '').trim();
123
- const createArgs = ['create', name, '--type', type, '--install'];
124
- if (args.workingDir) createArgs.push('--path', String(args.workingDir));
125
- const r1 = await this._runAgn(createArgs);
123
+ // Working directory: use the one the user picked, else a managed folder
124
+ // under the launcher home so every remote-created agent has a clean,
125
+ // predictable home without the user typing a path.
126
+ let workingDir = (args.workingDir || '').trim();
127
+ if (!workingDir) workingDir = path.join(os.homedir(), '.openagents', 'agents', name);
128
+ try { fs.mkdirSync(workingDir, { recursive: true }); } catch {}
129
+ const r1 = await this._runAgn(['create', name, '--type', type, '--install', '--path', workingDir]);
126
130
  if (r1.code !== 0) throw new Error(r1.stderr || r1.stdout || 'create failed');
127
131
  // Optional credentials for API-key agents (generic → provider mapping
128
132
  // happens in env resolution).