@agentforge/cli 0.11.3 → 0.11.5
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.cjs +72 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +72 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/api/package.json +2 -2
- package/templates/cli/package.json +2 -2
- package/templates/full/package.json +2 -2
- package/templates/minimal/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -370,6 +370,17 @@ function getRunCommand(packageManager, script) {
|
|
|
370
370
|
};
|
|
371
371
|
return commands[packageManager];
|
|
372
372
|
}
|
|
373
|
+
async function publishPackage(cwd, options = {}) {
|
|
374
|
+
const { tag = "latest", access = "public", dryRun = false } = options;
|
|
375
|
+
const args = ["publish", "--access", access, "--tag", tag];
|
|
376
|
+
if (dryRun) {
|
|
377
|
+
args.push("--dry-run");
|
|
378
|
+
}
|
|
379
|
+
await execa.execa("npm", args, {
|
|
380
|
+
cwd,
|
|
381
|
+
stdio: "inherit"
|
|
382
|
+
});
|
|
383
|
+
}
|
|
373
384
|
async function isGitInstalled() {
|
|
374
385
|
try {
|
|
375
386
|
await execa.execa("git", ["--version"]);
|
|
@@ -947,27 +958,34 @@ async function agentDeployCommand(name, options) {
|
|
|
947
958
|
logger.header("\u{1F680} Deploy Agent");
|
|
948
959
|
logger.info(`Agent: ${chalk4__default.default.cyan(name)}`);
|
|
949
960
|
logger.info(`Environment: ${chalk4__default.default.cyan(options.environment || "production")}`);
|
|
950
|
-
logger.info(`Dry run: ${options.dryRun ? "Yes" : "No"}`);
|
|
951
961
|
logger.newLine();
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
logger.
|
|
957
|
-
|
|
958
|
-
logger.
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
962
|
+
logger.error("Automated agent deployment is not yet implemented");
|
|
963
|
+
logger.newLine();
|
|
964
|
+
logger.info(chalk4__default.default.bold("Please use one of the following deployment methods:"));
|
|
965
|
+
logger.newLine();
|
|
966
|
+
logger.info(chalk4__default.default.cyan("1. Docker Deployment:"));
|
|
967
|
+
logger.info(" See templates/deployment/docker/ for Dockerfile and docker-compose.yml");
|
|
968
|
+
logger.info(" Run: docker build -t my-agent . && docker run my-agent");
|
|
969
|
+
logger.newLine();
|
|
970
|
+
logger.info(chalk4__default.default.cyan("2. Kubernetes Deployment:"));
|
|
971
|
+
logger.info(" See templates/deployment/kubernetes/ for manifests");
|
|
972
|
+
logger.info(" Run: kubectl apply -f templates/deployment/kubernetes/");
|
|
973
|
+
logger.newLine();
|
|
974
|
+
logger.info(chalk4__default.default.cyan("3. Serverless Deployment:"));
|
|
975
|
+
logger.info(" See docs/guide/advanced/deployment.md for platform-specific guides");
|
|
976
|
+
logger.info(" - AWS Lambda: Use SAM or Serverless Framework");
|
|
977
|
+
logger.info(" - Vercel: Use vercel deploy");
|
|
978
|
+
logger.info(" - Google Cloud Run: Use gcloud run deploy");
|
|
964
979
|
logger.newLine();
|
|
965
|
-
logger.
|
|
980
|
+
logger.info(chalk4__default.default.cyan("4. Manual Deployment:"));
|
|
981
|
+
logger.info(" 1. Build: npm run build");
|
|
982
|
+
logger.info(" 2. Test: npm test");
|
|
983
|
+
logger.info(" 3. Deploy to your platform of choice");
|
|
966
984
|
logger.newLine();
|
|
967
|
-
logger.info("
|
|
968
|
-
logger.info("
|
|
985
|
+
logger.info(chalk4__default.default.dim("For detailed deployment guides, see:"));
|
|
986
|
+
logger.info(chalk4__default.default.dim("https://tvscoundrel.github.io/agentforge/guide/advanced/deployment"));
|
|
987
|
+
process.exit(1);
|
|
969
988
|
} catch (error) {
|
|
970
|
-
logger.failSpinner("Deployment failed");
|
|
971
989
|
logger.error(error.message);
|
|
972
990
|
process.exit(1);
|
|
973
991
|
}
|
|
@@ -1225,16 +1243,45 @@ async function toolPublishCommand(name, options) {
|
|
|
1225
1243
|
logger.failSpinner("Build failed");
|
|
1226
1244
|
process.exit(1);
|
|
1227
1245
|
}
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
await
|
|
1231
|
-
|
|
1246
|
+
logger.startSpinner(options.dryRun ? "Running dry-run publish..." : "Publishing to npm...");
|
|
1247
|
+
try {
|
|
1248
|
+
await publishPackage(cwd, {
|
|
1249
|
+
tag: options.tag,
|
|
1250
|
+
access: "public",
|
|
1251
|
+
dryRun: options.dryRun
|
|
1252
|
+
});
|
|
1253
|
+
if (options.dryRun) {
|
|
1254
|
+
logger.succeedSpinner("Dry-run completed - no actual publishing occurred");
|
|
1255
|
+
} else {
|
|
1256
|
+
logger.succeedSpinner("Published to npm");
|
|
1257
|
+
}
|
|
1258
|
+
} catch (error) {
|
|
1259
|
+
logger.failSpinner("Publishing failed");
|
|
1260
|
+
if (error.message.includes("ENEEDAUTH") || error.message.includes("E401")) {
|
|
1261
|
+
logger.error("Not authenticated with npm");
|
|
1262
|
+
logger.info("Run: npm login");
|
|
1263
|
+
} else if (error.message.includes("E403")) {
|
|
1264
|
+
logger.error("Permission denied - you may not have access to publish this package");
|
|
1265
|
+
logger.info("Check package name and npm organization permissions");
|
|
1266
|
+
} else if (error.message.includes("EPUBLISHCONFLICT") || error.message.includes("E409")) {
|
|
1267
|
+
logger.error("Version already published");
|
|
1268
|
+
logger.info("Update the version in package.json before publishing");
|
|
1269
|
+
} else {
|
|
1270
|
+
logger.error(error.message);
|
|
1271
|
+
}
|
|
1272
|
+
process.exit(1);
|
|
1232
1273
|
}
|
|
1233
1274
|
logger.newLine();
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1275
|
+
if (options.dryRun) {
|
|
1276
|
+
logger.success(chalk4__default.default.bold.green("\u2728 Dry-run completed successfully!"));
|
|
1277
|
+
logger.newLine();
|
|
1278
|
+
logger.info("No changes were made. Remove --dry-run to publish for real.");
|
|
1279
|
+
} else {
|
|
1280
|
+
logger.success(chalk4__default.default.bold.green("\u2728 Tool published successfully!"));
|
|
1281
|
+
logger.newLine();
|
|
1282
|
+
logger.info(`Published ${chalk4__default.default.cyan(name)} with tag ${chalk4__default.default.cyan(options.tag || "latest")}`);
|
|
1283
|
+
logger.info("Users can now install with: npm install " + name);
|
|
1284
|
+
}
|
|
1238
1285
|
} catch (error) {
|
|
1239
1286
|
logger.failSpinner("Publishing failed");
|
|
1240
1287
|
logger.error(error.message);
|