@phnx-labs/agents-cli 1.22.71 → 1.22.72
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/CHANGELOG.md +4 -0
- package/dist/lib/project-resources.js +14 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.22.72
|
|
4
|
+
|
|
5
|
+
- **The self-managed `.gitignore` block now ignores the `.agents-managed.json` manifest too, so a synced harness dir is actually clean in `git status` (PHNX-3717).** The project-resource sync's gitignore reconciliation (shipped in 1.22.71) listed the synced commands/skills but not the manifest marker file the sync also writes into each harness dir — so `.factory/` (etc.) still showed as untracked on the strength of that one unignored file, defeating the point. `reconcileProjectGitignore` now feeds `.agents-managed.json` through the same anchoring + escape guard, and the block persists (shrunk to just the manifest) while that file exists rather than fully pruning. Covered by a new test that asserts a real `git status --porcelain` no longer reports the generated dir. Source: `cli/src/lib/project-resources.ts`, `cli/src/lib/project-resources.test.ts`.
|
|
6
|
+
|
|
3
7
|
## 1.22.71
|
|
4
8
|
|
|
5
9
|
- **The daemon now keeps itself current instead of running stale code for days (PHNX-3695).** The long-running daemon (`agents __daemon-run`) deliberately opted out of the interactive CLI's auto-update (`AGENTS_CLI_DISABLE_AUTO_UPDATE=1` forced on for `__daemon-run`), so new agents-cli code never reached a running daemon until a human ran `agents daemon restart` — R5 ("the installed CLI auto-updates") silently did not hold for the one process that runs unattended the longest. A new supervised `self-update` service checks npm roughly every 75 minutes, installs and byte-verifies a newer version with the same primitives `agents upgrade` already uses (never a bare `npm install -g`), best-effort pulls the `.system` companion repo and reconciles with `agents sync --local`, then exits so the OS supervisor (launchd `KeepAlive` / systemd `Restart=always`) relaunches it onto the new code — clients reconnect on their own, and the scheduler's atomic `(routine, scheduledFor)` claim dedupes any routine mid-fire across the restart. It fails closed on every step: an install or verify failure leaves the running daemon untouched and retries next tick, and it no-ops on a dev build or a shadowed install. A version-skewed browser-IPC client no longer just prints "run agents daemon restart" — `reconcileDaemonVersion` now asks the daemon to run this same fail-closed path on demand (`request-self-update`), sharing one in-flight attempt with the periodic tick so concurrent requests can't race two installs. That on-demand trigger is DECOUPLED from the install: because every version-skewed `agents browser <verb>` routes through it, the daemon kicks the self-update off in the background and answers "triggered" immediately rather than making the browser verb wait out the whole check→download→install→verify (tens of seconds, worst case ~15 min) — the daemon installs, verifies, and exits on its own, and the browser reconnects. Source: `cli/src/lib/daemon/self-update-service.ts`, `cli/src/lib/browser/ipc.ts`.
|
|
@@ -141,7 +141,9 @@ function applyManagedBlock(content, begin, end, entries) {
|
|
|
141
141
|
if (entries.length > 0) {
|
|
142
142
|
return [...lines.slice(0, bi), begin, ...entries, end, ...lines.slice(ei + 1)].join('\n');
|
|
143
143
|
}
|
|
144
|
-
// Prune the block, tidying the blank lines that hugged it.
|
|
144
|
+
// Prune the block, tidying the blank lines that hugged it. Vestigial on the
|
|
145
|
+
// reconcileProjectGitignore path (its entries always include the manifest,
|
|
146
|
+
// so entries.length is never 0 there) — kept for a direct caller/unit test.
|
|
145
147
|
const before = lines.slice(0, bi);
|
|
146
148
|
const after = lines.slice(ei + 1);
|
|
147
149
|
while (before.length && before[before.length - 1].trim() === '')
|
|
@@ -162,16 +164,23 @@ function applyManagedBlock(content, begin, end, entries) {
|
|
|
162
164
|
* generated per-harness resource dir never shows as untracked dirt. Idempotent
|
|
163
165
|
* and convergent: replaces the block in place and writes only when the content
|
|
164
166
|
* actually changes, so the launch hot path does not churn the file (or its
|
|
165
|
-
* watchers) every run — even in a project synced by several harnesses.
|
|
166
|
-
*
|
|
167
|
-
*
|
|
167
|
+
* watchers) every run — even in a project synced by several harnesses. When a
|
|
168
|
+
* sync clears a harness's resources the block does not vanish: it shrinks to the
|
|
169
|
+
* lone `.agents-managed.json` entry (that file still sits in the harness dir and
|
|
170
|
+
* must stay ignored), so the block is only ever fully pruned by hand, never via
|
|
171
|
+
* this call path. Never creates a `.gitignore` outside a git working tree.
|
|
168
172
|
*/
|
|
169
173
|
function reconcileProjectGitignore(projectRoot, agent, agentRoot, managed) {
|
|
170
174
|
const gitignorePath = path.join(projectRoot, '.gitignore');
|
|
171
175
|
if (!isInsideGitRepo(projectRoot) && !pathExists(gitignorePath))
|
|
172
176
|
return;
|
|
173
177
|
const { begin, end } = gitignoreMarkers(agent);
|
|
174
|
-
|
|
178
|
+
// Ignore the manifest marker file too, not just the synced resources: the
|
|
179
|
+
// sync always writes `<agentRoot>/.agents-managed.json`, so without this the
|
|
180
|
+
// harness dir still shows as untracked in `git status` on the strength of that
|
|
181
|
+
// one file (defeating the whole point). It lives at agentRoot, so it resolves
|
|
182
|
+
// through the same anchoring + escape guard as any managed path.
|
|
183
|
+
const entries = managedGitignoreEntries(agentRoot, projectRoot, [MANIFEST_FILE, ...managed]);
|
|
175
184
|
let original = '';
|
|
176
185
|
try {
|
|
177
186
|
original = fs.readFileSync(gitignorePath, 'utf-8');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.72",
|
|
4
4
|
"description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|