picocode-core 0.9.132 → 0.9.133

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/package.json +1 -1
  2. package/src/git.js +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picocode-core",
3
- "version": "0.9.132",
3
+ "version": "0.9.133",
4
4
  "description": "The agent runtime behind pico: sessions, tools, subagents, MCP, memory, and model access",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/git.js CHANGED
@@ -3,7 +3,7 @@ import { readFileSync, statSync, watch } from 'node:fs'
3
3
  import { dirname, isAbsolute, join, resolve } from 'node:path'
4
4
 
5
5
  const DEBOUNCE_MS = 500
6
- const POLL_MS = 15000
6
+ const POLL_MS = 5000
7
7
  const GIT_TIMEOUT_MS = 5000
8
8
 
9
9
  function findGitDir(startDir) {
@@ -107,7 +107,9 @@ export function createGitService({ onChange = () => {} } = {}) {
107
107
  }
108
108
  const started = epoch
109
109
  const branch = readBranch(gitDir)
110
- const proc = spawn('git', ['--no-optional-locks', 'diff', 'HEAD', '--shortstat'], {
110
+ // one shell round trip: the tracked diff stat, then a marker, then the
111
+ // porcelain status so untracked files count too
112
+ const proc = spawn('sh', ['-c', 'git --no-optional-locks diff HEAD --shortstat; echo __status__; git --no-optional-locks status --porcelain --untracked-files=all'], {
111
113
  cwd: root,
112
114
  stdio: ['ignore', 'pipe', 'ignore'],
113
115
  })
@@ -125,8 +127,10 @@ export function createGitService({ onChange = () => {} } = {}) {
125
127
  clearTimeout(timeout)
126
128
  if (child === proc) child = null
127
129
  if (epoch !== started) return
128
- const stats = code === 0 ? parseShortstat(output) : { added: 0, removed: 0 }
129
- const next = branch ? { branch, ...stats } : null
130
+ const [diff = '', status = ''] = output.split('__status__')
131
+ const stats = code === 0 ? parseShortstat(diff) : { added: 0, removed: 0 }
132
+ const untracked = code === 0 ? status.split('\n').filter((line) => line.startsWith('??')).length : 0
133
+ const next = branch ? { branch, ...stats, untracked } : null
130
134
  if (JSON.stringify(next) !== JSON.stringify(current)) {
131
135
  current = next
132
136
  onChange()