aicodeman 1.34.0 → 1.35.0
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/README.md +3 -0
- package/dist/config/dependency-registry.d.ts +7 -0
- package/dist/config/dependency-registry.d.ts.map +1 -1
- package/dist/config/dependency-registry.js +15 -0
- package/dist/config/dependency-registry.js.map +1 -1
- package/dist/config/path-probe.d.ts +37 -0
- package/dist/config/path-probe.d.ts.map +1 -0
- package/dist/config/path-probe.js +43 -0
- package/dist/config/path-probe.js.map +1 -0
- package/dist/git-workspace-status.d.ts +220 -0
- package/dist/git-workspace-status.d.ts.map +1 -0
- package/dist/git-workspace-status.js +606 -0
- package/dist/git-workspace-status.js.map +1 -0
- package/dist/hooks-config.d.ts.map +1 -1
- package/dist/hooks-config.js +83 -13
- package/dist/hooks-config.js.map +1 -1
- package/dist/types/api.d.ts +7 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/api.js.map +1 -1
- package/dist/utils/bounded-path-probe.d.ts +99 -0
- package/dist/utils/bounded-path-probe.d.ts.map +1 -0
- package/dist/utils/bounded-path-probe.js +228 -0
- package/dist/utils/bounded-path-probe.js.map +1 -0
- package/dist/utils/cli-executable-resolver.d.ts +2 -0
- package/dist/utils/cli-executable-resolver.d.ts.map +1 -1
- package/dist/utils/cli-executable-resolver.js +2 -1
- package/dist/utils/cli-executable-resolver.js.map +1 -1
- package/dist/utils/dependency-checker.d.ts +2 -0
- package/dist/utils/dependency-checker.d.ts.map +1 -1
- package/dist/utils/dependency-checker.js +37 -9
- package/dist/utils/dependency-checker.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/web/case-path.d.ts +58 -0
- package/dist/web/case-path.d.ts.map +1 -0
- package/dist/web/case-path.js +182 -0
- package/dist/web/case-path.js.map +1 -0
- package/dist/web/public/admin-ui.js.gz +0 -0
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/app.b9516c7b.js +43 -0
- package/dist/web/public/app.b9516c7b.js.br +0 -0
- package/dist/web/public/app.b9516c7b.js.gz +0 -0
- package/dist/web/public/approvals-ui.js.gz +0 -0
- package/dist/web/public/constants.d95fade9.js.gz +0 -0
- package/dist/web/public/cron-ui.js.gz +0 -0
- package/dist/web/public/entrance-animations.js.gz +0 -0
- package/dist/web/public/git-status-ui.js +673 -0
- package/dist/web/public/git-status-ui.js.br +0 -0
- package/dist/web/public/git-status-ui.js.gz +0 -0
- package/dist/web/public/home-sessions.js.gz +0 -0
- package/dist/web/public/host-wake-ui.js.gz +0 -0
- package/dist/web/public/i18n.52f5b7cc.js +1 -0
- package/dist/web/public/i18n.52f5b7cc.js.br +0 -0
- package/dist/web/public/i18n.52f5b7cc.js.gz +0 -0
- package/dist/web/public/image-input.a216cf9e.js.gz +0 -0
- package/dist/web/public/index.html +79 -12
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.8bc46081.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.c1e7c7b7.js.gz +0 -0
- package/dist/web/public/mobile-handlers.23a85db1.js.gz +0 -0
- package/dist/web/public/mobile-ime-preview.2dbaf262.js.gz +0 -0
- package/dist/web/public/mobile-overview.js.gz +0 -0
- package/dist/web/public/mobile.1aa4952d.css.gz +0 -0
- package/dist/web/public/notification-manager.50bb87d8.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/panels-ui.6a5898d9.js.gz +0 -0
- package/dist/web/public/ralph-panel.b350e2ef.js.gz +0 -0
- package/dist/web/public/ralph-wizard.b6c0dd19.js.gz +0 -0
- package/dist/web/public/readmymind-ui.js.gz +0 -0
- package/dist/web/public/reboot-restore-ui.js.gz +0 -0
- package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
- package/dist/web/public/sanitize-html.e7147e76.js.gz +0 -0
- package/dist/web/public/session-lineage.js.gz +0 -0
- package/dist/web/public/session-ui.6bddf916.js +89 -0
- package/dist/web/public/session-ui.6bddf916.js.br +0 -0
- package/dist/web/public/session-ui.6bddf916.js.gz +0 -0
- package/dist/web/public/settings-ui.6e798b7b.js +97 -0
- package/dist/web/public/settings-ui.6e798b7b.js.br +0 -0
- package/dist/web/public/settings-ui.6e798b7b.js.gz +0 -0
- package/dist/web/public/styles.2d175c60.css +1 -0
- package/dist/web/public/styles.2d175c60.css.br +0 -0
- package/dist/web/public/styles.2d175c60.css.gz +0 -0
- package/dist/web/public/subagent-windows.e6ca799f.js.gz +0 -0
- package/dist/web/public/sw.js +2 -2
- package/dist/web/public/sw.js.br +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/tab-layout-browser.065fcba4.js +1 -0
- package/dist/web/public/tab-layout-browser.065fcba4.js.br +0 -0
- package/dist/web/public/tab-layout-browser.065fcba4.js.gz +0 -0
- package/dist/web/public/{tab-rail-resize.dcdc5772.js → tab-rail-resize.94cd59f0.js} +1 -1
- package/dist/web/public/tab-rail-resize.94cd59f0.js.br +0 -0
- package/dist/web/public/tab-rail-resize.94cd59f0.js.gz +0 -0
- package/dist/web/public/terminal-keycode229-recovery.fb91b25b.js.gz +0 -0
- package/dist/web/public/terminal-split.js.gz +0 -0
- package/dist/web/public/terminal-ui.a4535311.js.gz +0 -0
- package/dist/web/public/ultracode-panel.js.gz +0 -0
- package/dist/web/public/ultracode-windows.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-predictive-echo.ae5e3d5d.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.bbb5f84c.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.c4b51eb6.js.gz +0 -0
- package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
- package/dist/web/public/webview-tabs.js.gz +0 -0
- package/dist/web/routes/case-routes.d.ts.map +1 -1
- package/dist/web/routes/case-routes.js +136 -18
- package/dist/web/routes/case-routes.js.map +1 -1
- package/dist/web/routes/doctor-routes.d.ts +23 -0
- package/dist/web/routes/doctor-routes.d.ts.map +1 -0
- package/dist/web/routes/doctor-routes.js +83 -0
- package/dist/web/routes/doctor-routes.js.map +1 -0
- package/dist/web/routes/git-status-routes.d.ts +16 -0
- package/dist/web/routes/git-status-routes.d.ts.map +1 -0
- package/dist/web/routes/git-status-routes.js +71 -0
- package/dist/web/routes/git-status-routes.js.map +1 -0
- package/dist/web/routes/index.d.ts +2 -0
- package/dist/web/routes/index.d.ts.map +1 -1
- package/dist/web/routes/index.js +2 -0
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +20 -8
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +1 -0
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +7 -0
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +3 -1
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
- package/skills/codeman/reference/verbs.md +3 -0
- package/dist/web/public/app.cf0db8ce.js +0 -43
- package/dist/web/public/app.cf0db8ce.js.br +0 -0
- package/dist/web/public/app.cf0db8ce.js.gz +0 -0
- package/dist/web/public/i18n.398b8331.js +0 -1
- package/dist/web/public/i18n.398b8331.js.br +0 -0
- package/dist/web/public/i18n.398b8331.js.gz +0 -0
- package/dist/web/public/session-ui.bf66c13b.js +0 -89
- package/dist/web/public/session-ui.bf66c13b.js.br +0 -0
- package/dist/web/public/session-ui.bf66c13b.js.gz +0 -0
- package/dist/web/public/settings-ui.331d3b1d.js +0 -97
- package/dist/web/public/settings-ui.331d3b1d.js.br +0 -0
- package/dist/web/public/settings-ui.331d3b1d.js.gz +0 -0
- package/dist/web/public/styles.8c485d26.css +0 -1
- package/dist/web/public/styles.8c485d26.css.br +0 -0
- package/dist/web/public/styles.8c485d26.css.gz +0 -0
- package/dist/web/public/tab-layout-browser.4e0ed50c.js +0 -1
- package/dist/web/public/tab-layout-browser.4e0ed50c.js.br +0 -0
- package/dist/web/public/tab-layout-browser.4e0ed50c.js.gz +0 -0
- package/dist/web/public/tab-rail-resize.dcdc5772.js.br +0 -0
- package/dist/web/public/tab-rail-resize.dcdc5772.js.gz +0 -0
package/README.md
CHANGED
|
@@ -444,8 +444,11 @@ PTY Output → 16ms Server Batch → DEC 2026 Wrap → SSE → Client rAF → xt
|
|
|
444
444
|
## More Features
|
|
445
445
|
|
|
446
446
|
- **Background daemon & service install** — `codeman web -d` runs the server detached with a pidfile, `~/.codeman/web.log`, and verified startup (it polls the server until it answers, so a port clash never reads as success); `codeman service install` writes a systemd user unit (Linux) or LaunchAgent (macOS) with your shell's PATH baked in, so an nvm or Homebrew `node`, `tmux` and `claude` are actually found. Secrets are never written into unit files
|
|
447
|
+
- **Diagnostics in Settings** — **App Settings → System → Diagnostics → Run checks** runs `codeman doctor` on the server and lists Node, tmux, every agent CLI and the optional office tools with versions, paths and install hints. Besides the `PATH`, it also looks in each CLI's usual install directories (`~/.local/bin`, `~/.npm-global/bin` and the like), so most installs are found under a service with a minimal `PATH`. Admin only in multi-user mode.
|
|
447
448
|
- **Self-update** — git-clone installs under systemd/launchd update in place from **App Settings → System → Updates**: it detects the latest release, auto-stashes a dirty tree, and streams build progress across the service restart (npm installs report as non-updatable)
|
|
449
|
+
- **Git status in the bottom bar** — off by default (**App Settings → Header & Panels → Bottom bar → Git status**, per device). A small indicator at the right of the bottom bar shows the active session's repository at a glance: `● 3` uncommitted files, `↑ 2` commits not pushed, `⚠` merge conflicts, `✓` all committed and pushed. Click it for a draggable window listing the staged, not-staged, untracked and conflicted files (grouped under collapsed folders, or as a flat list if you turn that setting off) and the unpushed commits; **click a file to see its diff** (new files as all additions, deleted files as all removals), with **Open file** to jump to the viewer. A folder that holds several projects gets one collapsible section per repository found up to two levels down, all collapsed until you open them. Read-only and offline (Codeman never fetches or changes the repo); not shown for Docker or remote sessions.
|
|
448
450
|
- **Clone a GitHub repo as a case** — paste a repository URL into **Add Case → Clone Repo** and Codeman clones it into `~/codeman-cases/<name>` and registers it as a normal case, ready to run an agent in. It preflights the URL while you type (tells you whether it can be cloned anonymously and offers the repo's real branches and tags for the optional branch/tag field), fills the case name in from the URL, and lets you pick which CLI the Run button should use. Public repositories over `https://`; Codeman never collects or stores credentials
|
|
451
|
+
- **Create a case in a custom folder** — tick **Create in a custom folder** in **Add Case → Create New**, pick a parent folder (Browse included) and a name, and Codeman scaffolds the new case there instead of `~/codeman-cases`. The target must be a new or empty folder; system directories, your home folder itself, credential trees such as `~/.ssh`, and Codeman's own data folder are refused. Admin only in multi-user mode.
|
|
449
452
|
- **Multi-CLI** — run **Claude Code**, **OpenCode**, **Codex**, **Antigravity**, **Gemini**, **Pi**, **Grok**, **DeepSeek Harness**, or **OMP** per session; env-var prefixes auto-gate (`CLAUDE_CODE_*` vs `OPENCODE_*` vs `CODEX_*` vs `ANTIGRAVITY_*` vs `GEMINI_*`/`GOOGLE_*` vs `PI_*` vs `GROK_*`/`XAI_*` vs `DSH_*`/`DEEPSEEK_*` vs `OMP_*`). See [`docs/opencode-integration.md`](docs/opencode-integration.md), [`docs/pi-integration.md`](docs/pi-integration.md), [`docs/grok-integration.md`](docs/grok-integration.md), [`docs/deepseek-integration.md`](docs/deepseek-integration.md) and [`docs/omp-integration.md`](docs/omp-integration.md)
|
|
450
453
|
- **Custom model endpoints** _(new in 1.29.0, HTTP API for now)_ — point a session's CLI at any OpenAI-compatible endpoint instead of its native backend: a local llama.cpp, llama-swap, Ollama or vLLM box, or a cloud gateway such as Azure AI Foundry or OpenRouter. Save an endpoint once (`POST /api/model-endpoints`; its models are discovered from `/v1/models`), apply it to a session (`POST /api/sessions/:id/custom-model`), and the CLI restarts in place on that endpoint. Verified live for Claude, OpenCode, Pi, Grok and OMP; Codex, Gemini and DeepSeek have documented gaps, Antigravity has no mechanism. A toolbar picker is the follow-up. See [`docs/custom-model-endpoints.md`](docs/custom-model-endpoints.md)
|
|
451
454
|
- **Web tabs** — open Grafana, Uptime Kuma, a Vite dev server or any dashboard URL as a tab beside your sessions (Run dropdown → **Web / URL** → **Add URL**). Dashboards are proxied through Codeman's own origin, so an `http://` target works from a phone over HTTPS and through the tunnel, single-page apps route on their own paths, and a frame that reloads recovers itself. A `localhost` link an agent prints opens as a web tab automatically. See [`docs/web-tabs.md`](docs/web-tabs.md)
|
|
@@ -24,6 +24,13 @@ export interface PathResolver {
|
|
|
24
24
|
* there and a false "installed" contradicts the run mode's own resolver.
|
|
25
25
|
*/
|
|
26
26
|
requireVersionMatch?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Absolute directories to probe (`<dir>/<bin>`) when `which` misses. A service (systemd,
|
|
29
|
+
* launchd) runs with a minimal PATH, so a CLI installed under `~/.local/bin` or an npm/nvm
|
|
30
|
+
* prefix is invisible to `which` while the run mode, which falls back to the registry's
|
|
31
|
+
* `discovery.searchDirs`, still finds it. Carries those dirs so the doctor agrees.
|
|
32
|
+
*/
|
|
33
|
+
searchDirs?: string[];
|
|
27
34
|
}
|
|
28
35
|
/** Resolve a Windows-installed app reachable from win32 or WSL. */
|
|
29
36
|
export interface WindowsSideResolver {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-registry.d.ts","sourceRoot":"","sources":["../../src/config/dependency-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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CACzD;AAwFD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAoErD"}
|
|
@@ -6,11 +6,25 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module config/dependency-registry
|
|
8
8
|
*/
|
|
9
|
+
import { homedir } from 'node:os';
|
|
10
|
+
import { join } from 'node:path';
|
|
9
11
|
import { enabledClis } from './cli-registry/registry.js';
|
|
10
12
|
import { compileVersionRegex } from './cli-registry/patterns.js';
|
|
11
13
|
/** The valid `--category` filter values; single source of truth for the type, the CLI
|
|
12
14
|
* help text, and CLI input validation. */
|
|
13
15
|
export const TOOL_CATEGORIES = ['core', 'office', 'other'];
|
|
16
|
+
/**
|
|
17
|
+
* Expand a leading `~` (the only form registry `searchDirs` use). Twin of `expandHome()` in
|
|
18
|
+
* src/utils/cli-resolver.ts, copied rather than imported because importing it from config/
|
|
19
|
+
* would pull in the whole resolver chain; keep the two in step.
|
|
20
|
+
*/
|
|
21
|
+
function expandSearchDir(dir) {
|
|
22
|
+
if (dir === '~')
|
|
23
|
+
return homedir();
|
|
24
|
+
if (dir.startsWith('~/'))
|
|
25
|
+
return join(homedir(), dir.slice(2));
|
|
26
|
+
return dir;
|
|
27
|
+
}
|
|
14
28
|
const ALL = ['linux', 'darwin', 'wsl', 'win32'];
|
|
15
29
|
/**
|
|
16
30
|
* The doctor's ROW IDENTITY for a CLI, where it differs from the registry id.
|
|
@@ -84,6 +98,7 @@ function cliDependencyEntries() {
|
|
|
84
98
|
// (pi, grok, dsh): a bare `which` hit there is not evidence of the right
|
|
85
99
|
// program, so a version mismatch means MISSING rather than unknown-version.
|
|
86
100
|
requireVersionMatch: version?.requireVersionMatch,
|
|
101
|
+
searchDirs: cli.discovery.searchDirs.map(expandSearchDir),
|
|
87
102
|
},
|
|
88
103
|
},
|
|
89
104
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-registry.js","sourceRoot":"","sources":["../../src/config/dependency-registry.ts"],"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C;SACF;QACD;YACE,EAAE,EAAE,UAAU;YACd,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC;YAC1C,SAAS,EAAE;gBACT;oBACE,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;oBACvB,QAAQ,EAAE;wBACR,IAAI,EAAE,cAAc;wBACpB,OAAO,EAAE,CAAC,gCAAgC,CAAC;wBAC3C,IAAI,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC;qBACnD;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Limits for the bounded path probe (`src/utils/bounded-path-probe.ts`).
|
|
3
|
+
*
|
|
4
|
+
* A linked case can live on a network mount, and a hard mount that went away makes
|
|
5
|
+
* `stat()` wait until the mount comes back. The probe gives up on such a path after
|
|
6
|
+
* `PATH_PROBE_TIMEOUT_MS` and answers "unknown", and it stops starting new probes
|
|
7
|
+
* once `MAX_STALLED_PATH_PROBES` timed-out stats are still holding libuv threadpool
|
|
8
|
+
* workers (the pool is shared by every `fs`, `dns.lookup` and `crypto` call in the
|
|
9
|
+
* process, and holds 4 workers unless `UV_THREADPOOL_SIZE` says otherwise).
|
|
10
|
+
*
|
|
11
|
+
* Both are env-overridable, in the same style as the other config modules. A slow
|
|
12
|
+
* but healthy mount (an sshfs that needs a couple of seconds on first touch) may want
|
|
13
|
+
* a longer timeout. The stall limits follow `UV_THREADPOOL_SIZE` on their own, so a
|
|
14
|
+
* server started with a larger pool gets a higher ceiling without further setup.
|
|
15
|
+
*
|
|
16
|
+
* @module config/path-probe
|
|
17
|
+
*/
|
|
18
|
+
/** How long a caller waits for one path probe before the answer is "unknown". */
|
|
19
|
+
export declare const PATH_PROBE_TIMEOUT_MS: number;
|
|
20
|
+
/**
|
|
21
|
+
* Hard ceiling on timed-out probes left pending, for every caller, `pastCap` ones
|
|
22
|
+
* included: the threadpool size minus one, so a dead mount can never take the last
|
|
23
|
+
* worker. libuv sizes the pool from `UV_THREADPOOL_SIZE` (4 when unset). A pool of
|
|
24
|
+
* one cannot keep a worker free at all, so the ceiling never drops below one.
|
|
25
|
+
*/
|
|
26
|
+
export declare const PATH_PROBE_STALL_CEILING: number;
|
|
27
|
+
/**
|
|
28
|
+
* Timed-out probes allowed to stay pending before new BULK probes are refused
|
|
29
|
+
* (answered "unknown" without a stat). This is a backstop, not the main defence: a
|
|
30
|
+
* stalled path on a network or FUSE mount already takes the rest of that mount out
|
|
31
|
+
* of probing (a stall anywhere else takes out only the stalled path), so the cap
|
|
32
|
+
* only engages once that many UNRELATED places have stopped answering. It defaults
|
|
33
|
+
* to one below {@link PATH_PROBE_STALL_CEILING} (2 with the default pool), leaving a
|
|
34
|
+
* slot a `pastCap` probe may still use, and is never allowed above the ceiling.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MAX_STALLED_PATH_PROBES: number;
|
|
37
|
+
//# sourceMappingURL=path-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-probe.d.ts","sourceRoot":"","sources":["../../src/config/path-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,QAA8D,CAAC;AAEjG;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAAiE,CAAC;AAEvG;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,QAGnC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Limits for the bounded path probe (`src/utils/bounded-path-probe.ts`).
|
|
3
|
+
*
|
|
4
|
+
* A linked case can live on a network mount, and a hard mount that went away makes
|
|
5
|
+
* `stat()` wait until the mount comes back. The probe gives up on such a path after
|
|
6
|
+
* `PATH_PROBE_TIMEOUT_MS` and answers "unknown", and it stops starting new probes
|
|
7
|
+
* once `MAX_STALLED_PATH_PROBES` timed-out stats are still holding libuv threadpool
|
|
8
|
+
* workers (the pool is shared by every `fs`, `dns.lookup` and `crypto` call in the
|
|
9
|
+
* process, and holds 4 workers unless `UV_THREADPOOL_SIZE` says otherwise).
|
|
10
|
+
*
|
|
11
|
+
* Both are env-overridable, in the same style as the other config modules. A slow
|
|
12
|
+
* but healthy mount (an sshfs that needs a couple of seconds on first touch) may want
|
|
13
|
+
* a longer timeout. The stall limits follow `UV_THREADPOOL_SIZE` on their own, so a
|
|
14
|
+
* server started with a larger pool gets a higher ceiling without further setup.
|
|
15
|
+
*
|
|
16
|
+
* @module config/path-probe
|
|
17
|
+
*/
|
|
18
|
+
function envInt(name, fallback, min, max) {
|
|
19
|
+
const raw = parseInt(process.env[name] || '', 10);
|
|
20
|
+
if (!Number.isFinite(raw) || raw <= 0)
|
|
21
|
+
return fallback;
|
|
22
|
+
return Math.max(min, Math.min(max, raw));
|
|
23
|
+
}
|
|
24
|
+
/** How long a caller waits for one path probe before the answer is "unknown". */
|
|
25
|
+
export const PATH_PROBE_TIMEOUT_MS = envInt('CODEMAN_PATH_PROBE_TIMEOUT_MS', 1_500, 100, 60_000);
|
|
26
|
+
/**
|
|
27
|
+
* Hard ceiling on timed-out probes left pending, for every caller, `pastCap` ones
|
|
28
|
+
* included: the threadpool size minus one, so a dead mount can never take the last
|
|
29
|
+
* worker. libuv sizes the pool from `UV_THREADPOOL_SIZE` (4 when unset). A pool of
|
|
30
|
+
* one cannot keep a worker free at all, so the ceiling never drops below one.
|
|
31
|
+
*/
|
|
32
|
+
export const PATH_PROBE_STALL_CEILING = Math.max(1, (Number(process.env.UV_THREADPOOL_SIZE) || 4) - 1);
|
|
33
|
+
/**
|
|
34
|
+
* Timed-out probes allowed to stay pending before new BULK probes are refused
|
|
35
|
+
* (answered "unknown" without a stat). This is a backstop, not the main defence: a
|
|
36
|
+
* stalled path on a network or FUSE mount already takes the rest of that mount out
|
|
37
|
+
* of probing (a stall anywhere else takes out only the stalled path), so the cap
|
|
38
|
+
* only engages once that many UNRELATED places have stopped answering. It defaults
|
|
39
|
+
* to one below {@link PATH_PROBE_STALL_CEILING} (2 with the default pool), leaving a
|
|
40
|
+
* slot a `pastCap` probe may still use, and is never allowed above the ceiling.
|
|
41
|
+
*/
|
|
42
|
+
export const MAX_STALLED_PATH_PROBES = Math.min(PATH_PROBE_STALL_CEILING, envInt('CODEMAN_PATH_PROBE_MAX_STALLED', Math.max(1, PATH_PROBE_STALL_CEILING - 1), 1, 64));
|
|
43
|
+
//# sourceMappingURL=path-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-probe.js","sourceRoot":"","sources":["../../src/config/path-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,SAAS,MAAM,CAAC,IAAY,EAAE,QAAgB,EAAE,GAAW,EAAE,GAAW;IACtE,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,iFAAiF;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,+BAA+B,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAEjG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEvG;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,GAAG,CAC7C,wBAAwB,EACxB,MAAM,CAAC,gCAAgC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3F,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview "What has this session's workspace not committed or pushed?": a read-only git
|
|
3
|
+
* snapshot of a session's working directory, for the bottom-bar Git indicator and its panel
|
|
4
|
+
* (`GET /api/sessions/:id/git-status`). Agents leave work uncommitted and unpushed; this makes that
|
|
5
|
+
* visible without leaving Codeman.
|
|
6
|
+
*
|
|
7
|
+
* Split so the parts that matter test without a repo:
|
|
8
|
+
* - pure: `parsePorcelainV2` (status output → branch, upstream, ahead/behind, per-file entries),
|
|
9
|
+
* `parseCommitLog`
|
|
10
|
+
* - IO: `getGitWorkspaceStatus` (a handful of async, bounded, read-only `git` calls), with a short
|
|
11
|
+
* single-flight cache so several tabs polling one repo cost one set of git processes
|
|
12
|
+
*
|
|
13
|
+
* WHICH repositories. `getGitWorkspaceOverview` answers for the session's working directory:
|
|
14
|
+
* - inside a repository (or at its root): that one repository. git finds it by walking UP, so a
|
|
15
|
+
* subfolder reports its whole enclosing repo; a nested repo below it is just an untracked folder
|
|
16
|
+
* to the outer one, and is not scanned;
|
|
17
|
+
* - NOT inside one (a folder that holds several projects): every repository found up to two levels
|
|
18
|
+
* DOWN (`MAX_REPOS` of them, skipping dot-folders, `node_modules` and the like, never following
|
|
19
|
+
* symlinks), each reported separately;
|
|
20
|
+
* - a repository that merely sits ABOVE the workspace and is the home folder or higher (a dotfiles
|
|
21
|
+
* repo in `$HOME`, or `/`) is ignored: its dirty files are not this session's work.
|
|
22
|
+
*
|
|
23
|
+
* Rules the code keeps and the tests pin:
|
|
24
|
+
* - READ-ONLY and OFFLINE. It never fetches, pulls, commits or writes. "Behind" therefore reflects
|
|
25
|
+
* the last fetch (the UI says so); "ahead" and the unpushed list are exact against the
|
|
26
|
+
* remote-tracking refs already on disk. `--no-optional-locks` keeps `git status` from even
|
|
27
|
+
* refreshing the index, so polling cannot contend with the agent's own git commands.
|
|
28
|
+
* - Every call is async (`execFile`), bounded by a timeout, and never interpolates a path into a
|
|
29
|
+
* shell: the working directory is the process `cwd`, and the only operand-like input is a fixed
|
|
30
|
+
* revision range.
|
|
31
|
+
* - Output is capped: the counts are exact, the lists are not (`filesTruncated`).
|
|
32
|
+
* - git can run helpers a repository configures: a clean filter (`filter.<name>.clean`) still runs
|
|
33
|
+
* during `git status` and `git diff`, as it does for any `git status`. A LOCAL session already
|
|
34
|
+
* runs as this same OS user, so polling adds no privilege there. What is turned off: the
|
|
35
|
+
* filesystem monitor (`core.fsmonitor`), external diff and textconv drivers, and the signature
|
|
36
|
+
* program (`log.showSignature`). A repository a container can write to is NOT inspected: a
|
|
37
|
+
* Docker session answers `unsupported`, and any repository whose root is, or is inside, a Docker
|
|
38
|
+
* case workspace is dropped from the walk-up, the scan below a folder, and the diff route, because
|
|
39
|
+
* the container could have planted that config and git here would run it on the host.
|
|
40
|
+
* - Remote URLs and git's stderr can embed `user:token@host`; anything that reaches a client goes
|
|
41
|
+
* through `redactGitCredentials`.
|
|
42
|
+
*
|
|
43
|
+
* @module git-workspace-status
|
|
44
|
+
*/
|
|
45
|
+
/** Max file rows returned. The counts stay exact. */
|
|
46
|
+
export declare const MAX_FILES = 300;
|
|
47
|
+
/** Max unpushed commits listed. The count stays exact. */
|
|
48
|
+
export declare const MAX_COMMITS = 50;
|
|
49
|
+
export type GitFileKind = 'staged' | 'unstaged' | 'untracked' | 'conflicted';
|
|
50
|
+
export interface GitFileEntry {
|
|
51
|
+
/** Path relative to the repository root, as git reports it. */
|
|
52
|
+
path: string;
|
|
53
|
+
/** Rename/copy source, when the entry is one. */
|
|
54
|
+
origPath?: string;
|
|
55
|
+
/** Status letter in the index (`M`, `A`, `D`, `R`, `C`, `T`, `.`). */
|
|
56
|
+
index: string;
|
|
57
|
+
/** Status letter in the working tree (`M`, `D`, `T`, `.`, ...). `?` for untracked. */
|
|
58
|
+
worktree: string;
|
|
59
|
+
kind: GitFileKind;
|
|
60
|
+
}
|
|
61
|
+
export interface GitCommitEntry {
|
|
62
|
+
hash: string;
|
|
63
|
+
author: string;
|
|
64
|
+
/** Seconds since the epoch. */
|
|
65
|
+
time: number;
|
|
66
|
+
subject: string;
|
|
67
|
+
}
|
|
68
|
+
export interface GitWorkspaceStatus {
|
|
69
|
+
/**
|
|
70
|
+
* `ok`: a repository, the rest of the fields are meaningful. `not-a-repo`: nothing to show.
|
|
71
|
+
* `unsupported`: a remote or Docker session (never inspected). `error`: git failed; see `error`.
|
|
72
|
+
*/
|
|
73
|
+
state: 'ok' | 'not-a-repo' | 'unsupported' | 'error';
|
|
74
|
+
reason?: 'remote' | 'docker';
|
|
75
|
+
error?: string;
|
|
76
|
+
repoRoot?: string;
|
|
77
|
+
/** Null when HEAD is detached. */
|
|
78
|
+
branch: string | null;
|
|
79
|
+
detached: boolean;
|
|
80
|
+
upstream: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* The configured upstream does not exist on the remote (deleted and pruned, or never pushed, as after
|
|
83
|
+
* cloning an empty repository and committing): nothing is tracked.
|
|
84
|
+
*/
|
|
85
|
+
upstreamGone: boolean;
|
|
86
|
+
ahead: number;
|
|
87
|
+
/** Behind the remote-tracking ref as of the LAST FETCH; this module never fetches. */
|
|
88
|
+
behind: number;
|
|
89
|
+
/** Whether the repository has any remote at all. */
|
|
90
|
+
hasRemote: boolean;
|
|
91
|
+
counts: {
|
|
92
|
+
staged: number;
|
|
93
|
+
unstaged: number;
|
|
94
|
+
untracked: number;
|
|
95
|
+
conflicted: number;
|
|
96
|
+
/** Distinct paths that are not committed. */
|
|
97
|
+
uncommitted: number;
|
|
98
|
+
stashes: number;
|
|
99
|
+
};
|
|
100
|
+
files: GitFileEntry[];
|
|
101
|
+
filesTruncated: boolean;
|
|
102
|
+
/** Commits on this branch that no remote has: exact. */
|
|
103
|
+
unpushedCount: number;
|
|
104
|
+
unpushed: GitCommitEntry[];
|
|
105
|
+
checkedAt: number;
|
|
106
|
+
}
|
|
107
|
+
export declare const emptyStatus: (state: GitWorkspaceStatus["state"], extra?: Partial<GitWorkspaceStatus>) => GitWorkspaceStatus;
|
|
108
|
+
export interface ParsedStatus {
|
|
109
|
+
branch: string | null;
|
|
110
|
+
detached: boolean;
|
|
111
|
+
upstream: string | null;
|
|
112
|
+
/** `# branch.upstream` was printed but `# branch.ab` was not: no such remote branch (deleted and pruned, or never pushed). */
|
|
113
|
+
upstreamGone: boolean;
|
|
114
|
+
ahead: number;
|
|
115
|
+
behind: number;
|
|
116
|
+
files: GitFileEntry[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Parse `git status --porcelain=v2 --branch -z`. Entries are NUL-separated and paths are NOT quoted,
|
|
120
|
+
* so a name with spaces, quotes or a newline arrives intact. A rename/copy (`2 ...`) is followed by
|
|
121
|
+
* one more NUL-terminated token holding the original path.
|
|
122
|
+
*/
|
|
123
|
+
export declare function parsePorcelainV2(text: string): ParsedStatus;
|
|
124
|
+
/** Parse `git log --format=%h%x1f%an%x1f%ct%x1f%s%x1e`. */
|
|
125
|
+
export declare function parseCommitLog(text: string): GitCommitEntry[];
|
|
126
|
+
/** Runs `git <args>` in `cwd` and returns stdout. Injected so the cache and error paths test without git. */
|
|
127
|
+
export type GitRunner = (cwd: string, args: string[]) => Promise<string>;
|
|
128
|
+
export declare const runGit: GitRunner;
|
|
129
|
+
/** For tests. */
|
|
130
|
+
export declare function clearGitStatusCache(): void;
|
|
131
|
+
/**
|
|
132
|
+
* The git snapshot of `cwd`. Concurrent callers share one in-flight computation, and a result younger
|
|
133
|
+
* than a few seconds is reused, so several tabs polling one repo cost one set of git processes.
|
|
134
|
+
* `fresh` skips the reuse but still joins a computation already running (see `singleFlight`).
|
|
135
|
+
*/
|
|
136
|
+
export declare function getGitWorkspaceStatus(cwd: string, opts?: {
|
|
137
|
+
git?: GitRunner;
|
|
138
|
+
now?: () => number;
|
|
139
|
+
fresh?: boolean;
|
|
140
|
+
}): Promise<GitWorkspaceStatus>;
|
|
141
|
+
/** Repositories reported for one workspace. */
|
|
142
|
+
export declare const MAX_REPOS = 12;
|
|
143
|
+
export interface GitRepoEntry {
|
|
144
|
+
/** Folder name of the repository (its root's basename). */
|
|
145
|
+
name: string;
|
|
146
|
+
/** The repository root relative to the working directory: `.`, `..`, `api`, `apps/web`. */
|
|
147
|
+
path: string;
|
|
148
|
+
status: GitWorkspaceStatus;
|
|
149
|
+
}
|
|
150
|
+
export interface GitWorkspaceOverview {
|
|
151
|
+
/** `ok` when at least one repository was found; the other states are as in `GitWorkspaceStatus`. */
|
|
152
|
+
state: 'ok' | 'not-a-repo' | 'unsupported' | 'error';
|
|
153
|
+
reason?: 'remote' | 'docker';
|
|
154
|
+
error?: string;
|
|
155
|
+
repos: GitRepoEntry[];
|
|
156
|
+
/** More than `MAX_REPOS` repositories were found; only the first are reported. */
|
|
157
|
+
reposTruncated: boolean;
|
|
158
|
+
checkedAt: number;
|
|
159
|
+
}
|
|
160
|
+
export declare const emptyOverview: (state: GitWorkspaceOverview["state"], extra?: Partial<GitWorkspaceOverview>) => GitWorkspaceOverview;
|
|
161
|
+
/**
|
|
162
|
+
* True when `path` is, or is inside, any of the (already real) `roots`. Used for Docker case
|
|
163
|
+
* workspaces: a container can write there, so git must not run on its behalf on the host.
|
|
164
|
+
*/
|
|
165
|
+
export declare function isInsideAny(path: string, realRoots: string[]): Promise<boolean>;
|
|
166
|
+
/**
|
|
167
|
+
* True when `repoRoot` is a repository that merely contains the workspace and is the home folder or
|
|
168
|
+
* above it (`$HOME` managed as a dotfiles repo, `/`, `/home`): its changes are not the session's work.
|
|
169
|
+
* A workspace that IS the repository root is never "unrelated", even when that root is the home folder.
|
|
170
|
+
*/
|
|
171
|
+
export declare function isUnrelatedAncestor(repoRoot: string, cwd: string, home: string): Promise<boolean>;
|
|
172
|
+
/** Repositories up to `DISCOVERY_MAX_DEPTH` levels below `cwd`, nearest and alphabetical first. Never follows symlinks. */
|
|
173
|
+
export declare function discoverChildRepos(cwd: string, excludeRealRoots?: string[]): Promise<{
|
|
174
|
+
dirs: string[];
|
|
175
|
+
truncated: boolean;
|
|
176
|
+
}>;
|
|
177
|
+
export interface GitOverviewOptions {
|
|
178
|
+
git?: GitRunner;
|
|
179
|
+
now?: () => number;
|
|
180
|
+
fresh?: boolean;
|
|
181
|
+
home?: string;
|
|
182
|
+
/** Docker case workspaces (host paths): repositories at or inside these are never inspected. */
|
|
183
|
+
dockerWorkspaces?: string[];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Everything git knows about the session's workspace: the enclosing repository when there is one,
|
|
187
|
+
* otherwise each repository found below the working directory. See the module header for the rules.
|
|
188
|
+
*/
|
|
189
|
+
export declare function getGitWorkspaceOverview(cwd: string, opts?: GitOverviewOptions): Promise<GitWorkspaceOverview>;
|
|
190
|
+
/**
|
|
191
|
+
* `repo` when it is the root of one of the repositories the overview reports for `cwd` (the same rules
|
|
192
|
+
* and caches, and the Docker roots as they are now), else null. The diff route checks a requested
|
|
193
|
+
* repository with this rather than recomputing every repository's status.
|
|
194
|
+
*/
|
|
195
|
+
export declare function findWorkspaceRepo(cwd: string, repo: string, opts?: GitOverviewOptions): Promise<string | null>;
|
|
196
|
+
/** Longest diff handed to the browser; beyond this it is cut at a line boundary and flagged. */
|
|
197
|
+
export declare const MAX_DIFF_BYTES: number;
|
|
198
|
+
export interface GitFileDiff {
|
|
199
|
+
/** Unified diff text (empty when git reports no textual change, e.g. a mode-only edit shows its header). */
|
|
200
|
+
diff: string;
|
|
201
|
+
truncated: boolean;
|
|
202
|
+
binary: boolean;
|
|
203
|
+
}
|
|
204
|
+
/** A repo-relative path git reported, minus anything that could escape the repo. (A leading `-` is fine: every operand follows `--`.) */
|
|
205
|
+
export declare function isSafeRepoRelativePath(p: string): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* The diff of one changed file, as the panel's rows describe it: `staged` is index vs HEAD,
|
|
208
|
+
* `unstaged`/`conflicted` is working tree vs index (a conflict shows git's combined diff), and
|
|
209
|
+
* `untracked` is the whole file as additions. Read-only. `--no-ext-diff --no-textconv` stop the external
|
|
210
|
+
* diff and textconv drivers a repository configures; a clean filter still runs, as it does for any
|
|
211
|
+
* `git diff`, which is why a container-writable repository never reaches this function.
|
|
212
|
+
*/
|
|
213
|
+
export declare function getGitFileDiff(repoRoot: string, file: {
|
|
214
|
+
path: string;
|
|
215
|
+
origPath?: string;
|
|
216
|
+
kind: GitFileKind;
|
|
217
|
+
}, opts?: {
|
|
218
|
+
git?: GitRunner;
|
|
219
|
+
}): Promise<GitFileDiff>;
|
|
220
|
+
//# sourceMappingURL=git-workspace-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-workspace-status.d.ts","sourceRoot":"","sources":["../src/git-workspace-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAcH,qDAAqD;AACrD,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,0DAA0D;AAC1D,eAAO,MAAM,WAAW,KAAK,CAAC;AAK9B,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;AAE7E,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE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