@ghl-ai/aw 0.1.36-beta.110 → 0.1.36-beta.111

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/git.mjs +14 -9
  2. package/package.json +1 -1
package/git.mjs CHANGED
@@ -311,21 +311,26 @@ export async function fetchAndMerge(awHome, { silent = true } = {}) {
311
311
  } catch { /* local commits exist — not a fast-forward */ }
312
312
 
313
313
  if (canFF) {
314
- // Skip reset if there are local staged/unstaged changes reset --hard
315
- // would wipe them. The user needs to push first; we'll sync on the next
316
- // pull after they do.
317
- let hasLocalChanges = false;
314
+ // Stash staged/unstaged changes to tracked files before reset --hard so
315
+ // they are not lost. Untracked files (e.g. newly created skills not yet
316
+ // staged) are untouched by reset --hard and need no stashing.
317
+ let stashed = false;
318
318
  try {
319
- const { stdout: statusOut } = await exec(`git -C "${awHome}" status --porcelain`);
320
- hasLocalChanges = statusOut.trim().length > 0;
321
- } catch { /* ignore */ }
322
-
323
- if (hasLocalChanges) return { updated: false, conflicts };
319
+ const { stdout } = await exec(`git -C "${awHome}" stash push -m "aw: pre-sync stash"`);
320
+ stashed = !stdout.includes('No local changes to save');
321
+ } catch { /* nothing to stash */ }
324
322
 
325
323
  const { stdout: headBefore } = await exec(`git -C "${awHome}" rev-parse HEAD`);
326
324
  await exec(`git -C "${awHome}" reset --hard origin/${REGISTRY_BASE_BRANCH}`);
327
325
  const { stdout: headAfter } = await exec(`git -C "${awHome}" rev-parse HEAD`);
328
326
  updated = headBefore.trim() !== headAfter.trim();
327
+
328
+ if (stashed) {
329
+ try {
330
+ await exec(`git -C "${awHome}" stash pop`);
331
+ } catch { /* conflict between stash and remote — leave markers for user */ }
332
+ }
333
+
329
334
  return { updated, conflicts };
330
335
  }
331
336
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.36-beta.110",
3
+ "version": "0.1.36-beta.111",
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",