UNPKG

@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;" />

31 lines (28 loc) 2.18 kB
export { BaseCondition, ComparisonCondition, ComparisonRule, Condition, ExistenceCondition, ExistenceRule, LogicalCondition, LogicalRule, Rule, executeConditions } from './conditions.js'; export { ConsoleColors, ConsoleStyles, logCopilotKitPlatformMessage, logStyled, publicApiKeyRequired, styledConsole } from './console-styling.js'; export { BANNER_ERROR_NAMES, COPILOT_CLOUD_ERROR_NAMES, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, MissingPublicApiKeyError, ResolvedCopilotKitError, Severity, UpgradeRequiredError, ensureStructuredError, getPossibleVersionMismatch, isStructuredCopilotKitError } from './errors.js'; export { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, jsonSchemaToActionParameters } from './json-schema.js'; export { dataToUUID, isValidUUID, randomId, randomUUID } from './random-id.js'; import 'graphql'; import 'zod'; import '../types/action.js'; /** * Safely parses a JSON string into an object * @param json The JSON string to parse * @param fallback Optional fallback value to return if parsing fails. If not provided or set to "unset", returns null * @returns The parsed JSON object, or the fallback value (or null) if parsing fails */ declare function parseJson(json: string, fallback?: any): any; /** * Maps an array of items to a new array, skipping items that throw errors during mapping * @param items The array to map * @param callback The mapping function to apply to each item * @returns A new array containing only the successfully mapped items */ declare function tryMap<TItem, TMapped>(items: TItem[], callback: (item: TItem, index: number, array: TItem[]) => TMapped): TMapped[]; /** * Checks if the current environment is macOS * @returns {boolean} True if running on macOS, false otherwise */ declare function isMacOS(): boolean; export { isMacOS, parseJson, tryMap };