@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.
- package/CHANGELOG.md +40 -0
- package/README.md +3 -1
- package/dist/bin/agents +0 -0
- package/dist/commands/exec.js +96 -11
- package/dist/commands/humans.d.ts +10 -0
- package/dist/commands/humans.js +91 -0
- package/dist/commands/resume.d.ts +17 -0
- package/dist/commands/resume.js +80 -0
- package/dist/commands/sessions.d.ts +13 -4
- package/dist/commands/sessions.js +37 -19
- package/dist/index.js +3 -2
- package/dist/lib/channels/send.d.ts +4 -1
- package/dist/lib/channels/send.js +15 -7
- package/dist/lib/devices/doctor-findings.d.ts +14 -0
- package/dist/lib/devices/doctor-findings.js +92 -51
- package/dist/lib/exec.d.ts +6 -2
- package/dist/lib/exec.js +22 -4
- package/dist/lib/hooks.d.ts +4 -2
- package/dist/lib/hooks.js +173 -23
- package/dist/lib/humans.d.ts +25 -0
- package/dist/lib/humans.js +65 -0
- package/dist/lib/memory.js +2 -1
- package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
- package/dist/lib/migrate.js +112 -4
- package/dist/lib/notify.js +6 -2
- package/dist/lib/permissions.js +12 -10
- package/dist/lib/projects.d.ts +3 -3
- package/dist/lib/projects.js +19 -17
- package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
- package/dist/lib/secrets/bundles.d.ts +11 -0
- package/dist/lib/secrets/bundles.js +122 -5
- package/dist/lib/session/actor-sidecar.d.ts +5 -2
- package/dist/lib/session/actor-sidecar.js +4 -2
- package/dist/lib/session/db.d.ts +2 -1
- package/dist/lib/session/db.js +19 -3
- package/dist/lib/session/types.d.ts +4 -0
- package/dist/lib/staleness/writers/sources.d.ts +6 -1
- package/dist/lib/staleness/writers/sources.js +93 -7
- package/dist/lib/startup/command-registry.d.ts +2 -0
- package/dist/lib/startup/command-registry.js +5 -0
- package/dist/lib/state.d.ts +2 -0
- package/dist/lib/state.js +6 -6
- package/dist/lib/types.d.ts +50 -0
- package/dist/lib/versions.js +48 -14
- package/package.json +1 -1
package/dist/lib/versions.js
CHANGED
|
@@ -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
|
|
189
|
-
// script
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
//
|
|
193
|
-
//
|
|
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
|
|
214
|
+
const full = path.join(hooksDir, name);
|
|
215
|
+
const stat = fs.lstatSync(full);
|
|
206
216
|
if (stat.isSymbolicLink())
|
|
207
217
|
continue;
|
|
208
|
-
if (stat.
|
|
209
|
-
|
|
218
|
+
if (stat.isFile()) {
|
|
219
|
+
if (isHookScriptName(name, stat.mode))
|
|
220
|
+
hookNames.add(name);
|
|
210
221
|
continue;
|
|
211
222
|
}
|
|
212
|
-
if (!stat.
|
|
223
|
+
if (!stat.isDirectory() || HOOK_GROUP_SKIP.has(name))
|
|
213
224
|
continue;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
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.
|
|
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",
|