@phnx-labs/agents-cli 1.20.86 → 1.20.88
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 +172 -0
- package/README.md +3 -3
- package/dist/bin/agents +0 -0
- package/dist/commands/doctor.d.ts +0 -19
- package/dist/commands/doctor.js +219 -305
- package/dist/commands/exec.js +7 -19
- package/dist/commands/inspect.js +3 -5
- package/dist/commands/routines.js +2 -2
- package/dist/commands/sessions-browser.d.ts +18 -0
- package/dist/commands/sessions-browser.js +126 -24
- package/dist/commands/sessions-picker.d.ts +21 -8
- package/dist/commands/sessions-picker.js +83 -7
- package/dist/commands/sessions.d.ts +19 -0
- package/dist/commands/sessions.js +148 -18
- package/dist/commands/ssh.js +62 -4
- package/dist/commands/teams-picker.d.ts +2 -0
- package/dist/commands/teams-picker.js +2 -1
- package/dist/commands/teams.d.ts +4 -1
- package/dist/commands/teams.js +106 -70
- package/dist/commands/usage.d.ts +3 -2
- package/dist/commands/usage.js +2 -9
- package/dist/commands/view.js +14 -3
- package/dist/index.js +31 -1
- package/dist/lib/agents.d.ts +31 -1
- package/dist/lib/agents.js +55 -0
- package/dist/lib/claude-account-token.d.ts +12 -0
- package/dist/lib/claude-account-token.js +63 -0
- package/dist/lib/command-skills.d.ts +10 -0
- package/dist/lib/command-skills.js +14 -0
- package/dist/lib/commands.js +19 -1
- package/dist/lib/daemon.js +17 -2
- package/dist/lib/devices/doctor-findings.d.ts +167 -0
- package/dist/lib/devices/doctor-findings.js +893 -0
- package/dist/lib/devices/fleet-divergence.d.ts +22 -0
- package/dist/lib/devices/fleet-divergence.js +34 -10
- package/dist/lib/devices/fleet-inventory.d.ts +17 -6
- package/dist/lib/devices/fleet-inventory.js +56 -8
- package/dist/lib/devices/registry.d.ts +25 -0
- package/dist/lib/devices/registry.js +82 -1
- package/dist/lib/events.d.ts +8 -1
- package/dist/lib/events.js +13 -0
- package/dist/lib/exec.d.ts +14 -3
- package/dist/lib/exec.js +51 -9
- package/dist/lib/format.d.ts +7 -0
- package/dist/lib/format.js +11 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
- package/dist/lib/project-resources.js +34 -20
- package/dist/lib/runner.d.ts +14 -1
- package/dist/lib/runner.js +37 -8
- package/dist/lib/sandbox.d.ts +2 -0
- package/dist/lib/sandbox.js +38 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
- package/dist/lib/secrets/rc-hygiene.d.ts +0 -6
- package/dist/lib/secrets/rc-hygiene.js +0 -24
- package/dist/lib/session/active.d.ts +6 -6
- package/dist/lib/session/active.js +6 -6
- package/dist/lib/session/db.d.ts +21 -0
- package/dist/lib/session/db.js +45 -4
- package/dist/lib/session/discover.d.ts +5 -0
- package/dist/lib/session/discover.js +137 -1
- package/dist/lib/session/parse.d.ts +2 -0
- package/dist/lib/session/parse.js +76 -37
- package/dist/lib/session/remote-list.d.ts +7 -0
- package/dist/lib/session/remote-list.js +8 -4
- package/dist/lib/session/state.js +69 -2
- package/dist/lib/session/sync/agents.js +0 -0
- package/dist/lib/session/team-filter.d.ts +22 -3
- package/dist/lib/session/team-filter.js +106 -17
- package/dist/lib/session/types.d.ts +9 -1
- package/dist/lib/session/types.js +1 -1
- package/dist/lib/signin-badge.d.ts +17 -0
- package/dist/lib/signin-badge.js +19 -0
- package/dist/lib/staleness/detectors/commands.js +14 -5
- package/dist/lib/staleness/types.d.ts +2 -0
- package/dist/lib/staleness/writers/commands.js +13 -7
- package/dist/lib/state.d.ts +2 -0
- package/dist/lib/state.js +2 -0
- package/dist/lib/usage.d.ts +72 -1
- package/dist/lib/usage.js +22 -87
- package/dist/lib/versions.js +30 -13
- package/package.json +1 -1
package/dist/lib/versions.js
CHANGED
|
@@ -43,7 +43,7 @@ import { discoverPlugins, marketplaceSpecForName } from './plugins.js';
|
|
|
43
43
|
import { loadManifest, saveManifest, buildManifest as buildSyncManifest, isStale } from './staleness/index.js';
|
|
44
44
|
import { emit } from './events.js';
|
|
45
45
|
import { safeJoin } from './paths.js';
|
|
46
|
-
import { readSkillSourceCommandMarker, shouldInstallCommandAsSkill } from './command-skills.js';
|
|
46
|
+
import { readSkillSourceCommandMarker, shouldAlsoInstallCommandAsSkill, shouldInstallCommandAsSkill, } from './command-skills.js';
|
|
47
47
|
import { getWriter, getDetector } from './staleness/registry.js';
|
|
48
48
|
import { syncMemoryToVersionHome } from './memory.js';
|
|
49
49
|
import { listPluginSkillNames, resolveCommandSource, resolveSkillSource } from './staleness/writers/sources.js';
|
|
@@ -2555,21 +2555,30 @@ export function syncResourcesToVersion(agent, version, selection, options = {})
|
|
|
2555
2555
|
};
|
|
2556
2556
|
const trustedCommandNames = (names) => names.filter((name) => resolveCommandSource(name) !== null);
|
|
2557
2557
|
// Sync commands — dispatch through WRITERS.commands. The writer dispatches
|
|
2558
|
-
// between native (file copy / TOML conversion)
|
|
2559
|
-
//
|
|
2560
|
-
// previous COMMANDS_CAPABLE_AGENTS gate excluded
|
|
2561
|
-
//
|
|
2558
|
+
// between native (file copy / TOML conversion), commands-as-skills, and the
|
|
2559
|
+
// registry-driven dual-write path based on the command-skill predicates. The
|
|
2560
|
+
// previous COMMANDS_CAPABLE_AGENTS gate excluded skills-only targets such as
|
|
2561
|
+
// Kimi, silently dropping every converted command.
|
|
2562
2562
|
const commandsWriter = getWriter('commands', agent);
|
|
2563
2563
|
const commandsToSync = selection
|
|
2564
2564
|
? trustedCommandNames(resolveSelection(selection.commands, available.commands))
|
|
2565
2565
|
: trustedCommandNames(available.commands); // No selection = sync all trusted commands, excluding project-only commands
|
|
2566
2566
|
const commandsAsSkills = shouldInstallCommandAsSkill(agent, version);
|
|
2567
|
+
const commandsAlsoAsSkills = shouldAlsoInstallCommandAsSkill(agent, version);
|
|
2568
|
+
const commandsInstallAsSkills = commandsAsSkills || commandsAlsoAsSkills;
|
|
2569
|
+
let writtenCommands = [];
|
|
2567
2570
|
if (commandsToSync.length > 0 && commandsWriter) {
|
|
2568
|
-
|
|
2571
|
+
// Agents that replace native command files with skills (codex >= 0.117.0,
|
|
2572
|
+
// kimi) must have their legacy command dir removed, or files written by an
|
|
2573
|
+
// older version linger forever: the orphan sweep below is gated off for
|
|
2574
|
+
// them, and `agents prune` only sees their skills. Gated on
|
|
2575
|
+
// `commandsAsSkills`, never `commandsAlsoAsSkills` -- a dual-write agent's
|
|
2576
|
+
// native dir is a live product surface (Cursor IDE) and must not be wiped.
|
|
2569
2577
|
if (commandsAsSkills && agentConfig.commandsSubdir) {
|
|
2570
|
-
removePath(
|
|
2578
|
+
removePath(path.join(agentDir, agentConfig.commandsSubdir));
|
|
2571
2579
|
}
|
|
2572
2580
|
const r = commandsWriter.write({ version, versionHome, selection: commandsToSync, cwd });
|
|
2581
|
+
writtenCommands = r.synced;
|
|
2573
2582
|
result.commands = r.synced.length > 0;
|
|
2574
2583
|
}
|
|
2575
2584
|
// Orphan-sweep stale top-level command files from previous syncs under a
|
|
@@ -2584,13 +2593,19 @@ export function syncResourcesToVersion(agent, version, selection, options = {})
|
|
|
2584
2593
|
if (fs.existsSync(commandsTargetSweep)) {
|
|
2585
2594
|
const ext = agentConfig.format === 'toml' ? '.toml' : '.md';
|
|
2586
2595
|
const trustedCommands = new Set(commandsToSync);
|
|
2596
|
+
// A dual-write target's native directory also belongs to another product
|
|
2597
|
+
// surface (Cursor IDE). Delete only names the command writer recorded as
|
|
2598
|
+
// successfully emitted during the preceding full sync.
|
|
2599
|
+
const previouslyManagedCommands = commandsAlsoAsSkills
|
|
2600
|
+
? new Set(loadManifest(agent, version)?.writtenCommands ?? [])
|
|
2601
|
+
: null;
|
|
2587
2602
|
for (const entry of fs.readdirSync(commandsTargetSweep, { withFileTypes: true })) {
|
|
2588
2603
|
if (!entry.isFile() || entry.name.startsWith('.'))
|
|
2589
2604
|
continue;
|
|
2590
2605
|
if (!entry.name.endsWith(ext))
|
|
2591
2606
|
continue;
|
|
2592
2607
|
const name = entry.name.slice(0, -ext.length);
|
|
2593
|
-
if (!trustedCommands.has(name)) {
|
|
2608
|
+
if (!trustedCommands.has(name) && (!previouslyManagedCommands || previouslyManagedCommands.has(name))) {
|
|
2594
2609
|
removePath(safeJoin(commandsTargetSweep, entry.name));
|
|
2595
2610
|
}
|
|
2596
2611
|
}
|
|
@@ -2612,7 +2627,7 @@ export function syncResourcesToVersion(agent, version, selection, options = {})
|
|
|
2612
2627
|
let skillsToSync = userPassedSelection
|
|
2613
2628
|
? selectedSkillsToSync
|
|
2614
2629
|
: Array.from(new Set([...selectedSkillsToSync, ...pluginSkillsToSync]));
|
|
2615
|
-
if (
|
|
2630
|
+
if (commandsInstallAsSkills && commandsToSync.length > 0 && skillsToSync.length > 0) {
|
|
2616
2631
|
const commandNames = new Set(commandsToSync);
|
|
2617
2632
|
const skillRoots = [
|
|
2618
2633
|
path.join(getUserAgentsDir(), 'skills'),
|
|
@@ -2639,13 +2654,13 @@ export function syncResourcesToVersion(agent, version, selection, options = {})
|
|
|
2639
2654
|
// dot-dirs to keep plugin-managed subtrees (.plugins/, .promptcuts) intact.
|
|
2640
2655
|
const skillsTargetSweep = path.join(agentDir, 'skills');
|
|
2641
2656
|
if (!userPassedSelection && fs.existsSync(skillsTargetSweep) && !fs.lstatSync(skillsTargetSweep).isSymbolicLink()) {
|
|
2642
|
-
// Trust real skills AND command-skills: when
|
|
2657
|
+
// Trust real skills AND command-skills: when commandsInstallAsSkills, the
|
|
2643
2658
|
// commands writer (above) materialized each command as a skill dir under
|
|
2644
2659
|
// skills/. Those names are not in skillsToSync, so without this they'd be
|
|
2645
2660
|
// swept as orphans — silently deleting every converted command (e.g.
|
|
2646
|
-
// /recap on
|
|
2661
|
+
// /recap on Kimi or newer Codex releases).
|
|
2647
2662
|
const trustedSkills = new Set(skillsToSync);
|
|
2648
|
-
if (
|
|
2663
|
+
if (commandsInstallAsSkills)
|
|
2649
2664
|
for (const cmd of commandsToSync)
|
|
2650
2665
|
trustedSkills.add(cmd);
|
|
2651
2666
|
for (const entry of fs.readdirSync(skillsTargetSweep, { withFileTypes: true })) {
|
|
@@ -2866,7 +2881,9 @@ export function syncResourcesToVersion(agent, version, selection, options = {})
|
|
|
2866
2881
|
// one-off override, so the resulting state matches what the manifest
|
|
2867
2882
|
// records as the synced set.
|
|
2868
2883
|
if (!userPassedSelection) {
|
|
2869
|
-
|
|
2884
|
+
const manifest = buildSyncManifest(agent, version, cwd);
|
|
2885
|
+
manifest.writtenCommands = writtenCommands;
|
|
2886
|
+
saveManifest(agent, version, manifest);
|
|
2870
2887
|
}
|
|
2871
2888
|
return result;
|
|
2872
2889
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.88",
|
|
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",
|