feat(FN-1189): add Agent Companies import support

- Expand fn agent import to accept directories, .tar.gz/.tgz/.zip archives, single .md manifests, and legacy .sh manifests
- Update /api/agents/import to handle agents array, source path, or manifest string inputs with dry-run previews and legacy fallback parsing
- Refresh AgentImportModal and dashboard API typing for new preview metadata, directory uploads, and improved error handling
- Add coverage for CLI import paths, dashboard import routes, modal behavior, and assignment route timeout stability
- Add a minor @gsxdsm/fusion changeset documenting Agent Companies import support
This commit is contained in:
gsxdsm
2026-04-08 07:13:25 -07:00
parent 44d0b400d4
commit c1ccf92016
10 changed files with 803 additions and 277 deletions

View File

@@ -123,8 +123,8 @@ Usage:
fn git fetch [remote] Fetch from remote (default: origin)
fn agent stop <id> Stop a running agent (pause execution)
fn agent start <id> Start a stopped agent (resume execution)
fn agent import <file> [--dry-run] [--skip-existing]
Import agents from a companies.sh manifest
fn agent import <path> [--dry-run] [--skip-existing]
Import agents from an Agent Companies package (directory, archive, or .md file)
fn agent mailbox <id> View an agent's mailbox
fn message inbox List inbox messages
fn message outbox List sent messages
@@ -848,7 +848,7 @@ async function main() {
}
case "import": {
const source = args[2];
if (!source) { console.error("Usage: fn agent import <file> [--dry-run] [--skip-existing]"); process.exit(1); }
if (!source) { console.error("Usage: fn agent import <path> [--dry-run] [--skip-existing]"); process.exit(1); }
const importArgs = args.slice(3);
const dryRun = importArgs.includes("--dry-run");
const skipExisting = importArgs.includes("--skip-existing");
@@ -857,7 +857,7 @@ async function main() {
}
default:
console.error(`Unknown subcommand: agent ${subcommand || ""}`);
console.log("Try: fn agent stop <id> | fn agent start <id> | fn agent mailbox <id> | fn agent import <file>");
console.log("Try: fn agent stop <id> | fn agent start <id> | fn agent mailbox <id> | fn agent import <path>");
process.exit(1);
}
break;