gitdone-agent 0.6.10 → 0.6.11

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/index.js +13 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -27,7 +27,7 @@ import { randomUUID } from 'node:crypto'
27
27
  // Reported to the server on every sync so the web UI can flag outdated agents.
28
28
  // Keep in lockstep with packages/agent/package.json "version" AND
29
29
  // src/lib/agentVersion.ts LATEST_AGENT_VERSION.
30
- const AGENT_VERSION = '0.6.10'
30
+ const AGENT_VERSION = '0.6.11'
31
31
 
32
32
  const AGENT_DIR = join(homedir(), '.gitdone-agent')
33
33
  const CONFIG_PATH = join(AGENT_DIR, 'config.json')
@@ -231,9 +231,15 @@ function runDoctor() {
231
231
 
232
232
  // ─── Git helpers ─────────────────────────────────────────────────────────────
233
233
 
234
+ // Room for large command output. `git status --porcelain -uall` (gd-369) lists
235
+ // every untracked file individually, so a repo with a big new/untracked tree can
236
+ // blow past execSync's default 1 MB buffer — which would throw and silently
237
+ // return '' (an EMPTY snapshot, worse than the collapsed view). 64 MB is plenty.
238
+ const GIT_MAX_BUFFER = 64 * 1024 * 1024
239
+
234
240
  function git(cmd, cwd) {
235
241
  try {
236
- return execSync(cmd, { cwd, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim()
242
+ return execSync(cmd, { cwd, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'], maxBuffer: GIT_MAX_BUFFER }).trim()
237
243
  } catch {
238
244
  return ''
239
245
  }
@@ -245,7 +251,7 @@ function git(cmd, cwd) {
245
251
  // (gd-276). Callers decode per-file via decodeDiffText().
246
252
  function gitRaw(cmd, cwd) {
247
253
  try {
248
- return execSync(cmd, { cwd, encoding: 'buffer', stdio: ['pipe', 'pipe', 'pipe'] })
254
+ return execSync(cmd, { cwd, encoding: 'buffer', stdio: ['pipe', 'pipe', 'pipe'], maxBuffer: GIT_MAX_BUFFER })
249
255
  } catch {
250
256
  return Buffer.alloc(0)
251
257
  }
@@ -461,7 +467,10 @@ function parseDiffByFile(diffBuf) {
461
467
  function getSnapshot(repoPath) {
462
468
  const branch = git('git branch --show-current', repoPath) || 'HEAD'
463
469
 
464
- const statusLines = git('git status --porcelain', repoPath).split('\n').filter(Boolean)
470
+ // -uall lists every untracked file individually instead of collapsing a new
471
+ // directory into a single `dir/` entry — so the change list matches what
472
+ // GitHub Desktop shows, file-for-file (gd-369).
473
+ const statusLines = git('git status --porcelain -uall', repoPath).split('\n').filter(Boolean)
465
474
  const modified = []
466
475
  const staged = []
467
476
  const statuses = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitdone-agent",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "Local git agent for gitdone — watches a local repo and sends snapshots to gitdone.eu",
5
5
  "type": "module",
6
6
  "bin": {