@phnx-labs/agents-cli 1.22.15 → 1.22.16

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 (47) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +3 -1
  3. package/dist/bin/agents +0 -0
  4. package/dist/commands/exec.js +96 -11
  5. package/dist/commands/humans.d.ts +10 -0
  6. package/dist/commands/humans.js +91 -0
  7. package/dist/commands/resume.d.ts +17 -0
  8. package/dist/commands/resume.js +80 -0
  9. package/dist/commands/sessions.d.ts +13 -4
  10. package/dist/commands/sessions.js +37 -19
  11. package/dist/index.js +3 -2
  12. package/dist/lib/channels/send.d.ts +4 -1
  13. package/dist/lib/channels/send.js +15 -7
  14. package/dist/lib/devices/doctor-findings.d.ts +14 -0
  15. package/dist/lib/devices/doctor-findings.js +92 -51
  16. package/dist/lib/exec.d.ts +6 -2
  17. package/dist/lib/exec.js +22 -4
  18. package/dist/lib/hooks.d.ts +4 -2
  19. package/dist/lib/hooks.js +173 -23
  20. package/dist/lib/humans.d.ts +25 -0
  21. package/dist/lib/humans.js +65 -0
  22. package/dist/lib/memory.js +2 -1
  23. package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
  24. package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
  25. package/dist/lib/migrate.js +112 -4
  26. package/dist/lib/notify.js +6 -2
  27. package/dist/lib/permissions.js +12 -10
  28. package/dist/lib/projects.d.ts +3 -3
  29. package/dist/lib/projects.js +19 -17
  30. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  31. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  32. package/dist/lib/secrets/bundles.d.ts +11 -0
  33. package/dist/lib/secrets/bundles.js +122 -5
  34. package/dist/lib/session/actor-sidecar.d.ts +5 -2
  35. package/dist/lib/session/actor-sidecar.js +4 -2
  36. package/dist/lib/session/db.d.ts +2 -1
  37. package/dist/lib/session/db.js +19 -3
  38. package/dist/lib/session/types.d.ts +4 -0
  39. package/dist/lib/staleness/writers/sources.d.ts +6 -1
  40. package/dist/lib/staleness/writers/sources.js +93 -7
  41. package/dist/lib/startup/command-registry.d.ts +2 -0
  42. package/dist/lib/startup/command-registry.js +5 -0
  43. package/dist/lib/state.d.ts +2 -0
  44. package/dist/lib/state.js +6 -6
  45. package/dist/lib/types.d.ts +50 -0
  46. package/dist/lib/versions.js +48 -14
  47. package/package.json +1 -1
@@ -185,15 +185,24 @@ export function getAvailableResources(cwd = process.cwd()) {
185
185
  }
186
186
  }
187
187
  result.skills = filterNamesForActiveResourceProfile('skills', Array.from(skillNames), sourceMapFromResources('skills', cwd));
188
- // Hooks. A hook is either a directory bundle or an actual script file: known
189
- // script extension, OR executable bit on a file with a non-data extension.
190
- // Auxiliary content like `README.md` (docs) or `promptcuts.yaml` (data read
191
- // directly by the expand-promptcuts script) lives in hooks/ but is not a
192
- // hook. Older sync runs chmod 0o755'd everything they copied, so an exec bit
193
- // alone can no longer be trusted as the signal.
188
+ // Hooks:
189
+ // - top-level script files
190
+ // - one-level *group* dirs that contain top-level scripts (session-starts/*.sh)
191
+ // → each script is its own hook resource (install name = basename)
192
+ // - other directories (e.g. tests/ with fixtures only) → directory bundles,
193
+ // copied wholesale as one resource (pre-existing layout)
194
+ // Auxiliary content like README.md / promptcuts.yaml is not a hook. Older sync
195
+ // runs chmod 0o755'd everything, so an exec bit alone is not the signal.
194
196
  const NON_SCRIPT_EXTS = new Set(['.md', '.markdown', '.rst', '.txt', '.yaml', '.yml', '.json', '.toml', '.ini', '.conf']);
195
197
  const SCRIPT_EXTS = new Set(['.sh', '.bash', '.zsh', '.py', '.js', '.ts', '.mjs', '.cjs', '.rb', '.pl', '.ps1']);
198
+ const HOOK_GROUP_SKIP = new Set(['node_modules', '.git', '.cache']);
196
199
  const hookNames = new Set();
200
+ const isHookScriptName = (fileName, mode) => {
201
+ const ext = path.extname(fileName).toLowerCase();
202
+ if (SCRIPT_EXTS.has(ext))
203
+ return true;
204
+ return (mode & 0o111) !== 0 && !NON_SCRIPT_EXTS.has(ext);
205
+ };
197
206
  for (const { base } of resourceBases) {
198
207
  const hooksDir = path.join(base, 'hooks');
199
208
  if (!fs.existsSync(hooksDir))
@@ -202,22 +211,47 @@ export function getAvailableResources(cwd = process.cwd()) {
202
211
  if (name.startsWith('.'))
203
212
  continue;
204
213
  try {
205
- const stat = fs.lstatSync(path.join(hooksDir, name));
214
+ const full = path.join(hooksDir, name);
215
+ const stat = fs.lstatSync(full);
206
216
  if (stat.isSymbolicLink())
207
217
  continue;
208
- if (stat.isDirectory()) {
209
- hookNames.add(name);
218
+ if (stat.isFile()) {
219
+ if (isHookScriptName(name, stat.mode))
220
+ hookNames.add(name);
210
221
  continue;
211
222
  }
212
- if (!stat.isFile())
223
+ if (!stat.isDirectory() || HOOK_GROUP_SKIP.has(name))
213
224
  continue;
214
- const ext = path.extname(name).toLowerCase();
215
- if (SCRIPT_EXTS.has(ext)) {
216
- hookNames.add(name);
225
+ // Group vs bundle: if the dir has any top-level script files, expand
226
+ // them; otherwise treat the whole dir as one hook resource.
227
+ let nestedNames;
228
+ try {
229
+ nestedNames = fs.readdirSync(full);
230
+ }
231
+ catch {
217
232
  continue;
218
233
  }
219
- if ((stat.mode & 0o111) !== 0 && !NON_SCRIPT_EXTS.has(ext))
234
+ const scripts = [];
235
+ for (const nested of nestedNames) {
236
+ if (nested.startsWith('.'))
237
+ continue;
238
+ try {
239
+ const nfull = path.join(full, nested);
240
+ const nstat = fs.lstatSync(nfull);
241
+ if (nstat.isSymbolicLink() || !nstat.isFile())
242
+ continue;
243
+ if (isHookScriptName(nested, nstat.mode))
244
+ scripts.push(nested);
245
+ }
246
+ catch { /* ignore */ }
247
+ }
248
+ if (scripts.length > 0) {
249
+ for (const s of scripts)
250
+ hookNames.add(s);
251
+ }
252
+ else {
220
253
  hookNames.add(name);
254
+ }
221
255
  }
222
256
  catch { /* ignore unreadable */ }
223
257
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.22.15",
3
+ "version": "1.22.16",
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",