mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
auto generated tools docs, added stdio transport, added additional mcp config and permissions
This commit is contained in:
@@ -76,6 +76,7 @@ declare global {
|
||||
| {
|
||||
level: TConsoleSeverity;
|
||||
id?: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
| undefined;
|
||||
}
|
||||
@@ -86,6 +87,7 @@ const defaultLevel = env("cli_log_level", "log") as TConsoleSeverity;
|
||||
// biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
|
||||
const config = (globalThis.__consoleConfig ??= {
|
||||
level: defaultLevel,
|
||||
enabled: true,
|
||||
//id: crypto.randomUUID(), // for debugging
|
||||
});
|
||||
|
||||
@@ -95,6 +97,14 @@ export const $console = new Proxy(config as any, {
|
||||
switch (prop) {
|
||||
case "original":
|
||||
return console;
|
||||
case "disable":
|
||||
return () => {
|
||||
config.enabled = false;
|
||||
};
|
||||
case "enable":
|
||||
return () => {
|
||||
config.enabled = true;
|
||||
};
|
||||
case "setLevel":
|
||||
return (l: TConsoleSeverity) => {
|
||||
config.level = l;
|
||||
@@ -105,6 +115,10 @@ export const $console = new Proxy(config as any, {
|
||||
};
|
||||
}
|
||||
|
||||
if (!config.enabled) {
|
||||
return () => null;
|
||||
}
|
||||
|
||||
const current = keys.indexOf(config.level);
|
||||
const requested = keys.indexOf(prop as string);
|
||||
|
||||
@@ -118,6 +132,8 @@ export const $console = new Proxy(config as any, {
|
||||
} & {
|
||||
setLevel: (l: TConsoleSeverity) => void;
|
||||
resetLevel: () => void;
|
||||
disable: () => void;
|
||||
enable: () => void;
|
||||
};
|
||||
|
||||
export function colorizeConsole(con: typeof console) {
|
||||
|
||||
Reference in New Issue
Block a user