@yasaswy.nagavolu/agents 0.27.1 → 0.27.2
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/README.md +8 -3
- package/lib/codex-hook-adapter.js +2 -1
- package/lib/codex.js +59 -14
- package/lib/discovery.js +59 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @yasaswy.nagavolu/agents
|
|
2
2
|
|
|
3
|
-
CLI for installing the yasaswy.nagavolu agent/skill/hook bundle
|
|
4
|
-
|
|
3
|
+
CLI for installing the yasaswy.nagavolu agent/skill/hook bundle across Claude
|
|
4
|
+
Code and Codex.
|
|
5
5
|
|
|
6
6
|
The install, update, uninstall, and doctor commands target Claude Code and
|
|
7
7
|
Codex by default. Codex skills live in `~/.agents/skills`; Codex instructions,
|
|
@@ -10,7 +10,12 @@ Use `--runtime claude` or `--runtime codex` to select one runtime. `--codex-dir`
|
|
|
10
10
|
sets Codex's configuration home (or set `CODEX_HOME`). A custom
|
|
11
11
|
`--target-dir` keeps the legacy Claude-only behavior; use `--runtime both`
|
|
12
12
|
with both `--target-dir` and `--codex-dir` to install into isolated homes.
|
|
13
|
-
Codex
|
|
13
|
+
Codex receives native agent and skill projections plus compatible hooks. Hooks
|
|
14
|
+
that depend on Claude-only events or payloads, and newly registered hooks without
|
|
15
|
+
a reviewed Codex contract, are retained as inert compatibility assets and listed
|
|
16
|
+
in Codex's compatibility report. New skills and agents are discovered during
|
|
17
|
+
updates; new hook scripts are discovered when their Claude hook registration or
|
|
18
|
+
adjacent `.deploy.json` declares the event and command.
|
|
14
19
|
|
|
15
20
|
`install` opens an interactive checkbox menu of purpose-based bundles when
|
|
16
21
|
run in a terminal, or installs one bundle non-interactively via
|
|
@@ -4,7 +4,8 @@ const {spawnSync}=require('node:child_process');
|
|
|
4
4
|
function normalize(payload){
|
|
5
5
|
const input={...(payload.tool_input||{})};
|
|
6
6
|
if(input.cmd!==undefined&&input.command===undefined)input.command=input.cmd;
|
|
7
|
-
|
|
7
|
+
if(input.task!==undefined&&input.prompt===undefined)input.prompt=input.task;
|
|
8
|
+
const aliases={exec_command:'Bash',powershell:'Bash',PowerShell:'Bash',spawn_agent:'Agent',apply_patch:'Edit'};
|
|
8
9
|
if(payload.tool_name==='apply_patch'&&!input.file_path){
|
|
9
10
|
const patch=String(input.patch||input.input||input.content||input.command||'');
|
|
10
11
|
const paths=new Set();
|
package/lib/codex.js
CHANGED
|
@@ -9,9 +9,25 @@ const {walk,isExcluded,sha256File,writeFileAtomic} = require('./fsutil');
|
|
|
9
9
|
const {planFileUpdates,applyFilePlan} = require('./update');
|
|
10
10
|
const EVENTS = new Set(['SessionStart','SessionEnd','SubagentStart','SubagentStop','PreToolUse','PermissionRequest','PostToolUse','UserPromptSubmit','PreCompact','PostCompact','Stop','Interrupt']);
|
|
11
11
|
const HOOK_CONTRACTS = new Set(require('./codex-compatibility.json'));
|
|
12
|
+
const REVIEWED_HOOK_PATHS = new Set([...HOOK_CONTRACTS].map(contract => JSON.parse(contract)[0]));
|
|
12
13
|
const KINDS = new Set(['skill','agent','hook','command','mcp','rule','statusline','infra','setting','mod']);
|
|
13
|
-
const
|
|
14
|
-
const
|
|
14
|
+
const SUPPORTED_MATCHERS = new Set(['Bash','PowerShell','Edit','Write','Agent','exec_command','apply_patch','spawn_agent','']);
|
|
15
|
+
const NATIVE_HOOK_SOURCES = new Map([
|
|
16
|
+
['global/hooks/store_guard.js',{PreToolUse:new Set(['Bash','PowerShell'])}],
|
|
17
|
+
['global/hooks/ai_attribution_guard.py',{PreToolUse:new Set(['Bash'])}],
|
|
18
|
+
['global/hooks/cloudshell_guard.py',{PreToolUse:new Set(['Bash','PowerShell'])}],
|
|
19
|
+
['proxy/code_is_law_prompt_nudge.py',{UserPromptSubmit:new Set([''])}],
|
|
20
|
+
['proxy/html_mocker_prompt_nudge.py',{UserPromptSubmit:new Set([''])}],
|
|
21
|
+
['proxy/reddit_intent_hook.py',{UserPromptSubmit:new Set([''])}],
|
|
22
|
+
['proxy/agent_dispatch_guard.py',{PreToolUse:new Set(['Agent'])}],
|
|
23
|
+
['proxy/resolve_policy_guard.py',{PreToolUse:new Set(['Bash','PowerShell','Edit','Write'])}],
|
|
24
|
+
['proxy/code_is_law_lint_hook.py',{PostToolUse:new Set(['Edit','Write'])}],
|
|
25
|
+
['proxy/routing_escalation_hook.py',{Stop:new Set(['']),SubagentStop:new Set([''])}],
|
|
26
|
+
]);
|
|
27
|
+
const CODEX_SKILL_PATH_HOOKS=new Set(['proxy/code_is_law_prompt_nudge.py','proxy/html_mocker_prompt_nudge.py','proxy/reddit_intent_hook.py','proxy/code_is_law_lint_hook.py']);
|
|
28
|
+
const CODEX_AGENT_PATH_HOOKS=new Set(['proxy/agent_dispatch_guard.py']);
|
|
29
|
+
function matcherContract(name){if(['Bash','PowerShell','exec_command'].includes(name))return 'Bash';if(['Edit','Write','apply_patch'].includes(name))return 'Edit';if(['Agent','spawn_agent'].includes(name))return 'Agent';return name;}
|
|
30
|
+
function adaptHookSource(itemPath,text){if(CODEX_SKILL_PATH_HOOKS.has(itemPath))return text.replaceAll('".claude" / "skills"','".agents" / "skills"').replaceAll('~/.claude/skills/','~/.agents/skills/');if(CODEX_AGENT_PATH_HOOKS.has(itemPath))return text.replaceAll('~/.claude/agents/','~/.codex/agents/');return text;}
|
|
15
31
|
function toml(value) { return JSON.stringify(value); }
|
|
16
32
|
function agentToml(text, filename) {
|
|
17
33
|
const match = text.replace(/\r\n/g,'\n').match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
@@ -29,19 +45,44 @@ function classify(item) {
|
|
|
29
45
|
if (item.kind==='hook') {
|
|
30
46
|
const wirings = item.wiring ? (Array.isArray(item.wiring)?item.wiring:[item.wiring]) : [];
|
|
31
47
|
for(const w of wirings) { if (!EVENTS.has(w.event) && w.event !== 'PostToolUseFailure') throw new Error('Unclassified hook event: '+w.event); if (w.type && w.type!=='command') throw new Error('Unclassified hook handler: '+w.type); }
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
if(wirings.length&&!REVIEWED_HOOK_PATHS.has(item.path)) return {status:'unsupported',reason:'Hook source '+item.path+' has no reviewed Codex contract; installed inert under hooks/claude-compat'};
|
|
49
|
+
const unreviewed=wirings.find(w=>!HOOK_CONTRACTS.has(JSON.stringify([item.path,w.event,w.matcher||'',w.if||'',w.type||'command'])));
|
|
50
|
+
if(unreviewed)return {status:'unsupported',reason:'Hook source '+item.path+' has no reviewed Codex contract for '+unreviewed.event+' '+(unreviewed.matcher||'(no matcher)')+'; installed inert under hooks/claude-compat'};
|
|
34
51
|
if(!wirings.length) return {status:'asset',reason:'Support file only; no event declaration'};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if(
|
|
38
|
-
|
|
52
|
+
const evaluated=wirings.map(w=>({w,...wiringCompatibility(item,w)}));
|
|
53
|
+
const supported=evaluated.filter(result=>result.status==='translated');
|
|
54
|
+
if(!supported.length)return {status:'unsupported',reason:evaluated.map(result=>result.reason).filter(Boolean).join('; ')};
|
|
55
|
+
const skipped=evaluated.filter(result=>result.status!=='translated');
|
|
56
|
+
const details=evaluated.filter(result=>result.reason).map(result=>result.reason);
|
|
57
|
+
return {status:'translated',reason:details.length?'Partial native hook translation; unsupported wirings or matcher alternatives stay inert: '+details.join('; '):skipped.length?'Partial native hook translation; unsupported wirings stay inert: '+skipped.map(result=>result.reason).join('; '):'Native command hook; activation requires exact handler trust'};
|
|
39
58
|
}
|
|
40
59
|
if(item.kind==='rule' && (item.targetPath||item.path)==='CLAUDE.md') return {status:'portable',reason:'Same canonical bytes deployed as AGENTS.md'};
|
|
41
60
|
if(item.kind==='infra' && (item.targetPath||item.path)!=='models.json') return {status:'asset',reason:'Shared supporting runtime files'};
|
|
42
61
|
if(item.kind==='rule' && item.path.startsWith('global/rules/')) return {status:'asset',reason:'Reference rule files; native instruction discovery uses AGENTS.md'};
|
|
43
62
|
return {status:'unsupported',reason:'Claude-specific '+item.kind+' configuration/runtime'};
|
|
44
63
|
}
|
|
64
|
+
function wiringCompatibility(item,w){
|
|
65
|
+
if(w.if)return {status:'unsupported',reason:'Claude conditional hook expression has no native Codex equivalent'};
|
|
66
|
+
if(w.event==='PostToolUseFailure')return {status:'unsupported',reason:'Claude event PostToolUseFailure is not provided by native Codex'};
|
|
67
|
+
if(w.event==='PermissionRequest')return {status:'unsupported',reason:'Codex PermissionRequest uses a different decision payload; this Claude hook source has no tested response adapter'};
|
|
68
|
+
if(!['UserPromptSubmit','PreToolUse','PostToolUse','Stop','SubagentStop'].includes(w.event))return {status:'unsupported',reason:'Claude event '+w.event+' has no validated native Codex contract'};
|
|
69
|
+
const names=(w.matcher||'').split('|');
|
|
70
|
+
if((w.event==='Stop'||w.event==='SubagentStop'||w.event==='UserPromptSubmit')&&names.some(Boolean))return {status:'unsupported',reason:'Codex '+w.event+' hooks ignore matchers, so this Claude matcher cannot be preserved'};
|
|
71
|
+
const sourceMatchers=NATIVE_HOOK_SOURCES.get(item.path)?.[w.event];
|
|
72
|
+
if(!sourceMatchers){if(w.event==='Stop'||w.event==='SubagentStop')return {status:'unsupported',reason:'No current hook source has a tested '+w.event+' adapter; Claude transcript/state fields remain inert'};if(w.event==='PostToolUse'&&names.some(name=>matcherContract(name)==='Agent'))return {status:'unsupported',reason:'Codex PostToolUse on Agent observes agent launch, not completed subagent output'};return {status:'unsupported',reason:'Hook source '+item.path+' has no tested Codex payload/output adapter for '+w.event};}
|
|
73
|
+
const supported=names.filter(name=>SUPPORTED_MATCHERS.has(name)&&sourceMatchers.has(name));
|
|
74
|
+
if(!supported.length){
|
|
75
|
+
if(names.some(name=>name==='Artifact'||name==='Monitor'||name==='Skill'||name==='WebSearch'||name.startsWith('mcp__claude-in-chrome__')))return {status:'unsupported',reason:'Claude host-specific matcher '+(w.matcher||'')+' has no native Codex local hook coverage'};
|
|
76
|
+
if(w.event==='PermissionRequest')return {status:'unsupported',reason:'Codex PermissionRequest uses a different decision payload; this Claude hook source has no tested response adapter'};
|
|
77
|
+
return {status:'unsupported',reason:'Hook source '+item.path+' has no tested Codex payload/output adapter for '+w.event+' '+(w.matcher||'(no matcher)')};
|
|
78
|
+
}
|
|
79
|
+
const allowedEventTools=w.event==='PreToolUse'?new Set(['Bash','Edit','Agent']):w.event==='PostToolUse'?new Set(['Bash','Edit']):new Set();
|
|
80
|
+
if((w.event==='PreToolUse'||w.event==='PostToolUse')&&supported.some(name=>!allowedEventTools.has(matcherContract(name))))return {status:'unsupported',reason:'Matcher has no equivalent for Codex '+w.event+' hooks'};
|
|
81
|
+
const omitted=names.filter(name=>name&&!supported.includes(name));
|
|
82
|
+
const skipped=omitted.length?[(omitted.some(name=>name==='Artifact'||name==='Monitor'||name==='Skill'||name==='WebSearch'||name.startsWith('mcp__claude-in-chrome__'))?'host-specific matcher ':'unsupported matcher ')+omitted.join('|')+' left inert']:[];
|
|
83
|
+
if(w.event==='PostToolUse'&&names.some(name=>matcherContract(name)==='Agent'))skipped.push('Codex PostToolUse on Agent observes launch, not completed subagent output');
|
|
84
|
+
return {status:'translated',matcher:[...new Set(supported.map(matcherContract))].filter(Boolean).join('|'),reason:skipped.length?skipped.join('; '):null};
|
|
85
|
+
}
|
|
45
86
|
function coverage(manifest) { return manifest.bundles.flatMap(b=>b.items.map(i=>({bundle:b.key,path:i.path,kind:i.kind,...classify(i)}))); }
|
|
46
87
|
function skillBase(targetBase) { return path.join(path.dirname(targetBase), '.agents','skills'); }
|
|
47
88
|
function targetFile(targetBase, rel) { return rel.startsWith('skills/') ? path.join(skillBase(targetBase),...rel.slice(7).split('/')) : path.join(targetBase,...rel.split('/')); }
|
|
@@ -50,7 +91,8 @@ function filesFor(bundle,repoRoot,stage,selectedPaths) {
|
|
|
50
91
|
for(const item of bundle.items) {
|
|
51
92
|
if(selectedPaths && !selectedPaths.has(item.path)) continue;
|
|
52
93
|
const verdict=classify(item);
|
|
53
|
-
if(
|
|
94
|
+
if(item.kind==='mcp') continue;
|
|
95
|
+
if(verdict.status==='unsupported'&&item.kind!=='hook') continue;
|
|
54
96
|
const srcRoot=path.join(repoRoot,...item.path.split('/'));
|
|
55
97
|
if(!fs.existsSync(srcRoot)) throw new Error('Missing artifact: '+item.path);
|
|
56
98
|
const single=fs.statSync(srcRoot).isFile();
|
|
@@ -58,15 +100,16 @@ function filesFor(bundle,repoRoot,stage,selectedPaths) {
|
|
|
58
100
|
if(isExcluded(item,rel)) continue;
|
|
59
101
|
const sourcePath=single?item.path:item.path+'/'+rel;
|
|
60
102
|
let relTarget=single?(item.targetPath||item.path):(item.targetPath||item.path)+'/'+rel;
|
|
103
|
+
if(verdict.status==='unsupported'&&item.kind==='hook')relTarget='hooks/claude-compat/'+item.path+(single?'':'/'+rel);
|
|
61
104
|
let srcFile=single?srcRoot:path.join(srcRoot,...rel.split('/'));
|
|
62
105
|
if(item.kind==='rule' && relTarget==='CLAUDE.md') relTarget='AGENTS.md';
|
|
63
106
|
if(item.kind==='rule' && relTarget==='AGENTS.md') {
|
|
64
107
|
const generated=path.join(stage,...relTarget.split('/'));fs.mkdirSync(path.dirname(generated),{recursive:true});
|
|
65
108
|
fs.writeFileSync(generated,require('./codex-global-config').applyCodexRoutingInstructions(fs.readFileSync(srcFile,'utf8')));srcFile=generated;
|
|
66
109
|
}
|
|
67
|
-
if(item.kind==='hook'
|
|
68
|
-
const generated=path.join(stage,...('adapted/'+
|
|
69
|
-
fs.writeFileSync(generated,fs.readFileSync(srcFile,'utf8')
|
|
110
|
+
if(item.kind==='hook'&&verdict.status==='translated'&&(CODEX_SKILL_PATH_HOOKS.has(item.path)||CODEX_AGENT_PATH_HOOKS.has(item.path))) {
|
|
111
|
+
const generated=path.join(stage,...('adapted/'+sourcePath).split('/'));fs.mkdirSync(path.dirname(generated),{recursive:true});
|
|
112
|
+
fs.writeFileSync(generated,adaptHookSource(item.path,fs.readFileSync(srcFile,'utf8')));srcFile=generated;
|
|
70
113
|
}
|
|
71
114
|
if(item.kind==='agent') {
|
|
72
115
|
if(!relTarget.endsWith('.md')||path.basename(relTarget)==='README.md') continue;
|
|
@@ -112,13 +155,15 @@ function hookCommands(manifest,keys,targetBase,selections) {
|
|
|
112
155
|
const selected=selections&&selections[bundle.key];if(selected&&!selected.includes(item.path))continue;
|
|
113
156
|
if(item.kind!=='hook'||classify(item).status!=='translated')continue;
|
|
114
157
|
for(const w of wiringList(item)) {
|
|
158
|
+
const compatible=wiringCompatibility(item,w);if(compatible.status!=='translated')continue;
|
|
115
159
|
const command=w.command.replace(/~\/\.claude\/[^\s"]+/g, token => {
|
|
116
160
|
const tail=token.slice(10);
|
|
117
161
|
const destination=tail.startsWith('skills/')?path.join(path.dirname(targetBase),'.agents',tail):path.join(targetBase,tail);
|
|
118
162
|
return JSON.stringify(destination.replace(/\\/g,'/'));
|
|
119
163
|
});
|
|
120
164
|
const wrapped='node '+toml(path.join(targetBase,'codex-hook-adapter.js'))+' '+toml(command);
|
|
121
|
-
const
|
|
165
|
+
const matcher=compatible.matcher;
|
|
166
|
+
const entry={...(matcher?{matcher}:{}),hooks:[{type:'command',command:wrapped,...(w.timeout?{timeout:w.timeout}:{})}]};
|
|
122
167
|
if(!hooks[w.event]) hooks[w.event]=[];
|
|
123
168
|
if(!hooks[w.event].some(e=>JSON.stringify(e)===JSON.stringify(entry)))hooks[w.event].push(entry);
|
|
124
169
|
}
|
|
@@ -179,4 +224,4 @@ async function syncCodex({packageRoot,targetBase=process.env.CODEX_HOME||path.jo
|
|
|
179
224
|
const conflicts=summaries.flatMap(s=>s.unresolvedConflicts);return {runtime:'codex',targetBase,skillBase:skillBase(targetBase),bundles:summaries,coverage:matrix.filter(r=>ledger.codexBundles.includes(r.bundle)),trust,config,unresolvedConflicts:conflicts,exitCode:conflicts.length?2:(trust.status==='failed'?1:0)};
|
|
180
225
|
} finally {fs.rmSync(stage,{recursive:true,force:true});}
|
|
181
226
|
}
|
|
182
|
-
module.exports={syncCodex,coverage,classify,agentToml,filesFor,skillBase,targetFile,configBlock,hookCommands,collectHookCommands,mcpBody,planNative};
|
|
227
|
+
module.exports={syncCodex,coverage,classify,agentToml,filesFor,skillBase,targetFile,configBlock,hookCommands,collectHookCommands,mcpBody,planNative,matcherContract,adaptHookSource,wiringCompatibility};
|
package/lib/discovery.js
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const fs = require('node:fs');
|
|
3
3
|
const path = require('node:path');
|
|
4
|
+
|
|
5
|
+
const HOOK_SOURCE_DIRS = ['global/hooks', 'proxy'];
|
|
6
|
+
const SCRIPT_EXTENSIONS = /\.(py|js|sh|ps1)$/i;
|
|
7
|
+
const NON_HOOK_DIRS = new Set(['__pycache__', 'test', 'tests', '__tests__', 'node_modules']);
|
|
8
|
+
|
|
9
|
+
function hookRegistrations(manifest, repoRoot) {
|
|
10
|
+
const paths = new Set();
|
|
11
|
+
const addCommand = (command) => {
|
|
12
|
+
if (typeof command !== 'string') return;
|
|
13
|
+
const matches = [...command.matchAll(/(?:~\/\.claude|\$HOME\/\.claude|%USERPROFILE%\\\.claude)[/\\](hooks|proxy)[/\\]([^\s"']+)/gi)];
|
|
14
|
+
const match = matches.at(-1);
|
|
15
|
+
if (!match) return;
|
|
16
|
+
const rel = `${match[1].toLowerCase() === 'hooks' ? 'global/hooks' : 'proxy'}/${match[2]}`.replace(/\\/g, '/');
|
|
17
|
+
const resolved = path.resolve(repoRoot, rel);
|
|
18
|
+
if (resolved.startsWith(path.resolve(repoRoot) + path.sep) && fs.existsSync(resolved) && fs.statSync(resolved).isFile()) paths.add(rel);
|
|
19
|
+
};
|
|
20
|
+
for (const bundle of manifest.bundles || []) {
|
|
21
|
+
for (const item of bundle.items || []) {
|
|
22
|
+
const wirings = Array.isArray(item.wiring) ? item.wiring : [item.wiring];
|
|
23
|
+
for (const wiring of wirings) {
|
|
24
|
+
if (wiring && (!wiring.type || wiring.type === 'command') && typeof wiring.event === 'string') addCommand(wiring.command);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return paths;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function walkHookSources(repoRoot, registrations) {
|
|
32
|
+
const found = [];
|
|
33
|
+
for (const dir of HOOK_SOURCE_DIRS) {
|
|
34
|
+
const base = path.join(repoRoot, dir);
|
|
35
|
+
if (!fs.existsSync(base)) continue;
|
|
36
|
+
const visit = (folder) => {
|
|
37
|
+
for (const entry of fs.readdirSync(folder, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
38
|
+
if (entry.name.startsWith('.')) continue;
|
|
39
|
+
const absolute = path.join(folder, entry.name);
|
|
40
|
+
if (entry.isDirectory()) {
|
|
41
|
+
visit(absolute);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (!entry.isFile() || !SCRIPT_EXTENSIONS.test(entry.name)) continue;
|
|
45
|
+
const rel = path.relative(repoRoot, absolute).split(path.sep).join('/');
|
|
46
|
+
const descriptorPath = absolute + '.deploy.json';
|
|
47
|
+
let descriptor = {};
|
|
48
|
+
if (fs.existsSync(descriptorPath)) descriptor = JSON.parse(fs.readFileSync(descriptorPath, 'utf8'));
|
|
49
|
+
if (descriptor.path || descriptor.kind) throw new Error('Discovery metadata cannot override path/kind: ' + descriptorPath);
|
|
50
|
+
const metadataRegistersHook = descriptor.wiring && (!descriptor.wiring.type || descriptor.wiring.type === 'command') && typeof descriptor.wiring.event === 'string';
|
|
51
|
+
if (registrations.has(rel) || metadataRegistersHook) found.push({ path: rel, kind: 'hook', ...descriptor });
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
visit(base);
|
|
55
|
+
}
|
|
56
|
+
return found;
|
|
57
|
+
}
|
|
58
|
+
|
|
4
59
|
function expandManifest(raw, repoRoot) {
|
|
5
60
|
const manifest = JSON.parse(JSON.stringify(raw));
|
|
6
61
|
const internal = Array.isArray(manifest.internal) ? manifest.internal : Object.values(manifest.internal || {});
|
|
@@ -15,6 +70,7 @@ function expandManifest(raw, repoRoot) {
|
|
|
15
70
|
if (covered(rel) || entry.name.startsWith('.')) continue;
|
|
16
71
|
if (kind === 'skill' && (!entry.isDirectory() || !fs.existsSync(path.join(base, entry.name, 'SKILL.md')))) continue;
|
|
17
72
|
if (kind === 'agent' && (!entry.isFile() || !entry.name.endsWith('.md') || entry.name === 'README.md')) continue;
|
|
73
|
+
if (kind === 'hook' && entry.isDirectory() && NON_HOOK_DIRS.has(entry.name.toLowerCase())) continue;
|
|
18
74
|
if (kind === 'hook' && !entry.isDirectory() && !/\.(py|js|sh|ps1)$/.test(entry.name)) continue;
|
|
19
75
|
const descriptor = path.join(base, entry.name + '.deploy.json');
|
|
20
76
|
const extra = fs.existsSync(descriptor) ? JSON.parse(fs.readFileSync(descriptor, 'utf8')) : {};
|
|
@@ -22,6 +78,9 @@ function expandManifest(raw, repoRoot) {
|
|
|
22
78
|
items.push({path:rel,kind,...extra});
|
|
23
79
|
}
|
|
24
80
|
}
|
|
81
|
+
for (const item of walkHookSources(repoRoot, hookRegistrations(manifest, repoRoot))) {
|
|
82
|
+
if (!covered(item.path) && !items.some(existing => existing.path === item.path)) items.push(item);
|
|
83
|
+
}
|
|
25
84
|
if (items.length) manifest.bundles.push({key:'self-discovered', title:'New maintainer artifacts', summary:'Automatically discovered skills, agents and hook assets', profile:'self', advanced:false,items,deps:[],secrets:[]});
|
|
26
85
|
return manifest;
|
|
27
86
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yasaswy.nagavolu/agents",
|
|
3
|
-
"version": "0.27.
|
|
4
|
-
"description": "CLI for installing the yasaswy.nagavolu agent/skill/hook bundle. `install` opens an interactive bundle menu in a TTY (or `--bundle <key> --yes` for non-interactive installs), with hash-tracked idempotent deploys,
|
|
3
|
+
"version": "0.27.2",
|
|
4
|
+
"description": "CLI for installing the yasaswy.nagavolu agent/skill/hook bundle into Claude Code and Codex. `install` opens an interactive bundle menu in a TTY (or `--bundle <key> --yes` for non-interactive installs), with hash-tracked idempotent deploys, native hook wiring, and masked secret prompting. `update` reconciles installed bundles against the current source (hash-tracked: silent overwrite, conflict diff+prompt, or --theirs/--keep-mine). `uninstall` removes a bundle's files and wiring. `secrets` re-runs secret prompting for already-installed bundles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"engines": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"cli",
|
|
38
38
|
"agents",
|
|
39
39
|
"claude",
|
|
40
|
+
"codex",
|
|
40
41
|
"skills"
|
|
41
42
|
]
|
|
42
43
|
}
|