@phnx-labs/agents-cli 1.15.0 → 1.17.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/CHANGELOG.md +143 -39
- package/README.md +6 -6
- package/dist/commands/alias.js +2 -2
- package/dist/commands/browser-picker.d.ts +21 -0
- package/dist/commands/browser-picker.js +114 -0
- package/dist/commands/browser.js +793 -83
- package/dist/commands/cloud.js +8 -0
- package/dist/commands/commands.js +72 -22
- package/dist/commands/daemon.js +2 -2
- package/dist/commands/exec.js +70 -1
- package/dist/commands/hooks.js +71 -26
- package/dist/commands/mcp.js +81 -39
- package/dist/commands/plugins.js +224 -17
- package/dist/commands/prune.js +29 -1
- package/dist/commands/pull.js +3 -3
- package/dist/commands/repo.js +1 -1
- package/dist/commands/routines.js +2 -2
- package/dist/commands/secrets.js +154 -20
- package/dist/commands/sessions.js +62 -19
- package/dist/commands/{init.d.ts → setup.d.ts} +7 -6
- package/dist/commands/{init.js → setup.js} +22 -21
- package/dist/commands/skills.js +60 -19
- package/dist/commands/subagents.js +41 -13
- package/dist/commands/utils.d.ts +16 -0
- package/dist/commands/utils.js +32 -0
- package/dist/commands/view.js +78 -20
- package/dist/commands/workflows.d.ts +10 -0
- package/dist/commands/workflows.js +457 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +48 -36
- package/dist/lib/agents.js +2 -2
- package/dist/lib/auto-pull-worker.js +2 -3
- package/dist/lib/auto-pull.js +2 -2
- package/dist/lib/browser/cdp.d.ts +7 -1
- package/dist/lib/browser/cdp.js +32 -1
- package/dist/lib/browser/chrome.d.ts +10 -0
- package/dist/lib/browser/chrome.js +41 -3
- package/dist/lib/browser/devices.d.ts +4 -0
- package/dist/lib/browser/devices.js +27 -0
- package/dist/lib/browser/drivers/local.js +22 -6
- package/dist/lib/browser/drivers/ssh.js +9 -2
- package/dist/lib/browser/input.d.ts +1 -0
- package/dist/lib/browser/input.js +3 -0
- package/dist/lib/browser/ipc.js +158 -23
- package/dist/lib/browser/profiles.d.ts +10 -2
- package/dist/lib/browser/profiles.js +122 -37
- package/dist/lib/browser/service.d.ts +91 -13
- package/dist/lib/browser/service.js +767 -132
- package/dist/lib/browser/types.d.ts +91 -3
- package/dist/lib/browser/types.js +16 -0
- package/dist/lib/cloud/rush.d.ts +28 -1
- package/dist/lib/cloud/rush.js +69 -14
- package/dist/lib/cloud/store.js +2 -2
- package/dist/lib/commands.d.ts +1 -15
- package/dist/lib/commands.js +11 -7
- package/dist/lib/daemon.js +2 -3
- package/dist/lib/doctor-diff.js +4 -4
- package/dist/lib/events.js +2 -2
- package/dist/lib/hooks.d.ts +11 -7
- package/dist/lib/hooks.js +138 -49
- package/dist/lib/migrate.d.ts +1 -1
- package/dist/lib/migrate.js +1237 -22
- package/dist/lib/models.js +2 -2
- package/dist/lib/permissions.d.ts +8 -66
- package/dist/lib/permissions.js +18 -18
- package/dist/lib/plugins.d.ts +94 -24
- package/dist/lib/plugins.js +702 -123
- package/dist/lib/pty-server.js +9 -10
- package/dist/lib/resource-patterns.d.ts +41 -0
- package/dist/lib/resource-patterns.js +82 -0
- package/dist/lib/resources/hooks.d.ts +5 -1
- package/dist/lib/resources/hooks.js +21 -4
- package/dist/lib/resources/index.d.ts +17 -0
- package/dist/lib/resources/index.js +7 -0
- package/dist/lib/resources/types.d.ts +1 -1
- package/dist/lib/resources/workflows.d.ts +24 -0
- package/dist/lib/resources/workflows.js +110 -0
- package/dist/lib/resources.d.ts +6 -1
- package/dist/lib/resources.js +12 -2
- package/dist/lib/rotate.js +3 -4
- package/dist/lib/session/active.d.ts +3 -0
- package/dist/lib/session/active.js +92 -6
- package/dist/lib/session/cloud.js +2 -2
- package/dist/lib/session/db.d.ts +18 -0
- package/dist/lib/session/db.js +109 -5
- package/dist/lib/session/discover.d.ts +6 -0
- package/dist/lib/session/discover.js +55 -29
- package/dist/lib/session/team-filter.js +2 -2
- package/dist/lib/shims.d.ts +4 -52
- package/dist/lib/shims.js +23 -15
- package/dist/lib/skills.js +6 -2
- package/dist/lib/sqlite.js +10 -4
- package/dist/lib/state.d.ts +101 -16
- package/dist/lib/state.js +179 -31
- package/dist/lib/subagents.d.ts +28 -0
- package/dist/lib/subagents.js +98 -1
- package/dist/lib/sync-manifest.d.ts +1 -1
- package/dist/lib/sync-manifest.js +3 -3
- package/dist/lib/teams/persistence.js +15 -5
- package/dist/lib/teams/registry.js +2 -2
- package/dist/lib/types.d.ts +75 -17
- package/dist/lib/types.js +3 -3
- package/dist/lib/usage.js +2 -2
- package/dist/lib/versions.d.ts +3 -0
- package/dist/lib/versions.js +158 -47
- package/dist/lib/workflows.d.ts +79 -0
- package/dist/lib/workflows.js +233 -0
- package/package.json +1 -5
- package/scripts/postinstall.js +60 -59
- package/dist/commands/fork.d.ts +0 -10
- package/dist/commands/fork.js +0 -146
package/dist/lib/subagents.d.ts
CHANGED
|
@@ -81,3 +81,31 @@ export declare const SUBAGENT_CAPABLE_AGENTS: AgentId[];
|
|
|
81
81
|
* OpenClaw: scans ~/.openclaw/{name}/AGENTS.md
|
|
82
82
|
*/
|
|
83
83
|
export declare function listSubagentsForAgent(agentId: AgentId, home: string): InstalledSubagent[];
|
|
84
|
+
export interface VersionSubagentDiff {
|
|
85
|
+
agent: AgentId;
|
|
86
|
+
version: string;
|
|
87
|
+
orphans: string[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Compare a version home's subagents against discovered subagents.
|
|
91
|
+
* Returns orphan subagent names.
|
|
92
|
+
*/
|
|
93
|
+
export declare function diffVersionSubagents(agent: AgentId, version: string): VersionSubagentDiff;
|
|
94
|
+
/**
|
|
95
|
+
* Iterate all (agent, version) pairs that support subagents and are installed.
|
|
96
|
+
*/
|
|
97
|
+
export declare function iterSubagentsCapableVersions(filter?: {
|
|
98
|
+
agent?: AgentId;
|
|
99
|
+
version?: string;
|
|
100
|
+
}): Array<{
|
|
101
|
+
agent: AgentId;
|
|
102
|
+
version: string;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Remove a single subagent from a specific version home.
|
|
106
|
+
* Soft-deletes to ~/.agents/.trash/subagents/.
|
|
107
|
+
*/
|
|
108
|
+
export declare function removeSubagentFromVersion(agent: AgentId, version: string, subagentName: string): {
|
|
109
|
+
success: boolean;
|
|
110
|
+
error?: string;
|
|
111
|
+
};
|
package/dist/lib/subagents.js
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import * as fs from 'fs';
|
|
10
10
|
import * as path from 'path';
|
|
11
11
|
import * as yaml from 'yaml';
|
|
12
|
-
import { getSubagentsDir, getUserSubagentsDir } from './state.js';
|
|
12
|
+
import { getSubagentsDir, getUserSubagentsDir, getTrashSubagentsDir } from './state.js';
|
|
13
|
+
import { listInstalledVersions, getVersionHomePath } from './versions.js';
|
|
13
14
|
import { safeJoin } from './paths.js';
|
|
14
15
|
/**
|
|
15
16
|
* Parse AGENT.md frontmatter to extract subagent metadata
|
|
@@ -407,3 +408,99 @@ export function listSubagentsForAgent(agentId, home) {
|
|
|
407
408
|
}
|
|
408
409
|
return subagents;
|
|
409
410
|
}
|
|
411
|
+
// Agents that support subagents
|
|
412
|
+
const SUBAGENTS_CAPABLE_AGENTS = ['claude', 'openclaw'];
|
|
413
|
+
/**
|
|
414
|
+
* Compare a version home's subagents against discovered subagents.
|
|
415
|
+
* Returns orphan subagent names.
|
|
416
|
+
*/
|
|
417
|
+
export function diffVersionSubagents(agent, version) {
|
|
418
|
+
const versionHome = getVersionHomePath(agent, version);
|
|
419
|
+
const orphans = [];
|
|
420
|
+
// Get all discovered subagent names
|
|
421
|
+
const discovered = new Set();
|
|
422
|
+
for (const dir of [getSubagentsDir(), getUserSubagentsDir()]) {
|
|
423
|
+
if (fs.existsSync(dir)) {
|
|
424
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
425
|
+
if (entry.isDirectory()) {
|
|
426
|
+
discovered.add(entry.name);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
// Check what's installed
|
|
432
|
+
if (agent === 'claude') {
|
|
433
|
+
const agentsDir = path.join(versionHome, '.claude', 'agents');
|
|
434
|
+
if (fs.existsSync(agentsDir)) {
|
|
435
|
+
for (const file of fs.readdirSync(agentsDir)) {
|
|
436
|
+
if (!file.endsWith('.md'))
|
|
437
|
+
continue;
|
|
438
|
+
const name = path.basename(file, '.md');
|
|
439
|
+
if (!discovered.has(name)) {
|
|
440
|
+
orphans.push(name);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
else if (agent === 'openclaw') {
|
|
446
|
+
const openclawDir = path.join(versionHome, '.openclaw');
|
|
447
|
+
if (fs.existsSync(openclawDir)) {
|
|
448
|
+
for (const entry of fs.readdirSync(openclawDir, { withFileTypes: true })) {
|
|
449
|
+
if (!entry.isDirectory())
|
|
450
|
+
continue;
|
|
451
|
+
if (!discovered.has(entry.name)) {
|
|
452
|
+
orphans.push(entry.name);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return { agent, version, orphans: orphans.sort() };
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Iterate all (agent, version) pairs that support subagents and are installed.
|
|
461
|
+
*/
|
|
462
|
+
export function iterSubagentsCapableVersions(filter) {
|
|
463
|
+
const pairs = [];
|
|
464
|
+
const agents = filter?.agent ? [filter.agent] : SUBAGENTS_CAPABLE_AGENTS;
|
|
465
|
+
for (const agent of agents) {
|
|
466
|
+
if (!SUBAGENTS_CAPABLE_AGENTS.includes(agent))
|
|
467
|
+
continue;
|
|
468
|
+
const versions = listInstalledVersions(agent);
|
|
469
|
+
for (const version of versions) {
|
|
470
|
+
if (filter?.version && filter.version !== version)
|
|
471
|
+
continue;
|
|
472
|
+
pairs.push({ agent, version });
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return pairs;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Remove a single subagent from a specific version home.
|
|
479
|
+
* Soft-deletes to ~/.agents/.trash/subagents/.
|
|
480
|
+
*/
|
|
481
|
+
export function removeSubagentFromVersion(agent, version, subagentName) {
|
|
482
|
+
const versionHome = getVersionHomePath(agent, version);
|
|
483
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
484
|
+
const trashDir = path.join(getTrashSubagentsDir(), agent, version, subagentName);
|
|
485
|
+
try {
|
|
486
|
+
if (agent === 'claude') {
|
|
487
|
+
const targetPath = path.join(versionHome, '.claude', 'agents', `${subagentName}.md`);
|
|
488
|
+
if (fs.existsSync(targetPath)) {
|
|
489
|
+
fs.mkdirSync(trashDir, { recursive: true, mode: 0o700 });
|
|
490
|
+
fs.renameSync(targetPath, path.join(trashDir, `${subagentName}.md.${stamp}`));
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
else if (agent === 'openclaw') {
|
|
494
|
+
const targetDir = path.join(versionHome, '.openclaw', subagentName);
|
|
495
|
+
if (fs.existsSync(targetDir)) {
|
|
496
|
+
const trashDest = path.join(trashDir, stamp);
|
|
497
|
+
fs.mkdirSync(trashDir, { recursive: true, mode: 0o700 });
|
|
498
|
+
fs.renameSync(targetDir, trashDest);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return { success: true };
|
|
502
|
+
}
|
|
503
|
+
catch (err) {
|
|
504
|
+
return { success: false, error: err.message };
|
|
505
|
+
}
|
|
506
|
+
}
|
|
@@ -47,7 +47,7 @@ interface RulesEntry {
|
|
|
47
47
|
/** Permissions: all group files across all scopes (merged). */
|
|
48
48
|
interface PermEntry {
|
|
49
49
|
groups: Record<string, FileEntry>;
|
|
50
|
-
|
|
50
|
+
permissionPreset: string | null;
|
|
51
51
|
}
|
|
52
52
|
export interface SyncManifest {
|
|
53
53
|
v: typeof MANIFEST_VERSION;
|
|
@@ -28,7 +28,7 @@ import { getVersionsDir, getProjectAgentsDir, getUserAgentsDir, getSkillsDir, ge
|
|
|
28
28
|
import { resolveResource } from './resources.js';
|
|
29
29
|
import { listMcpServerConfigs } from './mcp.js';
|
|
30
30
|
import { isRulesStale } from './rules/compile.js';
|
|
31
|
-
import {
|
|
31
|
+
import { getActivePermissionPresetName } from './permissions.js';
|
|
32
32
|
import { listInstalledSubagents } from './subagents.js';
|
|
33
33
|
import { safeJoin } from './paths.js';
|
|
34
34
|
// ─── Types ────────────────────────────────────────────────────────────────────
|
|
@@ -341,7 +341,7 @@ export function buildManifest(agent, version, available, cwd) {
|
|
|
341
341
|
mcp,
|
|
342
342
|
permissions: {
|
|
343
343
|
groups: permGroups,
|
|
344
|
-
|
|
344
|
+
permissionPreset: getActivePermissionPresetName(),
|
|
345
345
|
},
|
|
346
346
|
subagents,
|
|
347
347
|
};
|
|
@@ -420,7 +420,7 @@ export function isSyncStale(manifest, available, agent, version, cwd) {
|
|
|
420
420
|
return true;
|
|
421
421
|
}
|
|
422
422
|
// ── Permissions ───────────────────────────────────────────────────────────
|
|
423
|
-
if (manifest.permissions.
|
|
423
|
+
if (manifest.permissions.permissionPreset !== getActivePermissionPresetName())
|
|
424
424
|
return true;
|
|
425
425
|
const currentGroups = collectPermissionGroupFiles();
|
|
426
426
|
if (nameSetDiffers(Object.keys(manifest.permissions.groups), Object.keys(currentGroups)))
|
|
@@ -13,7 +13,7 @@ import { homedir, tmpdir } from 'os';
|
|
|
13
13
|
import { constants as fsConstants } from 'fs';
|
|
14
14
|
import { randomBytes } from 'crypto';
|
|
15
15
|
import lockfile from 'proper-lockfile';
|
|
16
|
-
import {
|
|
16
|
+
import { getTeamsDir, getTeamsAgentsDir } from '../state.js';
|
|
17
17
|
/**
|
|
18
18
|
* Atomic JSON write: writes to a sibling tmp file then renames over the
|
|
19
19
|
* target. rename(2) is atomic on POSIX, so a crashed/interrupted write
|
|
@@ -62,8 +62,9 @@ async function withConfigLock(p, fn) {
|
|
|
62
62
|
}
|
|
63
63
|
// All supported teammate agent types
|
|
64
64
|
const ALL_AGENTS = ['claude', 'codex', 'gemini', 'cursor', 'opencode'];
|
|
65
|
-
// Teams
|
|
66
|
-
|
|
65
|
+
// Teams config + registry live under ~/.agents/teams/ (definitions);
|
|
66
|
+
// per-run agent execution dirs live under ~/.agents/.history/teams/agents/.
|
|
67
|
+
const TEAMS_DIR = getTeamsDir();
|
|
67
68
|
// Legacy paths (for migration)
|
|
68
69
|
const LEGACY_CONFIG_DIR = path.join(homedir(), '.agents');
|
|
69
70
|
// Legacy migration from pre-OSS brand; safe to remove after 2026-07
|
|
@@ -100,8 +101,17 @@ export async function resolveBaseDir() {
|
|
|
100
101
|
throw new Error('Unable to determine a writable data directory for teams');
|
|
101
102
|
}
|
|
102
103
|
async function resolveAgentsPath() {
|
|
103
|
-
const
|
|
104
|
-
|
|
104
|
+
const historyAgents = getTeamsAgentsDir();
|
|
105
|
+
if (await ensureWritableDir(historyAgents)) {
|
|
106
|
+
return historyAgents;
|
|
107
|
+
}
|
|
108
|
+
// Last-resort temp fallback so dispatch keeps working when ~/.agents is unwritable.
|
|
109
|
+
const tmpAgents = path.join(TMP_FALLBACK_DIR, 'agents');
|
|
110
|
+
if (await ensureWritableDir(tmpAgents)) {
|
|
111
|
+
console.warn(`[agents teams] Falling back to temp agents dir at ${tmpAgents}`);
|
|
112
|
+
return tmpAgents;
|
|
113
|
+
}
|
|
114
|
+
throw new Error('Unable to determine a writable agents directory');
|
|
105
115
|
}
|
|
106
116
|
async function resolveConfigPath() {
|
|
107
117
|
await fs.mkdir(TEAMS_DIR, { recursive: true });
|
|
@@ -10,9 +10,9 @@ import * as fsSync from 'fs';
|
|
|
10
10
|
import * as path from 'path';
|
|
11
11
|
import { randomBytes } from 'crypto';
|
|
12
12
|
import lockfile from 'proper-lockfile';
|
|
13
|
-
import {
|
|
13
|
+
import { getTeamsDir } from '../state.js';
|
|
14
14
|
async function registryPath() {
|
|
15
|
-
return path.join(
|
|
15
|
+
return path.join(getTeamsDir(), 'registry.json');
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Atomic JSON write: writes to a unique sibling tmp file then renames over
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -186,9 +186,9 @@ export interface RepoInfo {
|
|
|
186
186
|
lastSync: string;
|
|
187
187
|
}
|
|
188
188
|
/** Canonical system repo cloned into ~/.agents-system/. */
|
|
189
|
-
export declare const DEFAULT_SYSTEM_REPO = "gh:
|
|
190
|
-
/**
|
|
191
|
-
export declare const MIRROR_SYSTEM_REPO = "gh:
|
|
189
|
+
export declare const DEFAULT_SYSTEM_REPO = "gh:phnx-labs/.agents-system";
|
|
190
|
+
/** Legacy system repo — kept so existing installs still recognize their origin. */
|
|
191
|
+
export declare const MIRROR_SYSTEM_REPO = "gh:muqsitnawaz/.agents-system";
|
|
192
192
|
/** Strip the `gh:` prefix and `.git` suffix to get a GitHub `owner/repo` slug. */
|
|
193
193
|
export declare function systemRepoSlug(repo?: string): string;
|
|
194
194
|
/** Kind of package that can be searched and installed from a registry. */
|
|
@@ -288,30 +288,49 @@ export interface ResolvedPackage {
|
|
|
288
288
|
skillEntry?: SkillEntry;
|
|
289
289
|
}
|
|
290
290
|
/** Categories of resources that can be synced into an agent version home. */
|
|
291
|
-
export type ResourceType = 'commands' | 'skills' | 'hooks' | 'memory' | 'mcp' | 'permissions' | 'subagents' | 'plugins';
|
|
292
|
-
/**
|
|
291
|
+
export type ResourceType = 'commands' | 'skills' | 'hooks' | 'memory' | 'mcp' | 'permissions' | 'subagents' | 'plugins' | 'workflows';
|
|
292
|
+
/**
|
|
293
|
+
* A resource selection pattern stored in agents.yaml versions:
|
|
294
|
+
* "system:*" — all resources from ~/.agents-system/
|
|
295
|
+
* "user:*" — all resources from ~/.agents/
|
|
296
|
+
* "rush:*" — all resources from ~/.agents-rush/ (extra repo alias)
|
|
297
|
+
* "project:*" — all resources from .agents/ in the project root
|
|
298
|
+
* "user:foo" — specifically "foo" from ~/.agents/
|
|
299
|
+
* "!user:temp" — exclude "temp" from the user repo
|
|
300
|
+
*/
|
|
301
|
+
export type ResourcePattern = string;
|
|
302
|
+
/** Sync specification for a specific agent@version, keyed by resource type. */
|
|
293
303
|
export interface VersionResources {
|
|
294
|
-
commands?: string[];
|
|
295
|
-
skills?: string[];
|
|
296
|
-
hooks?: string[];
|
|
297
|
-
memory?: string[];
|
|
298
|
-
mcp?: string[];
|
|
299
|
-
permissions?: string[];
|
|
300
|
-
subagents?: string[];
|
|
301
|
-
plugins?: string[];
|
|
302
304
|
/**
|
|
303
|
-
* Active rule preset
|
|
304
|
-
* `rules.yaml` files and emits this preset's subrules as the agent's
|
|
305
|
-
* single instruction file. Absent/null means the literal "default" preset.
|
|
305
|
+
* Active rule preset. Absent/null means "default".
|
|
306
306
|
*/
|
|
307
307
|
rulesPreset?: string;
|
|
308
|
+
skills?: ResourcePattern[];
|
|
309
|
+
commands?: ResourcePattern[];
|
|
310
|
+
hooks?: ResourcePattern[];
|
|
311
|
+
subagents?: ResourcePattern[];
|
|
312
|
+
plugins?: ResourcePattern[];
|
|
313
|
+
workflows?: ResourcePattern[];
|
|
314
|
+
permissions?: ResourcePattern[];
|
|
315
|
+
mcp?: ResourcePattern[];
|
|
316
|
+
}
|
|
317
|
+
/** A userConfig field declared in a plugin manifest. */
|
|
318
|
+
export interface PluginUserConfigField {
|
|
319
|
+
key: string;
|
|
320
|
+
description: string;
|
|
321
|
+
required?: boolean;
|
|
322
|
+
default?: string;
|
|
308
323
|
}
|
|
309
|
-
/** Manifest file (plugin.
|
|
324
|
+
/** Manifest file (plugin.json) at the root of a plugin bundle. */
|
|
310
325
|
export interface PluginManifest {
|
|
311
326
|
name: string;
|
|
312
327
|
description: string;
|
|
313
328
|
version: string;
|
|
314
329
|
agents?: AgentId[];
|
|
330
|
+
/** Interactive config fields prompted at install time. Values stored in .user-config.json. */
|
|
331
|
+
userConfig?: PluginUserConfigField[];
|
|
332
|
+
/** Other plugin names this plugin depends on. Missing deps produce a warning. */
|
|
333
|
+
dependencies?: string[];
|
|
315
334
|
}
|
|
316
335
|
/** A plugin found on disk with its parsed manifest and resource inventory. */
|
|
317
336
|
export interface DiscoveredPlugin {
|
|
@@ -321,6 +340,16 @@ export interface DiscoveredPlugin {
|
|
|
321
340
|
skills: string[];
|
|
322
341
|
hooks: string[];
|
|
323
342
|
scripts: string[];
|
|
343
|
+
/** Slash-command .md files in the plugin's commands/ directory (names without extension). */
|
|
344
|
+
commands: string[];
|
|
345
|
+
/** Subagent .md files in the plugin's agents/ directory (names without extension). */
|
|
346
|
+
agentDefs: string[];
|
|
347
|
+
/** Executable files in the plugin's bin/ directory. */
|
|
348
|
+
bin: string[];
|
|
349
|
+
/** Whether the plugin root contains a .mcp.json file. */
|
|
350
|
+
hasMcp: boolean;
|
|
351
|
+
/** Whether the plugin root contains a settings.json with non-permission keys to merge. */
|
|
352
|
+
hasSettings: boolean;
|
|
324
353
|
}
|
|
325
354
|
/** Frontmatter fields parsed from a subagent's agent.md file. */
|
|
326
355
|
export interface SubagentFrontmatter {
|
|
@@ -378,6 +407,35 @@ export interface Meta {
|
|
|
378
407
|
* once. Tracked so a user `registry remove` won't silently re-seed.
|
|
379
408
|
*/
|
|
380
409
|
seededPresets?: string[];
|
|
410
|
+
/**
|
|
411
|
+
* Hook manifest entries keyed by hook name. Folded into agents.yaml so the
|
|
412
|
+
* user has a single file to sync. Each entry shape matches ManifestHook
|
|
413
|
+
* (script, events, timeout, matches, enabled).
|
|
414
|
+
*/
|
|
415
|
+
hooks?: Record<string, ManifestHook>;
|
|
416
|
+
/**
|
|
417
|
+
* Browser profile definitions keyed by profile name. Portable user config
|
|
418
|
+
* that syncs with `agents repo push/pull`. Runtime state (chrome-data, pids)
|
|
419
|
+
* lives separately in ~/.agents/.cache/browser/<profile>/.
|
|
420
|
+
*/
|
|
421
|
+
browser?: Record<string, BrowserProfileConfig>;
|
|
422
|
+
}
|
|
423
|
+
/** Browser profile definition stored in agents.yaml. */
|
|
424
|
+
export interface BrowserProfileConfig {
|
|
425
|
+
description?: string;
|
|
426
|
+
browser: 'chrome' | 'comet' | 'chromium' | 'brave' | 'edge' | 'custom';
|
|
427
|
+
binary?: string;
|
|
428
|
+
electron?: boolean;
|
|
429
|
+
endpoints: string[];
|
|
430
|
+
chrome?: {
|
|
431
|
+
headless?: boolean;
|
|
432
|
+
args?: string[];
|
|
433
|
+
};
|
|
434
|
+
secrets?: string;
|
|
435
|
+
viewport?: {
|
|
436
|
+
width: number;
|
|
437
|
+
height: number;
|
|
438
|
+
};
|
|
381
439
|
}
|
|
382
440
|
/** Options controlling which agents and resources are synced during `agents pull` / `agents use`. */
|
|
383
441
|
export interface SyncOptions {
|
package/dist/lib/types.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* formats for each supported agent.
|
|
7
7
|
*/
|
|
8
8
|
/** Canonical system repo cloned into ~/.agents-system/. */
|
|
9
|
-
export const DEFAULT_SYSTEM_REPO = 'gh:
|
|
10
|
-
/**
|
|
11
|
-
export const MIRROR_SYSTEM_REPO = 'gh:
|
|
9
|
+
export const DEFAULT_SYSTEM_REPO = 'gh:phnx-labs/.agents-system';
|
|
10
|
+
/** Legacy system repo — kept so existing installs still recognize their origin. */
|
|
11
|
+
export const MIRROR_SYSTEM_REPO = 'gh:muqsitnawaz/.agents-system';
|
|
12
12
|
/** Strip the `gh:` prefix and `.git` suffix to get a GitHub `owner/repo` slug. */
|
|
13
13
|
export function systemRepoSlug(repo = DEFAULT_SYSTEM_REPO) {
|
|
14
14
|
return repo.replace(/^gh:/, '').replace(/\.git$/, '');
|
package/dist/lib/usage.js
CHANGED
|
@@ -16,7 +16,7 @@ import { promisify } from 'util';
|
|
|
16
16
|
import chalk from 'chalk';
|
|
17
17
|
import { walkForFiles } from './fs-walk.js';
|
|
18
18
|
import { getKeychainToken, setKeychainToken, deleteKeychainToken, } from './secrets/index.js';
|
|
19
|
-
import {
|
|
19
|
+
import { getCacheDir } from './state.js';
|
|
20
20
|
const execFileAsync = promisify(execFile);
|
|
21
21
|
const CLAUDE_USAGE_URL = 'https://api.anthropic.com/api/oauth/usage';
|
|
22
22
|
const CLAUDE_TOKEN_URL = 'https://platform.claude.com/v1/oauth/token';
|
|
@@ -31,7 +31,7 @@ const CLAUDE_SCOPES = [
|
|
|
31
31
|
'user:file_upload',
|
|
32
32
|
];
|
|
33
33
|
const CLAUDE_KEYCHAIN_SERVICE = 'Claude Code-credentials';
|
|
34
|
-
const getClaudeUsageCachePath = () => path.join(
|
|
34
|
+
const getClaudeUsageCachePath = () => path.join(getCacheDir(), 'claude-usage.json');
|
|
35
35
|
const CACHED_CLAUDE_USAGE_SOURCE_LABEL = 'last seen live account data';
|
|
36
36
|
const COMPACT_BAR_LEN = 5;
|
|
37
37
|
const USAGE_BAR_LEN = 10;
|
package/dist/lib/versions.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface ResourceSelection {
|
|
|
15
15
|
permissions?: string[] | 'all';
|
|
16
16
|
subagents?: string[] | 'all';
|
|
17
17
|
plugins?: string[] | 'all';
|
|
18
|
+
workflows?: string[] | 'all';
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Available resources in ~/.agents/ for syncing.
|
|
@@ -33,6 +34,7 @@ export interface AvailableResources {
|
|
|
33
34
|
permissions: string[];
|
|
34
35
|
subagents: string[];
|
|
35
36
|
plugins: string[];
|
|
37
|
+
workflows: string[];
|
|
36
38
|
promptcuts: boolean;
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
@@ -215,6 +217,7 @@ export interface SyncResult {
|
|
|
215
217
|
mcp: string[];
|
|
216
218
|
subagents: string[];
|
|
217
219
|
plugins: string[];
|
|
220
|
+
workflows: string[];
|
|
218
221
|
}
|
|
219
222
|
/** Diff between central ~/.agents/ resources and what is synced to a version home. */
|
|
220
223
|
export interface ResourceDiff {
|