@phnx-labs/agents-cli 1.22.16 → 1.22.18

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 (39) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +10 -1
  3. package/dist/bin/agents +0 -0
  4. package/dist/commands/cloud.d.ts +0 -1
  5. package/dist/commands/cloud.js +19 -185
  6. package/dist/commands/doctor.js +16 -14
  7. package/dist/commands/exec.js +57 -5
  8. package/dist/commands/feed.d.ts +1 -0
  9. package/dist/commands/feed.js +36 -32
  10. package/dist/commands/run-cloud.d.ts +26 -0
  11. package/dist/commands/run-cloud.js +162 -0
  12. package/dist/commands/versions.js +4 -2
  13. package/dist/commands/view.js +1 -54
  14. package/dist/lib/agents.js +4 -2
  15. package/dist/lib/channels/providers/rush.d.ts +2 -0
  16. package/dist/lib/channels/providers/rush.js +20 -5
  17. package/dist/lib/channels/registry.d.ts +2 -0
  18. package/dist/lib/channels/send.d.ts +4 -3
  19. package/dist/lib/channels/send.js +15 -18
  20. package/dist/lib/cloud/dispatch.d.ts +27 -0
  21. package/dist/lib/cloud/dispatch.js +214 -0
  22. package/dist/lib/feed-post.d.ts +2 -2
  23. package/dist/lib/feed-post.js +15 -10
  24. package/dist/lib/hosts/remote-cmd.js +8 -0
  25. package/dist/lib/humans.d.ts +3 -2
  26. package/dist/lib/humans.js +16 -8
  27. package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
  28. package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
  29. package/dist/lib/notify.d.ts +4 -4
  30. package/dist/lib/notify.js +8 -7
  31. package/dist/lib/placement.d.ts +8 -4
  32. package/dist/lib/placement.js +14 -8
  33. package/dist/lib/resources.js +124 -0
  34. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  35. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  36. package/dist/lib/session/active.js +7 -3
  37. package/dist/lib/settings-manifest.js +7 -1
  38. package/dist/lib/types.d.ts +2 -0
  39. package/package.json +1 -1
@@ -128,6 +128,130 @@ export function listResources(kind, cwd) {
128
128
  [path.join(getSystemAgentsDir(), kind), 'system', getSystemAgentsDir()],
129
129
  ...extraRepos.map((e) => [path.join(e.dir, kind), e.alias, e.dir]),
130
130
  ];
131
+ // Hooks use a one-level event-group layout (hooks/pre-tool-use/git-guard.sh).
132
+ // A flat readdir treats `pre-tool-use` as the resource name, so `system:*`
133
+ // pattern expansion never includes nested scripts — and `agents sync --force`
134
+ // leaves stale flat copies in version homes forever. Mirror getAvailableResources:
135
+ // expand group dirs that hold scripts (install name = basename with extension),
136
+ // keep fixture-only dirs as bundles, and keep top-level scripts as resources.
137
+ // Keep this logic self-contained (no hooks.ts import) so vi.mock of hooks.js
138
+ // in versions tests does not break listResources.
139
+ if (kind === 'hooks') {
140
+ const HOOK_SCRIPT_EXTS = new Set([
141
+ '.sh', '.bash', '.zsh', '.py', '.js', '.ts', '.mjs', '.cjs', '.rb', '.pl', '.ps1', '.cmd', '.bat',
142
+ ]);
143
+ const HOOK_NON_SCRIPT_EXTS = new Set([
144
+ '.md', '.markdown', '.rst', '.txt', '.yaml', '.yml', '.json', '.toml', '.ini', '.conf',
145
+ ]);
146
+ const HOOK_GROUP_SKIP = new Set(['node_modules', '.git', '.cache']);
147
+ const isHookScriptName = (fileName, mode) => {
148
+ const ext = path.extname(fileName).toLowerCase();
149
+ if (HOOK_SCRIPT_EXTS.has(ext))
150
+ return true;
151
+ return (mode & 0o111) !== 0 && !HOOK_NON_SCRIPT_EXTS.has(ext);
152
+ };
153
+ for (const [dir, source, repoRoot] of roots) {
154
+ if (!fs.existsSync(dir))
155
+ continue;
156
+ let top;
157
+ try {
158
+ top = fs.readdirSync(dir);
159
+ }
160
+ catch {
161
+ continue;
162
+ }
163
+ for (const name of top) {
164
+ if (name.startsWith('.'))
165
+ continue;
166
+ const full = path.join(dir, name);
167
+ let stat;
168
+ try {
169
+ stat = fs.lstatSync(full);
170
+ }
171
+ catch {
172
+ continue;
173
+ }
174
+ if (stat.isSymbolicLink())
175
+ continue;
176
+ if (stat.isFile()) {
177
+ if (!isHookScriptName(name, stat.mode))
178
+ continue;
179
+ // Docs that live beside hooks (README/AGENTS) are not resources.
180
+ const raw = name.replace(/\.(md|yaml|yml)$/, '');
181
+ if (isDirectoryDoc(kind, raw))
182
+ continue;
183
+ if (seen.has(name))
184
+ continue;
185
+ if (!resourceIsActive(kind, name, source))
186
+ continue;
187
+ seen.add(name);
188
+ results.push(withProvenance({
189
+ name,
190
+ path: full,
191
+ source,
192
+ repoRoot,
193
+ }));
194
+ continue;
195
+ }
196
+ if (!stat.isDirectory() || HOOK_GROUP_SKIP.has(name))
197
+ continue;
198
+ let nested;
199
+ try {
200
+ nested = fs.readdirSync(full);
201
+ }
202
+ catch {
203
+ continue;
204
+ }
205
+ const scripts = [];
206
+ for (const nestedName of nested) {
207
+ if (nestedName.startsWith('.'))
208
+ continue;
209
+ const nfull = path.join(full, nestedName);
210
+ let nstat;
211
+ try {
212
+ nstat = fs.lstatSync(nfull);
213
+ }
214
+ catch {
215
+ continue;
216
+ }
217
+ if (nstat.isSymbolicLink() || !nstat.isFile())
218
+ continue;
219
+ if (isHookScriptName(nestedName, nstat.mode))
220
+ scripts.push(nestedName);
221
+ }
222
+ if (scripts.length > 0) {
223
+ for (const script of scripts) {
224
+ if (seen.has(script))
225
+ continue;
226
+ if (!resourceIsActive(kind, script, source))
227
+ continue;
228
+ seen.add(script);
229
+ results.push(withProvenance({
230
+ name: script,
231
+ path: path.join(full, script),
232
+ source,
233
+ repoRoot,
234
+ }));
235
+ }
236
+ }
237
+ else {
238
+ // Fixture-only directory bundle (hooks/tests/fixtures/…).
239
+ if (seen.has(name))
240
+ continue;
241
+ if (!resourceIsActive(kind, name, source))
242
+ continue;
243
+ seen.add(name);
244
+ results.push(withProvenance({
245
+ name,
246
+ path: full,
247
+ source,
248
+ repoRoot,
249
+ }));
250
+ }
251
+ }
252
+ }
253
+ return results;
254
+ }
131
255
  for (const [dir, source, repoRoot] of roots) {
132
256
  if (!fs.existsSync(dir))
133
257
  continue;
@@ -1419,12 +1419,16 @@ export async function listTmuxAgentSessions() {
1419
1419
  topic,
1420
1420
  tokPerSec,
1421
1421
  sessionFile,
1422
- // tmux panes carry no start timestamp; derive both from the transcript
1423
- // (creation start, last write last activity).
1424
- startedAtMs: birthtimeMs,
1422
+ // Prefer the launch registry's start when known (more accurate than
1423
+ // transcript birth for a resumed/reused file); else transcript times.
1424
+ startedAtMs: liveEntry?.startedAtMs ?? birthtimeMs,
1425
1425
  lastActivityMs: mtimeMs,
1426
1426
  provenance,
1427
1427
  owner: resolveOwner(liveEntry?.actor, id.sessionId ?? sessionIdFromFile(sessionFile)),
1428
+ // Factory / --active join key: AGENT_TERMINAL_ID stamped on the launch
1429
+ // registry and preserved by SessionStart. Without this, Grok/Codex tmux
1430
+ // panes never surface terminalId even when by-pid has it (RUSH-2192).
1431
+ terminalId: liveEntry?.terminalId,
1428
1432
  // An id-less pane keys its dedupe on the unique pane, so two anonymous
1429
1433
  // co-located panes stay two rows instead of folding into one.
1430
1434
  paneId: id.sessionId ?? sessionIdFromFile(sessionFile) ? undefined : pane,
@@ -30,7 +30,13 @@ const SETTINGS_MANIFEST = {
30
30
  strategy: 'toml-merge',
31
31
  stateKeys: ['notice', 'windows_wsl_setup_acknowledged'],
32
32
  },
33
- { rel: '.codex/auth.json', strategy: 'copy-if-absent', restrictMode: true },
33
+ // `.codex/auth.json` is deliberately NOT carried forward. Copying it seeded
34
+ // every new Codex version with the current default's ChatGPT token, so two
35
+ // installed versions always reported the same account and could never sign
36
+ // into separate accounts. Claude omits its credential (`.claude.json`) for
37
+ // the same reason — a version home holds its own login, keeping accounts
38
+ // per-version. A fresh Codex version installs signed-out; run `codex login`
39
+ // (or `agents run codex --version <v>`) inside it to authenticate.
34
40
  { rel: '.codex/instructions.md', strategy: 'copy-if-absent' },
35
41
  { rel: '.codex/hooks.json', strategy: 'copy-if-absent' },
36
42
  { rel: '.codex/prompts', strategy: 'dir-entries' },
@@ -1008,6 +1008,8 @@ export interface HumanChannel {
1008
1008
  id: string;
1009
1009
  /** Provider transport (e.g. "rush", "twilio"). */
1010
1010
  transport: string;
1011
+ /** Provider-specific recipient (phone number, user id, address). */
1012
+ to?: string;
1011
1013
  /** If true the channel is watched for incoming messages. */
1012
1014
  watch?: boolean;
1013
1015
  /** Shell command to invoke (for call channels). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.22.16",
3
+ "version": "1.22.18",
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",