@ghl-ai/aw 0.1.36-beta.81 → 0.1.36-beta.83

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.
Files changed (2) hide show
  1. package/commands/push.mjs +39 -2
  2. package/package.json +1 -1
package/commands/push.mjs CHANGED
@@ -565,11 +565,28 @@ export async function pushCommand(args) {
565
565
  ? absPath.slice(workspaceDir.length + 1)
566
566
  : resolved.registryPath;
567
567
  const registryAbsPath = join(registrySubDir, relFromRegistry);
568
- const files = collectBatchFiles(registryAbsPath, registrySubDir);
569
- if (files.length === 0) {
568
+ const allFiles = collectBatchFiles(registryAbsPath, registrySubDir);
569
+ if (allFiles.length === 0) {
570
570
  fmt.cancel(`Nothing to push in ${chalk.cyan(input)} — no agents, skills, commands, or evals found.`);
571
571
  return;
572
572
  }
573
+ // Only include files that actually have changes (new or modified)
574
+ const folderChanges = detectChanges(awHome, REGISTRY_DIR);
575
+ const changedPaths = new Set([
576
+ ...folderChanges.modified.map(e => e.path),
577
+ ...folderChanges.untracked.map(e => e.path),
578
+ ...folderChanges.deleted.map(e => e.path),
579
+ ]);
580
+ const files = allFiles.filter(f => changedPaths.has(f.registryTarget));
581
+ if (files.length === 0) {
582
+ if (commitsAheadOfMain(awHome) > 0) {
583
+ fmt.logInfo(`${chalk.dim('mode:')} selected folder (no new changes — branching current state)`);
584
+ await doPush([], awHome, dryRun, worktreeFlow);
585
+ return;
586
+ }
587
+ fmt.cancel(`Nothing to push in ${chalk.cyan(input)} — no changes found.\n\n Files in this folder are already up to date in the registry.\n Edit a file first, then push.`);
588
+ return;
589
+ }
573
590
  await doPush(files, awHome, dryRun, worktreeFlow);
574
591
  return;
575
592
  }
@@ -604,6 +621,26 @@ export async function pushCommand(args) {
604
621
  ? `${REGISTRY_DIR}/${namespacePath}/${parentDir}/${slug}`
605
622
  : `${REGISTRY_DIR}/${namespacePath}/${parentDir}/${slug}.md`;
606
623
 
624
+ // Check if the file actually has changes before trying to commit
625
+ const singleFileChanges = detectChanges(awHome, REGISTRY_DIR);
626
+ const singleChangedPaths = new Set([
627
+ ...singleFileChanges.modified.map(e => e.path),
628
+ ...singleFileChanges.untracked.map(e => e.path),
629
+ ...singleFileChanges.deleted.map(e => e.path),
630
+ ]);
631
+ // Match with or without .md suffix (handles both tracked and untracked filenames)
632
+ const hasChanges = singleChangedPaths.has(registryTarget) ||
633
+ singleChangedPaths.has(registryTarget.replace(/\.md$/, ''));
634
+ if (!hasChanges) {
635
+ if (commitsAheadOfMain(awHome) > 0) {
636
+ fmt.logInfo(`${chalk.dim('mode:')} selected file (no changes — branching current state)`);
637
+ await doPush([], awHome, dryRun, worktreeFlow);
638
+ return;
639
+ }
640
+ fmt.cancel(`Nothing to push — ${chalk.cyan(input)} has no changes.\n\n The file is already up to date in the registry.\n Edit the file first, then push.`);
641
+ return;
642
+ }
643
+
607
644
  await doPush([{
608
645
  absPath,
609
646
  registryTarget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.36-beta.81",
3
+ "version": "0.1.36-beta.83",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": "bin.js",