@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.
- package/package.json +1 -1
- package/src/daemon.js +7 -3
package/package.json
CHANGED
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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).
|