@phnx-labs/agents-cli 1.19.2 → 1.20.3

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 (156) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/README.md +72 -12
  3. package/dist/browser.js +0 -0
  4. package/dist/commands/browser.js +88 -16
  5. package/dist/commands/cli.d.ts +14 -0
  6. package/dist/commands/cli.js +244 -0
  7. package/dist/commands/cloud.js +1 -1
  8. package/dist/commands/commands.js +27 -10
  9. package/dist/commands/computer.js +18 -1
  10. package/dist/commands/doctor.d.ts +1 -1
  11. package/dist/commands/doctor.js +2 -2
  12. package/dist/commands/exec.js +38 -18
  13. package/dist/commands/factory.d.ts +3 -14
  14. package/dist/commands/factory.js +3 -3
  15. package/dist/commands/feedback.d.ts +7 -0
  16. package/dist/commands/feedback.js +89 -0
  17. package/dist/commands/helper.d.ts +12 -0
  18. package/dist/commands/helper.js +87 -0
  19. package/dist/commands/hooks.js +89 -10
  20. package/dist/commands/mcp.js +166 -10
  21. package/dist/commands/packages.js +196 -27
  22. package/dist/commands/permissions.js +21 -6
  23. package/dist/commands/plugins.js +11 -4
  24. package/dist/commands/profiles.d.ts +8 -0
  25. package/dist/commands/profiles.js +118 -5
  26. package/dist/commands/prune.js +39 -160
  27. package/dist/commands/pull.js +58 -5
  28. package/dist/commands/routines.js +107 -14
  29. package/dist/commands/rules.js +8 -4
  30. package/dist/commands/secrets-migrate.d.ts +24 -0
  31. package/dist/commands/secrets-migrate.js +198 -0
  32. package/dist/commands/secrets-sync.d.ts +11 -0
  33. package/dist/commands/secrets-sync.js +155 -0
  34. package/dist/commands/secrets.js +79 -46
  35. package/dist/commands/sessions.d.ts +28 -0
  36. package/dist/commands/sessions.js +98 -33
  37. package/dist/commands/setup.d.ts +1 -0
  38. package/dist/commands/setup.js +37 -28
  39. package/dist/commands/skills.js +25 -8
  40. package/dist/commands/subagents.js +69 -49
  41. package/dist/commands/teams.js +61 -10
  42. package/dist/commands/utils.d.ts +33 -0
  43. package/dist/commands/utils.js +139 -0
  44. package/dist/commands/versions.d.ts +4 -3
  45. package/dist/commands/versions.js +134 -130
  46. package/dist/commands/view.d.ts +6 -0
  47. package/dist/commands/view.js +175 -19
  48. package/dist/commands/workflows.js +29 -6
  49. package/dist/computer.js +0 -0
  50. package/dist/index.js +38 -6
  51. package/dist/lib/acp/client.js +6 -1
  52. package/dist/lib/acp/harnesses.js +8 -0
  53. package/dist/lib/agents.d.ts +4 -0
  54. package/dist/lib/agents.js +125 -34
  55. package/dist/lib/auto-pull-worker.js +18 -1
  56. package/dist/lib/browser/cdp.d.ts +8 -1
  57. package/dist/lib/browser/cdp.js +40 -3
  58. package/dist/lib/browser/chrome.d.ts +13 -0
  59. package/dist/lib/browser/chrome.js +46 -3
  60. package/dist/lib/browser/domain-skills.d.ts +51 -0
  61. package/dist/lib/browser/domain-skills.js +157 -0
  62. package/dist/lib/browser/drivers/local.js +45 -4
  63. package/dist/lib/browser/drivers/ssh.js +2 -2
  64. package/dist/lib/browser/ipc.d.ts +8 -1
  65. package/dist/lib/browser/ipc.js +37 -28
  66. package/dist/lib/browser/profiles.d.ts +16 -3
  67. package/dist/lib/browser/profiles.js +44 -4
  68. package/dist/lib/browser/service.d.ts +3 -0
  69. package/dist/lib/browser/service.js +40 -5
  70. package/dist/lib/browser/types.d.ts +11 -4
  71. package/dist/lib/cli-resources.d.ts +137 -0
  72. package/dist/lib/cli-resources.js +477 -0
  73. package/dist/lib/cloud/factory.d.ts +1 -1
  74. package/dist/lib/cloud/factory.js +1 -1
  75. package/dist/lib/cloud/rush.js +5 -5
  76. package/dist/lib/command-skills.js +0 -2
  77. package/dist/lib/computer-rpc.d.ts +3 -0
  78. package/dist/lib/computer-rpc.js +53 -0
  79. package/dist/lib/daemon.js +20 -0
  80. package/dist/lib/events.d.ts +16 -2
  81. package/dist/lib/events.js +33 -2
  82. package/dist/lib/exec.d.ts +42 -13
  83. package/dist/lib/exec.js +127 -33
  84. package/dist/lib/help.js +11 -5
  85. package/dist/lib/hooks/cache.d.ts +38 -0
  86. package/dist/lib/hooks/cache.js +242 -0
  87. package/dist/lib/hooks/profile.d.ts +33 -0
  88. package/dist/lib/hooks/profile.js +129 -0
  89. package/dist/lib/hooks.d.ts +0 -10
  90. package/dist/lib/hooks.js +246 -11
  91. package/dist/lib/mcp.d.ts +15 -0
  92. package/dist/lib/mcp.js +46 -0
  93. package/dist/lib/migrate.js +1 -1
  94. package/dist/lib/overdue.d.ts +26 -0
  95. package/dist/lib/overdue.js +101 -0
  96. package/dist/lib/permissions.d.ts +13 -0
  97. package/dist/lib/permissions.js +55 -1
  98. package/dist/lib/plugin-marketplace.js +1 -1
  99. package/dist/lib/plugins.js +15 -1
  100. package/dist/lib/profiles-presets.d.ts +26 -0
  101. package/dist/lib/profiles-presets.js +216 -0
  102. package/dist/lib/profiles.d.ts +34 -0
  103. package/dist/lib/profiles.js +112 -1
  104. package/dist/lib/resources/mcp.js +37 -0
  105. package/dist/lib/resources.d.ts +1 -1
  106. package/dist/lib/rotate.js +10 -4
  107. package/dist/lib/routines-format.d.ts +47 -0
  108. package/dist/lib/routines-format.js +194 -0
  109. package/dist/lib/routines.d.ts +8 -2
  110. package/dist/lib/routines.js +34 -14
  111. package/dist/lib/runner.js +83 -15
  112. package/dist/lib/scheduler.js +8 -1
  113. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  114. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  115. package/dist/lib/secrets/Agents CLI.app/Contents/_CodeSignature/CodeResources +1 -9
  116. package/dist/lib/secrets/bundles.d.ts +34 -17
  117. package/dist/lib/secrets/bundles.js +210 -36
  118. package/dist/lib/secrets/index.d.ts +49 -30
  119. package/dist/lib/secrets/index.js +126 -115
  120. package/dist/lib/secrets/install-helper.d.ts +45 -0
  121. package/dist/lib/secrets/install-helper.js +165 -0
  122. package/dist/lib/secrets/linux.js +4 -4
  123. package/dist/lib/secrets/sync.d.ts +56 -0
  124. package/dist/lib/secrets/sync.js +180 -0
  125. package/dist/lib/session/active.d.ts +8 -0
  126. package/dist/lib/session/active.js +3 -2
  127. package/dist/lib/session/db.d.ts +0 -4
  128. package/dist/lib/session/db.js +0 -26
  129. package/dist/lib/session/parse.d.ts +1 -0
  130. package/dist/lib/session/parse.js +44 -0
  131. package/dist/lib/session/render.js +4 -4
  132. package/dist/lib/session/types.d.ts +2 -2
  133. package/dist/lib/session/types.js +1 -1
  134. package/dist/lib/shims.d.ts +5 -2
  135. package/dist/lib/shims.js +70 -38
  136. package/dist/lib/state.d.ts +14 -2
  137. package/dist/lib/state.js +51 -20
  138. package/dist/lib/teams/agents.d.ts +5 -4
  139. package/dist/lib/teams/agents.js +48 -22
  140. package/dist/lib/teams/api.d.ts +2 -1
  141. package/dist/lib/teams/api.js +4 -3
  142. package/dist/lib/teams/parsers.d.ts +1 -1
  143. package/dist/lib/teams/parsers.js +153 -3
  144. package/dist/lib/teams/summarizer.js +18 -2
  145. package/dist/lib/teams/worktree.js +14 -3
  146. package/dist/lib/types.d.ts +63 -4
  147. package/dist/lib/types.js +8 -3
  148. package/dist/lib/usage.d.ts +27 -2
  149. package/dist/lib/usage.js +100 -17
  150. package/dist/lib/versions.d.ts +45 -3
  151. package/dist/lib/versions.js +455 -60
  152. package/package.json +15 -14
  153. package/scripts/install-helper.js +97 -0
  154. package/scripts/postinstall.js +16 -0
  155. package/dist/lib/secrets/Agents CLI.app/Contents/embedded.provisionprofile +0 -0
  156. package/npm-shrinkwrap.json +0 -3162
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.19.2",
4
- "description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams",
3
+ "version": "1.20.3",
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",
7
7
  "exports": {
@@ -24,14 +24,14 @@
24
24
  "dist/**/*.js",
25
25
  "dist/**/*.d.ts",
26
26
  "dist/lib/secrets/Agents CLI.app/**",
27
- "npm-shrinkwrap.json",
28
27
  "scripts/postinstall.js",
28
+ "scripts/install-helper.js",
29
29
  "CHANGELOG.md",
30
30
  "README.md",
31
31
  "LICENSE"
32
32
  ],
33
33
  "publishConfig": {
34
- "provenance": true
34
+ "provenance": false
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",
@@ -59,6 +59,8 @@
59
59
  "gemini",
60
60
  "cursor",
61
61
  "opencode",
62
+ "grok",
63
+ "xai",
62
64
  "mcp",
63
65
  "skills",
64
66
  "ai",
@@ -72,14 +74,14 @@
72
74
  "npm": ">=9"
73
75
  },
74
76
  "dependencies": {
75
- "@inquirer/prompts": "7.10.1",
77
+ "@inquirer/prompts": "8.5.1",
76
78
  "@types/proper-lockfile": "4.1.4",
77
79
  "@xterm/headless": "6.0.0",
78
80
  "@zed-industries/agent-client-protocol": "0.4.5",
79
81
  "chalk": "5.6.2",
80
- "commander": "12.1.0",
81
- "croner": "9.1.0",
82
- "diff": "8.0.4",
82
+ "commander": "15.0.0",
83
+ "croner": "10.0.1",
84
+ "diff": "9.0.0",
83
85
  "marked": "15.0.12",
84
86
  "marked-terminal": "7.3.0",
85
87
  "node-pty": "1.1.0",
@@ -87,15 +89,14 @@
87
89
  "proper-lockfile": "4.1.2",
88
90
  "simple-git": "3.36.0",
89
91
  "smol-toml": "1.6.1",
90
- "yaml": "2.8.3"
92
+ "yaml": "2.9.0"
91
93
  },
92
94
  "devDependencies": {
93
- "@types/diff": "6.0.0",
95
+ "@types/diff": "8.0.0",
94
96
  "@types/marked-terminal": "6.1.1",
95
- "@types/node": "22.19.10",
96
- "playwright": "1.59.1",
97
- "tsx": "4.22.2",
98
- "typescript": "5.9.3",
97
+ "@types/node": "25.9.1",
98
+ "tsx": "4.22.3",
99
+ "typescript": "6.0.3",
99
100
  "vitest": "4.1.6"
100
101
  }
101
102
  }
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copy the bundled `Agents CLI.app` to a stable user-scoped path so its
4
+ * keychain ACLs survive future npm installs/updates.
5
+ *
6
+ * Source: dist/lib/secrets/Agents CLI.app (in the installed npm package)
7
+ * bin/Agents CLI.app (in a raw working tree)
8
+ * Destination: ~/Library/Application Support/agents-cli/Agents CLI.app
9
+ *
10
+ * Invoked by scripts/postinstall.js on global install, and by
11
+ * scripts/install.sh for dev installs. Pure Node, no agents-cli imports,
12
+ * so it runs before the package's TS is wired up.
13
+ *
14
+ * macOS only — silently no-ops on other platforms so postinstall stays clean.
15
+ */
16
+
17
+ import { spawnSync } from 'child_process';
18
+ import * as fs from 'fs';
19
+ import * as os from 'os';
20
+ import * as path from 'path';
21
+ import { fileURLToPath } from 'url';
22
+
23
+ const APP_BUNDLE_NAME = 'Agents CLI.app';
24
+ const INSTALL_DIR_NAME = 'agents-cli';
25
+
26
+ function destAppPath() {
27
+ return path.join(os.homedir(), 'Library', 'Application Support', INSTALL_DIR_NAME, APP_BUNDLE_NAME);
28
+ }
29
+
30
+ function findSourceApp() {
31
+ const here = path.dirname(fileURLToPath(import.meta.url));
32
+ // From scripts/install-helper.js, look in the installed npm layout first
33
+ // (../dist/lib/secrets/...) then a raw repo layout (../bin/...).
34
+ const candidates = [
35
+ path.resolve(here, '..', 'dist', 'lib', 'secrets', APP_BUNDLE_NAME),
36
+ path.resolve(here, '..', 'bin', APP_BUNDLE_NAME),
37
+ ];
38
+ for (const c of candidates) {
39
+ if (fs.existsSync(c)) return c;
40
+ }
41
+ return null;
42
+ }
43
+
44
+ function codesignVerify(appPath) {
45
+ const r = spawnSync('codesign', ['--verify', '--deep', '--strict', appPath], {
46
+ stdio: ['ignore', 'pipe', 'pipe'],
47
+ encoding: 'utf-8',
48
+ });
49
+ return { ok: r.status === 0, output: (r.stderr || r.stdout || '').toString().trim() };
50
+ }
51
+
52
+ function copyAppBundle(src, dest) {
53
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
54
+ if (fs.existsSync(dest)) fs.rmSync(dest, { recursive: true, force: true });
55
+ const r = spawnSync('cp', ['-R', src, dest], { stdio: ['ignore', 'pipe', 'pipe'], encoding: 'utf-8' });
56
+ if (r.status !== 0) {
57
+ const msg = (r.stderr || r.stdout || '').toString().trim();
58
+ throw new Error(`Failed to copy ${src} -> ${dest}: ${msg || 'unknown error'}`);
59
+ }
60
+ }
61
+
62
+ function main() {
63
+ if (process.platform !== 'darwin') return;
64
+ const force = process.argv.includes('--force');
65
+ const dest = destAppPath();
66
+
67
+ if (!force && fs.existsSync(dest) && codesignVerify(dest).ok) {
68
+ return;
69
+ }
70
+
71
+ const src = findSourceApp();
72
+ if (!src) {
73
+ // No source bundle to install. Stay silent during postinstall so we don't
74
+ // create noise on Linux/Windows or on builds that intentionally omit the
75
+ // helper. `agents helper install` surfaces a clearer error if a user
76
+ // actually needs the helper.
77
+ return;
78
+ }
79
+
80
+ try {
81
+ copyAppBundle(src, dest);
82
+ } catch (err) {
83
+ process.stderr.write(`agents-cli: failed to install Keychain helper: ${err.message}\n`);
84
+ return;
85
+ }
86
+
87
+ const verify = codesignVerify(dest);
88
+ if (!verify.ok) {
89
+ process.stderr.write(
90
+ `agents-cli: installed helper failed codesign verification at ${dest}\n${verify.output}\n`
91
+ );
92
+ return;
93
+ }
94
+ process.stdout.write(` Installed Keychain helper: ${dest}\n`);
95
+ }
96
+
97
+ main();
@@ -7,6 +7,7 @@ import * as fs from 'fs';
7
7
  import * as path from 'path';
8
8
  import * as os from 'os';
9
9
  import * as readline from 'readline';
10
+ import { spawnSync } from 'child_process';
10
11
  import { fileURLToPath } from 'url';
11
12
 
12
13
  const HOME = os.homedir();
@@ -14,6 +15,16 @@ const SHIMS_DIR = path.join(HOME, '.agents', '.cache', 'shims');
14
15
  const SYSTEM_DIR = path.join(HOME, '.agents-system');
15
16
  const USER_DIR = path.join(HOME, '.agents');
16
17
  const AGENTS_BIN = fileURLToPath(new URL('../dist/index.js', import.meta.url));
18
+ const INSTALL_HELPER_SCRIPT = fileURLToPath(new URL('./install-helper.js', import.meta.url));
19
+
20
+ function installKeychainHelper() {
21
+ if (process.platform !== 'darwin') return;
22
+ if (!fs.existsSync(INSTALL_HELPER_SCRIPT)) return;
23
+ // Sub-process so a hard failure (codesign / spctl missing on a weird host)
24
+ // can't take down the rest of postinstall. install-helper.js stays silent
25
+ // on no-op and emits one stdout line on success.
26
+ spawnSync(process.execPath, [INSTALL_HELPER_SCRIPT], { stdio: 'inherit' });
27
+ }
17
28
 
18
29
  function shellQuote(value) {
19
30
  return `'${value.replace(/'/g, `'\\''`)}'`;
@@ -24,6 +35,7 @@ const isGlobalInstall = process.env.npm_config_global || process.argv.includes('
24
35
  if (!isGlobalInstall) {
25
36
  // Still create user directories for local installs
26
37
  fs.mkdirSync(USER_DIR, { recursive: true, mode: 0o700 });
38
+ installKeychainHelper();
27
39
  console.log(`
28
40
  agents-cli installed locally.
29
41
  To complete setup, run: npx agents setup
@@ -36,6 +48,10 @@ fs.mkdirSync(SHIMS_DIR, { recursive: true });
36
48
  fs.mkdirSync(SYSTEM_DIR, { recursive: true });
37
49
  fs.mkdirSync(USER_DIR, { recursive: true, mode: 0o700 });
38
50
 
51
+ // Copy the signed macOS Keychain helper to a stable user path so its trusted-app
52
+ // ACLs survive future npm publishes (which re-sign the bundle).
53
+ installKeychainHelper();
54
+
39
55
  // One-shot idempotent migrations
40
56
  function runMigrations() {
41
57
  // 1. Move agents.yaml from system to user repo