SuperCharge Claude Code v1.0.0 - Complete Customization Package
Features: - 30+ Custom Skills (cognitive, development, UI/UX, autonomous agents) - RalphLoop autonomous agent integration - Multi-AI consultation (Qwen) - Agent management system with sync capabilities - Custom hooks for session management - MCP servers integration - Plugin marketplace setup - Comprehensive installation script Components: - Skills: always-use-superpowers, ralph, brainstorming, ui-ux-pro-max, etc. - Agents: 100+ agents across engineering, marketing, product, etc. - Hooks: session-start-superpowers, qwen-consult, ralph-auto-trigger - Commands: /brainstorm, /write-plan, /execute-plan - MCP Servers: zai-mcp-server, web-search-prime, web-reader, zread - Binaries: ralphloop wrapper Installation: ./supercharge.sh
This commit is contained in:
36
plugins/claude-code-safety-net/src/core/format.ts
Normal file
36
plugins/claude-code-safety-net/src/core/format.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
type RedactFn = (text: string) => string;
|
||||
|
||||
export interface FormatBlockedMessageInput {
|
||||
reason: string;
|
||||
command?: string;
|
||||
segment?: string;
|
||||
maxLen?: number;
|
||||
redact?: RedactFn;
|
||||
}
|
||||
|
||||
export function formatBlockedMessage(input: FormatBlockedMessageInput): string {
|
||||
const { reason, command, segment } = input;
|
||||
const maxLen = input.maxLen ?? 200;
|
||||
const redact = input.redact ?? ((t: string) => t);
|
||||
|
||||
let message = `BLOCKED by Safety Net\n\nReason: ${reason}`;
|
||||
|
||||
if (command) {
|
||||
const safeCommand = redact(command);
|
||||
message += `\n\nCommand: ${excerpt(safeCommand, maxLen)}`;
|
||||
}
|
||||
|
||||
if (segment && segment !== command) {
|
||||
const safeSegment = redact(segment);
|
||||
message += `\n\nSegment: ${excerpt(safeSegment, maxLen)}`;
|
||||
}
|
||||
|
||||
message +=
|
||||
'\n\nIf this operation is truly needed, ask the user for explicit permission and have them run the command manually.';
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
function excerpt(text: string, maxLen: number): string {
|
||||
return text.length > maxLen ? `${text.slice(0, maxLen)}...` : text;
|
||||
}
|
||||
Reference in New Issue
Block a user