@fermindi/pwn-cli 0.3.5 β 0.3.7
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/cli/update.js +20 -0
- package/package.json +1 -1
- package/src/core/inject.js +10 -0
- package/templates/workspace/.claude/settings.json +24 -0
package/cli/update.js
CHANGED
|
@@ -26,6 +26,7 @@ const FRAMEWORK_FILES = [
|
|
|
26
26
|
*/
|
|
27
27
|
const CLAUDE_COMMANDS = [
|
|
28
28
|
'save.md',
|
|
29
|
+
'mode.md',
|
|
29
30
|
];
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -216,6 +217,25 @@ export default async function updateCommand(args = []) {
|
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
|
220
|
+
// Update .claude/settings.json (hooks) - only if doesn't exist (user config)
|
|
221
|
+
const claudeSettingsTemplate = join(__dirname, '../templates/workspace/.claude/settings.json');
|
|
222
|
+
const claudeSettingsTarget = join(cwd, '.claude', 'settings.json');
|
|
223
|
+
|
|
224
|
+
if (existsSync(claudeSettingsTemplate) && !existsSync(claudeSettingsTarget)) {
|
|
225
|
+
if (dryRun) {
|
|
226
|
+
console.log(` π Would create: .claude/settings.json (notification hooks)`);
|
|
227
|
+
} else {
|
|
228
|
+
const claudeDir = join(cwd, '.claude');
|
|
229
|
+
if (!existsSync(claudeDir)) {
|
|
230
|
+
mkdirSync(claudeDir, { recursive: true });
|
|
231
|
+
}
|
|
232
|
+
const templateContent = readFileSync(claudeSettingsTemplate, 'utf8');
|
|
233
|
+
writeFileSync(claudeSettingsTarget, templateContent);
|
|
234
|
+
console.log(` π Created: .claude/settings.json (notification hooks)`);
|
|
235
|
+
}
|
|
236
|
+
updated.push('.claude/settings.json');
|
|
237
|
+
}
|
|
238
|
+
|
|
219
239
|
// Update state.json with new version
|
|
220
240
|
if (!dryRun && existsSync(statePath)) {
|
|
221
241
|
try {
|
package/package.json
CHANGED
package/src/core/inject.js
CHANGED
|
@@ -219,6 +219,16 @@ export async function inject(options = {}) {
|
|
|
219
219
|
console.log('π Created .claude/commands/ with PWN slash commands');
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
+
|
|
223
|
+
// Copy settings.json with hooks (if doesn't exist)
|
|
224
|
+
const settingsSource = join(claudeTemplateDir, 'settings.json');
|
|
225
|
+
const settingsTarget = join(claudeDir, 'settings.json');
|
|
226
|
+
if (existsSync(settingsSource) && !existsSync(settingsTarget)) {
|
|
227
|
+
cpSync(settingsSource, settingsTarget);
|
|
228
|
+
if (!silent) {
|
|
229
|
+
console.log('π Created .claude/settings.json with notification hooks');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
222
232
|
}
|
|
223
233
|
|
|
224
234
|
// Backup other AI files (not CLAUDE.md) to .ai/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"Notification": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "permission_prompt",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "pwn notify send \"Claude Code aguardando permissΓ£o\" --title \"PWN\""
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"matcher": "idle_prompt",
|
|
15
|
+
"hooks": [
|
|
16
|
+
{
|
|
17
|
+
"type": "command",
|
|
18
|
+
"command": "pwn notify send \"Claude Code aguardando input\" --title \"PWN\""
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|