@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;" />
123 lines (116 loc) • 4.37 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/utils/console-styling.ts
var console_styling_exports = {};
__export(console_styling_exports, {
ConsoleColors: () => ConsoleColors,
ConsoleStyles: () => ConsoleStyles,
logCopilotKitPlatformMessage: () => logCopilotKitPlatformMessage,
logStyled: () => logStyled,
publicApiKeyRequired: () => publicApiKeyRequired,
styledConsole: () => styledConsole
});
module.exports = __toCommonJS(console_styling_exports);
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
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ConsoleColors,
ConsoleStyles,
logCopilotKitPlatformMessage,
logStyled,
publicApiKeyRequired,
styledConsole
});
//# sourceMappingURL=console-styling.js.map