Files
zCode-CLI-X/~/.npm-cache/execa@9.6.1@@@1/lib/verbose/default.js
admin 875c7f9b91 feat: Complete zCode CLI X with Telegram bot integration
- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
2026-05-05 09:01:26 +00:00

55 lines
1.4 KiB
JavaScript

import figures from 'figures';
import {
gray,
bold,
redBright,
yellowBright,
} from 'yoctocolors';
// Default when `verbose` is not a function
export const defaultVerboseFunction = ({
type,
message,
timestamp,
piped,
commandId,
result: {failed = false} = {},
options: {reject = true},
}) => {
const timestampString = serializeTimestamp(timestamp);
const icon = ICONS[type]({failed, reject, piped});
const color = COLORS[type]({reject});
return `${gray(`[${timestampString}]`)} ${gray(`[${commandId}]`)} ${color(icon)} ${color(message)}`;
};
// Prepending the timestamp allows debugging the slow paths of a subprocess
const serializeTimestamp = timestamp => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;
const padField = (field, padding) => String(field).padStart(padding, '0');
const getFinalIcon = ({failed, reject}) => {
if (!failed) {
return figures.tick;
}
return reject ? figures.cross : figures.warning;
};
const ICONS = {
command: ({piped}) => piped ? '|' : '$',
output: () => ' ',
ipc: () => '*',
error: getFinalIcon,
duration: getFinalIcon,
};
const identity = string => string;
const COLORS = {
command: () => bold,
output: () => identity,
ipc: () => identity,
error: ({reject}) => reject ? redBright : yellowBright,
duration: () => gray,
};