@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.
Files changed (111) hide show
  1. package/CHANGELOG.md +143 -39
  2. package/README.md +6 -6
  3. package/dist/commands/alias.js +2 -2
  4. package/dist/commands/browser-picker.d.ts +21 -0
  5. package/dist/commands/browser-picker.js +114 -0
  6. package/dist/commands/browser.js +793 -83
  7. package/dist/commands/cloud.js +8 -0
  8. package/dist/commands/commands.js +72 -22
  9. package/dist/commands/daemon.js +2 -2
  10. package/dist/commands/exec.js +70 -1
  11. package/dist/commands/hooks.js +71 -26
  12. package/dist/commands/mcp.js +81 -39
  13. package/dist/commands/plugins.js +224 -17
  14. package/dist/commands/prune.js +29 -1
  15. package/dist/commands/pull.js +3 -3
  16. package/dist/commands/repo.js +1 -1
  17. package/dist/commands/routines.js +2 -2
  18. package/dist/commands/secrets.js +154 -20
  19. package/dist/commands/sessions.js +62 -19
  20. package/dist/commands/{init.d.ts → setup.d.ts} +7 -6
  21. package/dist/commands/{init.js → setup.js} +22 -21
  22. package/dist/commands/skills.js +60 -19
  23. package/dist/commands/subagents.js +41 -13
  24. package/dist/commands/utils.d.ts +16 -0
  25. package/dist/commands/utils.js +32 -0
  26. package/dist/commands/view.js +78 -20
  27. package/dist/commands/workflows.d.ts +10 -0
  28. package/dist/commands/workflows.js +457 -0
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +48 -36
  31. package/dist/lib/agents.js +2 -2
  32. package/dist/lib/auto-pull-worker.js +2 -3
  33. package/dist/lib/auto-pull.js +2 -2
  34. package/dist/lib/browser/cdp.d.ts +7 -1
  35. package/dist/lib/browser/cdp.js +32 -1
  36. package/dist/lib/browser/chrome.d.ts +10 -0
  37. package/dist/lib/browser/chrome.js +41 -3
  38. package/dist/lib/browser/devices.d.ts +4 -0
  39. package/dist/lib/browser/devices.js +27 -0
  40. package/dist/lib/browser/drivers/local.js +22 -6
  41. package/dist/lib/browser/drivers/ssh.js +9 -2
  42. package/dist/lib/browser/input.d.ts +1 -0
  43. package/dist/lib/browser/input.js +3 -0
  44. package/dist/lib/browser/ipc.js +158 -23
  45. package/dist/lib/browser/profiles.d.ts +10 -2
  46. package/dist/lib/browser/profiles.js +122 -37
  47. package/dist/lib/browser/service.d.ts +91 -13
  48. package/dist/lib/browser/service.js +767 -132
  49. package/dist/lib/browser/types.d.ts +91 -3
  50. package/dist/lib/browser/types.js +16 -0
  51. package/dist/lib/cloud/rush.d.ts +28 -1
  52. package/dist/lib/cloud/rush.js +69 -14
  53. package/dist/lib/cloud/store.js +2 -2
  54. package/dist/lib/commands.d.ts +1 -15
  55. package/dist/lib/commands.js +11 -7
  56. package/dist/lib/daemon.js +2 -3
  57. package/dist/lib/doctor-diff.js +4 -4
  58. package/dist/lib/events.js +2 -2
  59. package/dist/lib/hooks.d.ts +11 -7
  60. package/dist/lib/hooks.js +138 -49
  61. package/dist/lib/migrate.d.ts +1 -1
  62. package/dist/lib/migrate.js +1237 -22
  63. package/dist/lib/models.js +2 -2
  64. package/dist/lib/permissions.d.ts +8 -66
  65. package/dist/lib/permissions.js +18 -18
  66. package/dist/lib/plugins.d.ts +94 -24
  67. package/dist/lib/plugins.js +702 -123
  68. package/dist/lib/pty-server.js +9 -10
  69. package/dist/lib/resource-patterns.d.ts +41 -0
  70. package/dist/lib/resource-patterns.js +82 -0
  71. package/dist/lib/resources/hooks.d.ts +5 -1
  72. package/dist/lib/resources/hooks.js +21 -4
  73. package/dist/lib/resources/index.d.ts +17 -0
  74. package/dist/lib/resources/index.js +7 -0
  75. package/dist/lib/resources/types.d.ts +1 -1
  76. package/dist/lib/resources/workflows.d.ts +24 -0
  77. package/dist/lib/resources/workflows.js +110 -0
  78. package/dist/lib/resources.d.ts +6 -1
  79. package/dist/lib/resources.js +12 -2
  80. package/dist/lib/rotate.js +3 -4
  81. package/dist/lib/session/active.d.ts +3 -0
  82. package/dist/lib/session/active.js +92 -6
  83. package/dist/lib/session/cloud.js +2 -2
  84. package/dist/lib/session/db.d.ts +18 -0
  85. package/dist/lib/session/db.js +109 -5
  86. package/dist/lib/session/discover.d.ts +6 -0
  87. package/dist/lib/session/discover.js +55 -29
  88. package/dist/lib/session/team-filter.js +2 -2
  89. package/dist/lib/shims.d.ts +4 -52
  90. package/dist/lib/shims.js +23 -15
  91. package/dist/lib/skills.js +6 -2
  92. package/dist/lib/sqlite.js +10 -4
  93. package/dist/lib/state.d.ts +101 -16
  94. package/dist/lib/state.js +179 -31
  95. package/dist/lib/subagents.d.ts +28 -0
  96. package/dist/lib/subagents.js +98 -1
  97. package/dist/lib/sync-manifest.d.ts +1 -1
  98. package/dist/lib/sync-manifest.js +3 -3
  99. package/dist/lib/teams/persistence.js +15 -5
  100. package/dist/lib/teams/registry.js +2 -2
  101. package/dist/lib/types.d.ts +75 -17
  102. package/dist/lib/types.js +3 -3
  103. package/dist/lib/usage.js +2 -2
  104. package/dist/lib/versions.d.ts +3 -0
  105. package/dist/lib/versions.js +158 -47
  106. package/dist/lib/workflows.d.ts +79 -0
  107. package/dist/lib/workflows.js +233 -0
  108. package/package.json +1 -5
  109. package/scripts/postinstall.js +60 -59
  110. package/dist/commands/fork.d.ts +0 -10
  111. package/dist/commands/fork.js +0 -146
@@ -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
+ };
@@ -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
- permissionSet: string | null;
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 { getActivePermissionSetName } from './permissions.js';
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
- permissionSet: getActivePermissionSetName(),
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.permissionSet !== getActivePermissionSetName())
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 { getUserAgentsDir } from '../state.js';
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 data lives under ~/.agents/teams/
66
- const TEAMS_DIR = path.join(getUserAgentsDir(), 'teams');
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 base = await resolveBaseDir();
104
- return path.join(base, 'agents');
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 { getUserAgentsDir } from '../state.js';
13
+ import { getTeamsDir } from '../state.js';
14
14
  async function registryPath() {
15
- return path.join(getUserAgentsDir(), 'teams', 'registry.json');
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
@@ -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:muqsitnawaz/.agents-system";
190
- /** Mirror system repo (phnx-labs) will become the default once fully released. */
191
- export declare const MIRROR_SYSTEM_REPO = "gh:phnx-labs/.agents-system";
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
- /** Map of resource names synced to a specific agent version, keyed by type. */
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 for this agent@version. The composer reads layered
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.yaml) at the root of a plugin bundle. */
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:muqsitnawaz/.agents-system';
10
- /** Mirror system repo (phnx-labs) will become the default once fully released. */
11
- export const MIRROR_SYSTEM_REPO = 'gh:phnx-labs/.agents-system';
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 { getAgentsDir } from './state.js';
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(getAgentsDir(), 'cache', 'claude-usage.json');
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;
@@ -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 {