@copilotkit/shared
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
94 lines (87 loc) • 3.1 kB
JavaScript
// src/utils/console-styling.ts
var ConsoleColors = {
/** Primary brand blue - for titles and links */
primary: "#007acc",
/** Success green - for positive messaging */
success: "#22c55e",
/** Purple - for feature highlights */
feature: "#a855f7",
/** Red - for calls-to-action */
cta: "#ef4444",
/** Cyan - for closing statements */
info: "#06b6d4",
/** Inherit console default - for body text */
inherit: "inherit",
/** Warning style */
warning: "#f59e0b"
};
var ConsoleStyles = {
/** Large header style */
header: `color: ${ConsoleColors.warning}; font-weight: bold; font-size: 16px;`,
/** Section header style */
section: `color: ${ConsoleColors.success}; font-weight: bold;`,
/** Feature highlight style */
highlight: `color: ${ConsoleColors.feature}; font-weight: bold;`,
/** Call-to-action style */
cta: `color: ${ConsoleColors.success}; font-weight: bold;`,
/** Info style */
info: `color: ${ConsoleColors.info}; font-weight: bold;`,
/** Link style */
link: `color: ${ConsoleColors.primary}; text-decoration: underline;`,
/** Body text - inherits console theme */
body: `color: ${ConsoleColors.inherit};`,
/** Warning style */
warning: `color: ${ConsoleColors.cta}; font-weight: bold;`
};
function logCopilotKitPlatformMessage() {
console.log(
`%cCopilotKit Warning%c
useCopilotChatHeadless_c provides full compatibility with CopilotKit's newly released Headless UI feature set. To enable this premium feature, add your public license key, available for free at:
%chttps://cloud.copilotkit.ai%c
Alternatively, useCopilotChat is available for basic programmatic control, and does not require an API key.
To learn more about premium features, read the documentation here:
%chttps://docs.copilotkit.ai/premium%c`,
ConsoleStyles.header,
ConsoleStyles.body,
ConsoleStyles.cta,
ConsoleStyles.body,
ConsoleStyles.link,
ConsoleStyles.body
);
}
function publicApiKeyRequired(feature) {
console.log(
`
%cCopilotKit Warning%c
In order to use ${feature}, you need to add your CopilotKit API key, available for free at https://cloud.copilotkit.ai.
`.trim(),
ConsoleStyles.header,
ConsoleStyles.body
);
}
function logStyled(template, styles) {
console.log(template, ...styles);
}
var styledConsole = {
/** Log a success message */
success: (message) => logStyled(`%c\u2705 ${message}`, [ConsoleStyles.section]),
/** Log an info message */
info: (message) => logStyled(`%c\u2139\uFE0F ${message}`, [ConsoleStyles.info]),
/** Log a feature highlight */
feature: (message) => logStyled(`%c\u2728 ${message}`, [ConsoleStyles.highlight]),
/** Log a call-to-action */
cta: (message) => logStyled(`%c\u{1F680} ${message}`, [ConsoleStyles.cta]),
/** Log the CopilotKit platform promotion */
logCopilotKitPlatformMessage,
/** Log a `publicApiKeyRequired` warning */
publicApiKeyRequired
};
export {
ConsoleColors,
ConsoleStyles,
logCopilotKitPlatformMessage,
publicApiKeyRequired,
logStyled,
styledConsole
};
//# sourceMappingURL=chunk-6W2UEO2M.mjs.map