@phnx-labs/agents-cli 1.20.64 → 1.20.65
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 +39 -3
- package/README.md +37 -2
- package/dist/bin/agents +0 -0
- package/dist/commands/apply.d.ts +12 -0
- package/dist/commands/apply.js +274 -0
- package/dist/commands/browser.js +2 -2
- package/dist/commands/cloud.js +32 -2
- package/dist/commands/doctor.js +4 -1
- package/dist/commands/exec.js +94 -49
- package/dist/commands/feed.js +25 -11
- package/dist/commands/hosts.js +44 -6
- package/dist/commands/mcp.js +55 -5
- package/dist/commands/monitors.d.ts +12 -0
- package/dist/commands/monitors.js +740 -0
- package/dist/commands/output.js +2 -2
- package/dist/commands/routines.js +23 -2
- package/dist/commands/secrets.d.ts +16 -0
- package/dist/commands/secrets.js +215 -64
- package/dist/commands/serve.js +31 -0
- package/dist/commands/sessions-export.js +8 -3
- package/dist/commands/sessions.d.ts +16 -0
- package/dist/commands/sessions.js +36 -6
- package/dist/commands/ssh.js +45 -2
- package/dist/commands/versions.js +7 -3
- package/dist/commands/view.d.ts +26 -0
- package/dist/commands/view.js +32 -9
- package/dist/commands/webhook.js +10 -2
- package/dist/index.js +34 -14
- package/dist/lib/agents.d.ts +18 -0
- package/dist/lib/agents.js +53 -3
- package/dist/lib/auto-dispatch-provider.js +7 -2
- package/dist/lib/auto-dispatch.d.ts +3 -0
- package/dist/lib/auto-dispatch.js +3 -0
- package/dist/lib/browser/chrome.js +2 -2
- package/dist/lib/cloud/antigravity.js +2 -2
- package/dist/lib/cloud/host.d.ts +59 -0
- package/dist/lib/cloud/host.js +224 -0
- package/dist/lib/cloud/registry.js +4 -0
- package/dist/lib/cloud/types.d.ts +6 -4
- package/dist/lib/computer-rpc.js +3 -1
- package/dist/lib/crabbox/cli.js +5 -1
- package/dist/lib/crabbox/runtimes.js +11 -2
- package/dist/lib/daemon.d.ts +20 -4
- package/dist/lib/daemon.js +62 -19
- package/dist/lib/devices/fleet.d.ts +3 -2
- package/dist/lib/devices/fleet.js +9 -0
- package/dist/lib/devices/registry.d.ts +15 -0
- package/dist/lib/devices/registry.js +9 -0
- package/dist/lib/exec.d.ts +19 -2
- package/dist/lib/exec.js +41 -13
- package/dist/lib/fleet/apply.d.ts +63 -0
- package/dist/lib/fleet/apply.js +214 -0
- package/dist/lib/fleet/auth-sync.d.ts +67 -0
- package/dist/lib/fleet/auth-sync.js +142 -0
- package/dist/lib/fleet/manifest.d.ts +29 -0
- package/dist/lib/fleet/manifest.js +127 -0
- package/dist/lib/fleet/types.d.ts +129 -0
- package/dist/lib/fleet/types.js +13 -0
- package/dist/lib/git.d.ts +27 -0
- package/dist/lib/git.js +34 -2
- package/dist/lib/hosts/dispatch.d.ts +29 -8
- package/dist/lib/hosts/dispatch.js +46 -18
- package/dist/lib/hosts/passthrough.js +2 -0
- package/dist/lib/hosts/providers/devices.d.ts +27 -0
- package/dist/lib/hosts/providers/devices.js +98 -0
- package/dist/lib/hosts/registry.d.ts +10 -16
- package/dist/lib/hosts/registry.js +17 -50
- package/dist/lib/hosts/remote-cmd.d.ts +23 -0
- package/dist/lib/hosts/remote-cmd.js +71 -0
- package/dist/lib/hosts/run-target.d.ts +84 -0
- package/dist/lib/hosts/run-target.js +99 -0
- package/dist/lib/hosts/types.d.ts +23 -5
- package/dist/lib/hosts/types.js +22 -4
- package/dist/lib/linear-autoclose.d.ts +30 -0
- package/dist/lib/linear-autoclose.js +22 -0
- package/dist/lib/mcp.d.ts +27 -1
- package/dist/lib/mcp.js +126 -12
- package/dist/lib/monitors/config.d.ts +161 -0
- package/dist/lib/monitors/config.js +372 -0
- package/dist/lib/monitors/dispatch.d.ts +28 -0
- package/dist/lib/monitors/dispatch.js +91 -0
- package/dist/lib/monitors/engine.d.ts +61 -0
- package/dist/lib/monitors/engine.js +201 -0
- package/dist/lib/monitors/sources/command.d.ts +11 -0
- package/dist/lib/monitors/sources/command.js +31 -0
- package/dist/lib/monitors/sources/device.d.ts +13 -0
- package/dist/lib/monitors/sources/device.js +35 -0
- package/dist/lib/monitors/sources/file.d.ts +14 -0
- package/dist/lib/monitors/sources/file.js +57 -0
- package/dist/lib/monitors/sources/http.d.ts +10 -0
- package/dist/lib/monitors/sources/http.js +34 -0
- package/dist/lib/monitors/sources/index.d.ts +14 -0
- package/dist/lib/monitors/sources/index.js +31 -0
- package/dist/lib/monitors/sources/poll.d.ts +9 -0
- package/dist/lib/monitors/sources/poll.js +9 -0
- package/dist/lib/monitors/sources/types.d.ts +18 -0
- package/dist/lib/monitors/sources/types.js +9 -0
- package/dist/lib/monitors/sources/webhook.d.ts +23 -0
- package/dist/lib/monitors/sources/webhook.js +47 -0
- package/dist/lib/monitors/sources/ws.d.ts +14 -0
- package/dist/lib/monitors/sources/ws.js +45 -0
- package/dist/lib/monitors/state.d.ts +69 -0
- package/dist/lib/monitors/state.js +144 -0
- package/dist/lib/platform/exec.d.ts +16 -0
- package/dist/lib/platform/exec.js +17 -0
- package/dist/lib/plugins.js +101 -2
- package/dist/lib/redact.d.ts +14 -1
- package/dist/lib/redact.js +47 -1
- package/dist/lib/remote-agents-json.js +7 -1
- package/dist/lib/rotate.d.ts +6 -3
- package/dist/lib/rotate.js +0 -1
- package/dist/lib/routines.d.ts +16 -0
- package/dist/lib/routines.js +19 -0
- package/dist/lib/runner.d.ts +1 -0
- package/dist/lib/runner.js +102 -9
- package/dist/lib/secrets/agent.d.ts +48 -10
- package/dist/lib/secrets/agent.js +123 -15
- package/dist/lib/secrets/bundles.d.ts +26 -0
- package/dist/lib/secrets/bundles.js +59 -8
- package/dist/lib/secrets/mcp.js +4 -2
- package/dist/lib/secrets/remote.d.ts +17 -0
- package/dist/lib/secrets/remote.js +40 -0
- package/dist/lib/self-update.d.ts +20 -0
- package/dist/lib/self-update.js +54 -1
- package/dist/lib/serve/control.d.ts +95 -0
- package/dist/lib/serve/control.js +260 -0
- package/dist/lib/serve/server.d.ts +35 -1
- package/dist/lib/serve/server.js +106 -76
- package/dist/lib/serve/stream.d.ts +43 -0
- package/dist/lib/serve/stream.js +116 -0
- package/dist/lib/serve/token.d.ts +35 -0
- package/dist/lib/serve/token.js +85 -0
- package/dist/lib/session/bundle.d.ts +14 -0
- package/dist/lib/session/bundle.js +12 -1
- package/dist/lib/session/remote-list.js +5 -1
- package/dist/lib/session/state.d.ts +7 -25
- package/dist/lib/session/state.js +16 -6
- package/dist/lib/session/sync/config.js +8 -2
- package/dist/lib/session/types.d.ts +30 -0
- package/dist/lib/ssh-tunnel.d.ts +19 -1
- package/dist/lib/ssh-tunnel.js +86 -7
- package/dist/lib/startup/command-registry.d.ts +2 -0
- package/dist/lib/startup/command-registry.js +4 -0
- package/dist/lib/state.d.ts +5 -0
- package/dist/lib/state.js +12 -0
- package/dist/lib/tmux/session.d.ts +7 -0
- package/dist/lib/tmux/session.js +3 -1
- package/dist/lib/triggers/webhook.d.ts +18 -0
- package/dist/lib/triggers/webhook.js +105 -0
- package/dist/lib/types.d.ts +26 -1
- package/dist/lib/usage.js +7 -5
- package/dist/lib/versions.js +14 -11
- package/dist/lib/workflows.d.ts +20 -0
- package/dist/lib/workflows.js +24 -0
- package/package.json +2 -1
package/dist/lib/versions.js
CHANGED
|
@@ -30,7 +30,7 @@ import { listResources } from './resources.js';
|
|
|
30
30
|
import { VERSION_RE, compareVersions } from './agent-spec/primitives.js';
|
|
31
31
|
import { AGENTS, agentConfigDirName, getAccountEmail, resolveAgentName, formatAgentError, findInPath, isSelfUpdatingAgent } from './agents.js';
|
|
32
32
|
import { discoverPermissionGroups, getActivePermissionPresetName, readPermissionPresetRecipe, PERMISSION_PRESET_ENV_VAR } from './permissions.js';
|
|
33
|
-
import { parseMcpServerConfig } from './mcp.js';
|
|
33
|
+
import { parseMcpServerConfig, isProjectMcpTrusted } from './mcp.js';
|
|
34
34
|
import { createVersionedAlias, removeVersionedAlias, getConfigSymlinkVersion, ensureClaudeInsideSymlink } from './shims.js';
|
|
35
35
|
import { importInstallScriptBinary } from './import.js';
|
|
36
36
|
import { IS_WINDOWS, composeWin32CommandLine } from './platform/index.js';
|
|
@@ -2511,20 +2511,23 @@ export function syncResourcesToVersion(agent, version, selection, options = {})
|
|
|
2511
2511
|
// For Claude/Codex: uses CLI commands (claude mcp add, codex mcp add)
|
|
2512
2512
|
// For others: edits config files directly
|
|
2513
2513
|
//
|
|
2514
|
-
// Mirror the hooks defense:
|
|
2515
|
-
//
|
|
2516
|
-
//
|
|
2517
|
-
//
|
|
2518
|
-
//
|
|
2519
|
-
//
|
|
2520
|
-
//
|
|
2521
|
-
//
|
|
2522
|
-
const
|
|
2514
|
+
// Mirror the hooks defense: an MCP server is an executable invoked under the
|
|
2515
|
+
// agent's authority, so a cloned public repo's .agents/mcp/foo.yaml could
|
|
2516
|
+
// install an arbitrary command (RUSH-1776). Project-scoped MCPs are UNTRUSTED
|
|
2517
|
+
// by default — drop them before handing the list to installMcpServers unless
|
|
2518
|
+
// the user has explicitly trusted this project (`agents mcp trust`). The
|
|
2519
|
+
// register/spawn choke in lib/mcp.ts (getMcpServersByName) enforces the same
|
|
2520
|
+
// trust gate and drops untrusted project entries before dedup, so a project
|
|
2521
|
+
// entry can no longer shadow a same-named user entry either.
|
|
2522
|
+
const projectMcpTrusted = projectAgentsDir ? isProjectMcpTrusted(projectAgentsDir) : false;
|
|
2523
|
+
const untrustedProjectMcpNames = new Set(projectMcpTrusted
|
|
2524
|
+
? []
|
|
2525
|
+
: getScopedMcpResources(cwd).filter(r => r.scope === 'project').map(r => r.name));
|
|
2523
2526
|
const mcpWriter = getWriter('mcp', agent);
|
|
2524
2527
|
const mcpToSyncAll = selection
|
|
2525
2528
|
? resolveSelection(selection.mcp, available.mcp)
|
|
2526
2529
|
: (mcpWriter ? available.mcp : []);
|
|
2527
|
-
const mcpToSync = mcpToSyncAll.filter(n => !
|
|
2530
|
+
const mcpToSync = mcpToSyncAll.filter(n => !untrustedProjectMcpNames.has(n));
|
|
2528
2531
|
if (mcpToSync.length > 0 && mcpWriter) {
|
|
2529
2532
|
const r = mcpWriter.write({ version, versionHome, selection: mcpToSync, cwd });
|
|
2530
2533
|
result.mcp = r.synced;
|
package/dist/lib/workflows.d.ts
CHANGED
|
@@ -240,6 +240,26 @@ export declare function resolveAllowedSubagents(available: string[], allowedAgen
|
|
|
240
240
|
allowedStems: string[];
|
|
241
241
|
missing: string[];
|
|
242
242
|
};
|
|
243
|
+
/** The Claude tool an orchestrator uses to dispatch subagents. Must stay in a
|
|
244
|
+
* workflow's `--tools` allowlist whenever the workflow ships dispatchable
|
|
245
|
+
* subagents, or the orchestrator has no way to reach them. */
|
|
246
|
+
export declare const SUBAGENT_DISPATCH_TOOL = "Task";
|
|
247
|
+
/**
|
|
248
|
+
* Keep the subagent-dispatch tool (`Task`) in a `tools:`-restricted workflow's
|
|
249
|
+
* allowlist when the workflow actually ships subagents to dispatch.
|
|
250
|
+
*
|
|
251
|
+
* A WORKFLOW.md `tools:` list becomes Claude's `--tools` set, which *restricts*
|
|
252
|
+
* the available built-ins. An orchestrator whose `subagents/` files were just
|
|
253
|
+
* copied into the shared agents dir but whose `tools:` omits `Task` cannot
|
|
254
|
+
* reach any of them — it silently no-ops (observed: the run emits only "I'll
|
|
255
|
+
* wait for the completion notification" and exits). Omitting `Task` while
|
|
256
|
+
* shipping a `subagents/` dir is always an authoring miss, so we re-add it at
|
|
257
|
+
* the source rather than relying on every workflow author to remember.
|
|
258
|
+
*
|
|
259
|
+
* Returns `tools` unchanged when the workflow has no subagents or already lists
|
|
260
|
+
* `Task`; otherwise appends `Task`.
|
|
261
|
+
*/
|
|
262
|
+
export declare function ensureSubagentDispatchTool(tools: string[], hasSubagents: boolean): string[];
|
|
243
263
|
/**
|
|
244
264
|
* Prune stale workflow-managed subagent files from the shared per-agent agents
|
|
245
265
|
* dir before a scoped run writes the permitted set (issue #401, follow-up to
|
package/dist/lib/workflows.js
CHANGED
|
@@ -278,6 +278,30 @@ export function resolveAllowedSubagents(available, allowedAgents) {
|
|
|
278
278
|
missing: allowedAgents.filter(a => !present.has(a)),
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
+
/** The Claude tool an orchestrator uses to dispatch subagents. Must stay in a
|
|
282
|
+
* workflow's `--tools` allowlist whenever the workflow ships dispatchable
|
|
283
|
+
* subagents, or the orchestrator has no way to reach them. */
|
|
284
|
+
export const SUBAGENT_DISPATCH_TOOL = 'Task';
|
|
285
|
+
/**
|
|
286
|
+
* Keep the subagent-dispatch tool (`Task`) in a `tools:`-restricted workflow's
|
|
287
|
+
* allowlist when the workflow actually ships subagents to dispatch.
|
|
288
|
+
*
|
|
289
|
+
* A WORKFLOW.md `tools:` list becomes Claude's `--tools` set, which *restricts*
|
|
290
|
+
* the available built-ins. An orchestrator whose `subagents/` files were just
|
|
291
|
+
* copied into the shared agents dir but whose `tools:` omits `Task` cannot
|
|
292
|
+
* reach any of them — it silently no-ops (observed: the run emits only "I'll
|
|
293
|
+
* wait for the completion notification" and exits). Omitting `Task` while
|
|
294
|
+
* shipping a `subagents/` dir is always an authoring miss, so we re-add it at
|
|
295
|
+
* the source rather than relying on every workflow author to remember.
|
|
296
|
+
*
|
|
297
|
+
* Returns `tools` unchanged when the workflow has no subagents or already lists
|
|
298
|
+
* `Task`; otherwise appends `Task`.
|
|
299
|
+
*/
|
|
300
|
+
export function ensureSubagentDispatchTool(tools, hasSubagents) {
|
|
301
|
+
if (!hasSubagents || tools.includes(SUBAGENT_DISPATCH_TOOL))
|
|
302
|
+
return tools;
|
|
303
|
+
return [...tools, SUBAGENT_DISPATCH_TOOL];
|
|
304
|
+
}
|
|
281
305
|
/**
|
|
282
306
|
* Prune stale workflow-managed subagent files from the shared per-agent agents
|
|
283
307
|
* dir before a scoped run writes the permitted set (issue #401, follow-up to
|
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.65",
|
|
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",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"prepack": "cp ../../README.md README.md && scripts/verify-keychain-helper.sh && scripts/verify-menubar-helper.sh && scripts/verify-cli-binary.sh",
|
|
52
52
|
"postinstall": "node scripts/postinstall.js",
|
|
53
53
|
"dev": "tsx src/index.ts",
|
|
54
|
+
"changelog": "bun scripts/gen-changelog.ts",
|
|
54
55
|
"start": "node dist/index.js",
|
|
55
56
|
"test": "node ./node_modules/vitest/vitest.mjs run",
|
|
56
57
|
"test:remote": "scripts/sandbox.sh 'bun install && bun run build && bun run test'",
|