@ghl-ai/aw 0.1.36-beta.15 → 0.1.36-beta.16

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 +27 -14
  2. package/package.json +1 -1
package/commands/push.mjs CHANGED
@@ -56,25 +56,38 @@ function singular(type, count) {
56
56
  return count === 1 ? s : `${s}s`;
57
57
  }
58
58
 
59
- function extractNamespaceFromCommits(commits) {
60
- // Try to extract a common namespace from commit messages like
61
- // "registry: add agents/foo to revex/courses/backend"
62
- const matches = commits
63
- .map(c => c.message.match(/\bto\s+([\w/]+)$/))
64
- .filter(Boolean)
65
- .map(m => m[1]);
66
- if (matches.length === 0) return null;
67
- const unique = [...new Set(matches)];
68
- return unique.length === 1 ? unique[0] : null;
59
+ // Parse commit messages like "registry: add agents/new-dev to revex/courses/backend"
60
+ // into structured { verb, type, slug, namespace } objects.
61
+ function parseCommitFiles(commits) {
62
+ const result = [];
63
+ for (const c of commits) {
64
+ const m = c.message.match(/registry:\s+(add|remove|sync)\s+(agents|skills|commands|evals)\/([\w-]+)\s+(?:to|from)\s+([\w/]+)/);
65
+ if (m) result.push({ verb: m[1], type: m[2], slug: m[3], namespace: m[4] });
66
+ }
67
+ return result;
69
68
  }
70
69
 
71
70
  function generatePrTitle(files, awHome = null) {
72
71
  if (files.length === 0) {
73
72
  const commits = awHome ? logAheadOfMain(awHome) : [];
74
- const ns = extractNamespaceFromCommits(commits);
75
- return ns
76
- ? `feat(${ns}): push local changes`
77
- : 'feat(registry): push local changes';
73
+ const parsed = parseCommitFiles(commits);
74
+
75
+ if (parsed.length === 0) return 'feat(registry): push local changes';
76
+
77
+ const namespaces = [...new Set(parsed.map(p => p.namespace))];
78
+ const ns = namespaces.length === 1 ? namespaces[0] : 'registry';
79
+
80
+ if (parsed.length === 1) {
81
+ const p = parsed[0];
82
+ const verb = p.verb === 'remove' ? 'remove' : 'update';
83
+ return `feat(${ns}): ${verb} ${p.slug} ${TYPE_SINGULAR[p.type] ?? p.type}`;
84
+ }
85
+
86
+ const byType = groupBy(parsed, 'type');
87
+ const summary = Object.entries(byType)
88
+ .map(([t, items]) => `${items.length} ${singular(t, items.length)}`)
89
+ .join(', ');
90
+ return `feat(${ns}): sync ${summary}`;
78
91
  }
79
92
 
80
93
  const namespaces = [...new Set(files.map(f => f.namespace))];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.36-beta.15",
3
+ "version": "0.1.36-beta.16",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": {