shraga 0.1.46 → 0.1.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shraga",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "The teammate you delegate coding to — a self-hostable, multi-user AI coding agent web UI (Claude Code, with a pluggable engine seam).",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -107,8 +107,8 @@ export class DataSync {
107
107
  }
108
108
  this.ensureGitignore();
109
109
  if (!this.verifyDeploymentId()) return;
110
+ await this.configureGit(); // must precede untrackIgnored — it neutralises per-user excludes
110
111
  await this.untrackIgnored();
111
- await this.configureGit();
112
112
  this.ready = true;
113
113
  }
114
114
 
@@ -624,7 +624,13 @@ export class DataSync {
624
624
  /** Commit a refreshed .gitignore and untrack any committed files that now match it. */
625
625
  private async untrackIgnored(): Promise<void> {
626
626
  await this.git('add', '.gitignore').catch(() => {});
627
- const out = await this.git('ls-files', '-i', '-c', '--exclude-standard').catch(() => '');
627
+ // core.excludesFile=/dev/null: --exclude-standard would otherwise fold in the USER'S global
628
+ // gitignore (~/.gitignore_global) and untrack files that are ignored on this host only. The
629
+ // data repo is shared, so a personal rule must never decide what leaves the remote. Real
630
+ // near-miss 2026-08-20: a laptop's global `.agent/` rule staged 50 files for deletion —
631
+ // including workspace/.agent/memory/MEMORY.md, the agent's own memory — and only
632
+ // guardMassDeletions() stopped it. Only the repo's OWN .gitignore may untrack anything.
633
+ const out = await this.git('-c', 'core.excludesFile=/dev/null', 'ls-files', '-i', '-c', '--exclude-standard').catch(() => '');
628
634
  // Only untrack files that actually exist on disk AND match .gitignore.
629
635
  // git ls-files -i can falsely report tracked files missing from the worktree
630
636
  // (remote-only files restored during init). Removing those wipes remote data.
@@ -673,6 +679,8 @@ export class DataSync {
673
679
  const name = process.env.APP_NAME || 'shraga';
674
680
  await this.git('config', 'user.name', `${name} agent`).catch(() => {});
675
681
  await this.git('config', 'user.email', `agent@${name}.local`).catch(() => {});
682
+ // The data repo must behave identically on every host: no per-user global gitignore.
683
+ await this.git('config', 'core.excludesFile', '/dev/null').catch(() => {});
676
684
  }
677
685
 
678
686
  private authedUrl(): string {