@agentforge/cli 0.11.3 → 0.11.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/index.js CHANGED
@@ -359,6 +359,17 @@ function getRunCommand(packageManager, script) {
359
359
  };
360
360
  return commands[packageManager];
361
361
  }
362
+ async function publishPackage(cwd, options = {}) {
363
+ const { tag = "latest", access = "public", dryRun = false } = options;
364
+ const args = ["publish", "--access", access, "--tag", tag];
365
+ if (dryRun) {
366
+ args.push("--dry-run");
367
+ }
368
+ await execa("npm", args, {
369
+ cwd,
370
+ stdio: "inherit"
371
+ });
372
+ }
362
373
  async function isGitInstalled() {
363
374
  try {
364
375
  await execa("git", ["--version"]);
@@ -936,27 +947,34 @@ async function agentDeployCommand(name, options) {
936
947
  logger.header("\u{1F680} Deploy Agent");
937
948
  logger.info(`Agent: ${chalk4.cyan(name)}`);
938
949
  logger.info(`Environment: ${chalk4.cyan(options.environment || "production")}`);
939
- logger.info(`Dry run: ${options.dryRun ? "Yes" : "No"}`);
940
950
  logger.newLine();
941
- if (options.dryRun) {
942
- logger.warn("Dry run mode - no actual deployment will occur");
943
- logger.newLine();
944
- }
945
- logger.startSpinner("Preparing deployment...");
946
- await new Promise((resolve) => setTimeout(resolve, 1e3));
947
- logger.succeedSpinner("Deployment prepared");
948
- if (!options.dryRun) {
949
- logger.startSpinner("Deploying agent...");
950
- await new Promise((resolve) => setTimeout(resolve, 2e3));
951
- logger.succeedSpinner("Agent deployed successfully");
952
- }
951
+ logger.error("Automated agent deployment is not yet implemented");
952
+ logger.newLine();
953
+ logger.info(chalk4.bold("Please use one of the following deployment methods:"));
954
+ logger.newLine();
955
+ logger.info(chalk4.cyan("1. Docker Deployment:"));
956
+ logger.info(" See templates/deployment/docker/ for Dockerfile and docker-compose.yml");
957
+ logger.info(" Run: docker build -t my-agent . && docker run my-agent");
958
+ logger.newLine();
959
+ logger.info(chalk4.cyan("2. Kubernetes Deployment:"));
960
+ logger.info(" See templates/deployment/kubernetes/ for manifests");
961
+ logger.info(" Run: kubectl apply -f templates/deployment/kubernetes/");
962
+ logger.newLine();
963
+ logger.info(chalk4.cyan("3. Serverless Deployment:"));
964
+ logger.info(" See docs/guide/advanced/deployment.md for platform-specific guides");
965
+ logger.info(" - AWS Lambda: Use SAM or Serverless Framework");
966
+ logger.info(" - Vercel: Use vercel deploy");
967
+ logger.info(" - Google Cloud Run: Use gcloud run deploy");
953
968
  logger.newLine();
954
- logger.success(chalk4.bold.green("\u2728 Deployment completed!"));
969
+ logger.info(chalk4.cyan("4. Manual Deployment:"));
970
+ logger.info(" 1. Build: npm run build");
971
+ logger.info(" 2. Test: npm test");
972
+ logger.info(" 3. Deploy to your platform of choice");
955
973
  logger.newLine();
956
- logger.info("Note: Actual deployment implementation coming soon");
957
- logger.info("For now, please use the deployment templates in the templates/deployment directory");
974
+ logger.info(chalk4.dim("For detailed deployment guides, see:"));
975
+ logger.info(chalk4.dim("https://tvscoundrel.github.io/agentforge/guide/advanced/deployment"));
976
+ process.exit(1);
958
977
  } catch (error) {
959
- logger.failSpinner("Deployment failed");
960
978
  logger.error(error.message);
961
979
  process.exit(1);
962
980
  }
@@ -1214,16 +1232,45 @@ async function toolPublishCommand(name, options) {
1214
1232
  logger.failSpinner("Build failed");
1215
1233
  process.exit(1);
1216
1234
  }
1217
- if (!options.dryRun) {
1218
- logger.startSpinner("Publishing to npm...");
1219
- await new Promise((resolve) => setTimeout(resolve, 2e3));
1220
- logger.succeedSpinner("Published to npm");
1235
+ logger.startSpinner(options.dryRun ? "Running dry-run publish..." : "Publishing to npm...");
1236
+ try {
1237
+ await publishPackage(cwd, {
1238
+ tag: options.tag,
1239
+ access: "public",
1240
+ dryRun: options.dryRun
1241
+ });
1242
+ if (options.dryRun) {
1243
+ logger.succeedSpinner("Dry-run completed - no actual publishing occurred");
1244
+ } else {
1245
+ logger.succeedSpinner("Published to npm");
1246
+ }
1247
+ } catch (error) {
1248
+ logger.failSpinner("Publishing failed");
1249
+ if (error.message.includes("ENEEDAUTH") || error.message.includes("E401")) {
1250
+ logger.error("Not authenticated with npm");
1251
+ logger.info("Run: npm login");
1252
+ } else if (error.message.includes("E403")) {
1253
+ logger.error("Permission denied - you may not have access to publish this package");
1254
+ logger.info("Check package name and npm organization permissions");
1255
+ } else if (error.message.includes("EPUBLISHCONFLICT") || error.message.includes("E409")) {
1256
+ logger.error("Version already published");
1257
+ logger.info("Update the version in package.json before publishing");
1258
+ } else {
1259
+ logger.error(error.message);
1260
+ }
1261
+ process.exit(1);
1221
1262
  }
1222
1263
  logger.newLine();
1223
- logger.success(chalk4.bold.green("\u2728 Tool published successfully!"));
1224
- logger.newLine();
1225
- logger.info("Note: Actual npm publishing implementation coming soon");
1226
- logger.info("For now, please use npm publish manually");
1264
+ if (options.dryRun) {
1265
+ logger.success(chalk4.bold.green("\u2728 Dry-run completed successfully!"));
1266
+ logger.newLine();
1267
+ logger.info("No changes were made. Remove --dry-run to publish for real.");
1268
+ } else {
1269
+ logger.success(chalk4.bold.green("\u2728 Tool published successfully!"));
1270
+ logger.newLine();
1271
+ logger.info(`Published ${chalk4.cyan(name)} with tag ${chalk4.cyan(options.tag || "latest")}`);
1272
+ logger.info("Users can now install with: npm install " + name);
1273
+ }
1227
1274
  } catch (error) {
1228
1275
  logger.failSpinner("Publishing failed");
1229
1276
  logger.error(error.message);