@vectorize-io/self-driving-agents 0.0.3 → 0.0.4
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/cli.js +5 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -62,7 +62,7 @@ async function resolveAgentDir(input, spinner) {
|
|
|
62
62
|
const dir = resolve(input.replace(/^~/, homedir()));
|
|
63
63
|
if (!existsSync(dir))
|
|
64
64
|
throw new Error(`Directory not found: ${dir}`);
|
|
65
|
-
return { dir, source: dir };
|
|
65
|
+
return { dir, source: dir, defaultName: basename(dir) };
|
|
66
66
|
}
|
|
67
67
|
// Parse GitHub reference: "name" or "org/repo/path/to/agent"
|
|
68
68
|
const parts = input.split("/");
|
|
@@ -98,8 +98,9 @@ async function resolveAgentDir(input, spinner) {
|
|
|
98
98
|
throw new Error(`Path '${subpath}' not found in ${org}/${repo}`);
|
|
99
99
|
}
|
|
100
100
|
const source = `github.com/${org}/${repo}/${subpath}`;
|
|
101
|
+
const defaultName = subpath.replace(/\//g, "-");
|
|
101
102
|
spinner.stop(`Fetched ${color.cyan(source)}`);
|
|
102
|
-
return { dir, source, cleanup: () => rmSync(tmp, { recursive: true, force: true }) };
|
|
103
|
+
return { dir, source, defaultName, cleanup: () => rmSync(tmp, { recursive: true, force: true }) };
|
|
103
104
|
}
|
|
104
105
|
// ── Skill ───────────────────────────────────────────────
|
|
105
106
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
@@ -270,9 +271,9 @@ async function main() {
|
|
|
270
271
|
p.intro(color.bgCyan(color.black(` self-driving-agents `)));
|
|
271
272
|
// Step 0: Resolve agent directory (local or GitHub)
|
|
272
273
|
const spin = p.spinner();
|
|
273
|
-
const { dir, source, cleanup } = await resolveAgentDir(dirArg, spin);
|
|
274
|
+
const { dir, source, defaultName, cleanup } = await resolveAgentDir(dirArg, spin);
|
|
274
275
|
try {
|
|
275
|
-
const agentId = agentName ||
|
|
276
|
+
const agentId = agentName || defaultName;
|
|
276
277
|
// Step 1: Ensure plugin
|
|
277
278
|
if (harness === "openclaw") {
|
|
278
279
|
await ensurePlugin();
|