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:
63
skills/dev-browser/extension/utils/logger.ts
Normal file
63
skills/dev-browser/extension/utils/logger.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Logger utility for the dev-browser extension.
|
||||
* Logs to console and optionally sends to relay server.
|
||||
*/
|
||||
|
||||
export type LogLevel = "log" | "debug" | "error";
|
||||
|
||||
export interface LogMessage {
|
||||
method: "log";
|
||||
params: {
|
||||
level: LogLevel;
|
||||
args: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export type SendMessageFn = (message: unknown) => void;
|
||||
|
||||
/**
|
||||
* Creates a logger instance that logs to console and sends to relay.
|
||||
*/
|
||||
export function createLogger(sendMessage: SendMessageFn) {
|
||||
function formatArgs(args: unknown[]): string[] {
|
||||
return args.map((arg) => {
|
||||
if (arg === undefined) return "undefined";
|
||||
if (arg === null) return "null";
|
||||
if (typeof arg === "object") {
|
||||
try {
|
||||
return JSON.stringify(arg);
|
||||
} catch {
|
||||
return String(arg);
|
||||
}
|
||||
}
|
||||
return String(arg);
|
||||
});
|
||||
}
|
||||
|
||||
function sendLog(level: LogLevel, args: unknown[]): void {
|
||||
sendMessage({
|
||||
method: "log",
|
||||
params: {
|
||||
level,
|
||||
args: formatArgs(args),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
log: (...args: unknown[]) => {
|
||||
console.log("[dev-browser]", ...args);
|
||||
sendLog("log", args);
|
||||
},
|
||||
debug: (...args: unknown[]) => {
|
||||
console.debug("[dev-browser]", ...args);
|
||||
sendLog("debug", args);
|
||||
},
|
||||
error: (...args: unknown[]) => {
|
||||
console.error("[dev-browser]", ...args);
|
||||
sendLog("error", args);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export type Logger = ReturnType<typeof createLogger>;
|
||||
Reference in New Issue
Block a user