cckit 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +88 -21
  2. package/dist/commands.d.ts.map +1 -1
  3. package/dist/commands.js +43 -14
  4. package/dist/commands.js.map +1 -1
  5. package/dist/config.d.ts.map +1 -1
  6. package/dist/config.js +57 -3
  7. package/dist/config.js.map +1 -1
  8. package/dist/i18n.d.ts.map +1 -1
  9. package/dist/i18n.js +8 -0
  10. package/dist/i18n.js.map +1 -1
  11. package/dist/index.js +87 -122
  12. package/dist/index.js.map +1 -1
  13. package/dist/interactive.d.ts +76 -0
  14. package/dist/interactive.d.ts.map +1 -0
  15. package/dist/interactive.js +1 -0
  16. package/dist/interactive.js.map +1 -0
  17. package/dist/providers.d.ts.map +1 -1
  18. package/dist/providers.js +43 -0
  19. package/dist/providers.js.map +1 -1
  20. package/dist/types.d.ts +2 -1
  21. package/dist/types.d.ts.map +1 -1
  22. package/dist/utils/constants.d.ts +68 -0
  23. package/dist/utils/constants.d.ts.map +1 -0
  24. package/dist/utils/constants.js +69 -0
  25. package/dist/utils/constants.js.map +1 -0
  26. package/dist/utils/errors.d.ts +64 -0
  27. package/dist/utils/errors.d.ts.map +1 -0
  28. package/dist/utils/errors.js +92 -0
  29. package/dist/utils/errors.js.map +1 -0
  30. package/dist/utils/helpers.d.ts +68 -0
  31. package/dist/utils/helpers.d.ts.map +1 -0
  32. package/dist/utils/helpers.js +115 -0
  33. package/dist/utils/helpers.js.map +1 -0
  34. package/dist/utils/index.d.ts +8 -0
  35. package/dist/utils/index.d.ts.map +1 -0
  36. package/dist/utils/index.js +8 -0
  37. package/dist/utils/index.js.map +1 -0
  38. package/dist/utils/logger.d.ts +38 -0
  39. package/dist/utils/logger.d.ts.map +1 -0
  40. package/dist/utils/logger.js +68 -0
  41. package/dist/utils/logger.js.map +1 -0
  42. package/package.json +18 -7
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Application constants
3
+ */
4
+ /**
5
+ * Current version of the application
6
+ * Injected by scripts/inject-version.js during build
7
+ */
8
+ export declare const APP_VERSION = "0.2.0";
9
+ /**
10
+ * Default base URLs for providers
11
+ */
12
+ export declare const DEFAULT_BASE_URLS: Readonly<{
13
+ readonly zhipu: "https://open.bigmodel.cn/api/anthropic";
14
+ readonly minimax: "https://api.minimaxi.com/anthropic";
15
+ readonly kimi: "https://api.kimi.com/coding/";
16
+ readonly zenmux: "https://zenmux.ai/api/anthropic";
17
+ readonly streamlake: "https://wanqing.streamlakeapi.com/api/gateway/v1/endpoints/kat-coder-pro-v1/claude-code-proxy";
18
+ readonly custom: "";
19
+ }>;
20
+ /**
21
+ * Default models for providers
22
+ */
23
+ export declare const DEFAULT_MODELS: Readonly<{
24
+ readonly zhipu: "GLM-4.7";
25
+ readonly minimax: "MiniMax-M2";
26
+ readonly kimi: "kimi-for-coding";
27
+ readonly zenmux: "claude-3-5-sonnet-20241022";
28
+ readonly claude: "claude-3-5-sonnet-20241022";
29
+ readonly streamlake: "kat-coder-pro-v1";
30
+ readonly custom: "";
31
+ }>;
32
+ /**
33
+ * Provider type enum
34
+ */
35
+ export declare enum ProviderType {
36
+ ZHIPU = "zhipu",
37
+ MINIMAX = "minimax",
38
+ KIMI = "kimi",
39
+ CLAUDE = "claude",
40
+ ZENMUX = "zenmux",
41
+ STREAMLAKE = "streamlake",
42
+ CUSTOM = "custom"
43
+ }
44
+ /**
45
+ * File paths
46
+ */
47
+ export declare const PATHS: Readonly<{
48
+ readonly CONFIG_DIR: ".cckit";
49
+ readonly CONFIG_FILE: "config.json";
50
+ readonly CLAUDE_DIR: ".claude";
51
+ readonly CLAUDE_SETTINGS: "settings.json";
52
+ }>;
53
+ /**
54
+ * Timeouts in milliseconds
55
+ */
56
+ export declare const TIMEOUTS: Readonly<{
57
+ readonly CLI_CHECK: 5000;
58
+ readonly API_REQUEST: 10000;
59
+ readonly USER_INPUT: 60000;
60
+ }>;
61
+ /**
62
+ * API registry mirrors
63
+ */
64
+ export declare const NPM_REGISTRIES: Readonly<{
65
+ readonly DEFAULT: "https://registry.npmjs.org";
66
+ readonly NPMMIRROR: "https://registry.npmmirror.com";
67
+ }>;
68
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;EAOnB,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;EAQhB,CAAC;AAEZ;;GAEG;AACH,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;;;;;EAKP,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;EAIV,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,cAAc;;;EAGhB,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Application constants
3
+ */
4
+ /**
5
+ * Current version of the application
6
+ * Injected by scripts/inject-version.js during build
7
+ */
8
+ export const APP_VERSION = '0.2.0';
9
+ /**
10
+ * Default base URLs for providers
11
+ */
12
+ export const DEFAULT_BASE_URLS = Object.freeze({
13
+ zhipu: 'https://open.bigmodel.cn/api/anthropic',
14
+ minimax: 'https://api.minimaxi.com/anthropic',
15
+ kimi: 'https://api.kimi.com/coding/',
16
+ zenmux: 'https://zenmux.ai/api/anthropic',
17
+ streamlake: 'https://wanqing.streamlakeapi.com/api/gateway/v1/endpoints/kat-coder-pro-v1/claude-code-proxy',
18
+ custom: '',
19
+ });
20
+ /**
21
+ * Default models for providers
22
+ */
23
+ export const DEFAULT_MODELS = Object.freeze({
24
+ zhipu: 'GLM-4.7',
25
+ minimax: 'MiniMax-M2',
26
+ kimi: 'kimi-for-coding',
27
+ zenmux: 'claude-3-5-sonnet-20241022',
28
+ claude: 'claude-3-5-sonnet-20241022',
29
+ streamlake: 'kat-coder-pro-v1',
30
+ custom: '',
31
+ });
32
+ /**
33
+ * Provider type enum
34
+ */
35
+ export var ProviderType;
36
+ (function (ProviderType) {
37
+ ProviderType["ZHIPU"] = "zhipu";
38
+ ProviderType["MINIMAX"] = "minimax";
39
+ ProviderType["KIMI"] = "kimi";
40
+ ProviderType["CLAUDE"] = "claude";
41
+ ProviderType["ZENMUX"] = "zenmux";
42
+ ProviderType["STREAMLAKE"] = "streamlake";
43
+ ProviderType["CUSTOM"] = "custom";
44
+ })(ProviderType || (ProviderType = {}));
45
+ /**
46
+ * File paths
47
+ */
48
+ export const PATHS = Object.freeze({
49
+ CONFIG_DIR: '.cckit',
50
+ CONFIG_FILE: 'config.json',
51
+ CLAUDE_DIR: '.claude',
52
+ CLAUDE_SETTINGS: 'settings.json',
53
+ });
54
+ /**
55
+ * Timeouts in milliseconds
56
+ */
57
+ export const TIMEOUTS = Object.freeze({
58
+ CLI_CHECK: 5000,
59
+ API_REQUEST: 10000,
60
+ USER_INPUT: 60000,
61
+ });
62
+ /**
63
+ * API registry mirrors
64
+ */
65
+ export const NPM_REGISTRIES = Object.freeze({
66
+ DEFAULT: 'https://registry.npmjs.org',
67
+ NPMMIRROR: 'https://registry.npmmirror.com',
68
+ });
69
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,wCAA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class for application errors
6
+ */
7
+ export declare class CCKitError extends Error {
8
+ readonly code: string;
9
+ readonly details?: unknown | undefined;
10
+ constructor(message: string, code: string, details?: unknown | undefined);
11
+ }
12
+ /**
13
+ * Error thrown when a provider is not found
14
+ */
15
+ export declare class ProviderNotFoundError extends CCKitError {
16
+ constructor(providerId: string);
17
+ }
18
+ /**
19
+ * Error thrown when a provider is not configured
20
+ */
21
+ export declare class ProviderNotConfiguredError extends CCKitError {
22
+ constructor(providerId: string);
23
+ }
24
+ /**
25
+ * Error thrown when a model is not found in provider
26
+ */
27
+ export declare class ModelNotFoundError extends CCKitError {
28
+ constructor(modelName: string, providerId: string);
29
+ }
30
+ /**
31
+ * Error thrown when configuration file is invalid
32
+ */
33
+ export declare class InvalidConfigError extends CCKitError {
34
+ readonly filePath?: string | undefined;
35
+ constructor(message: string, filePath?: string | undefined);
36
+ }
37
+ /**
38
+ * Error thrown when Claude Code installation check fails
39
+ */
40
+ export declare class ClaudeCodeNotInstalledError extends CCKitError {
41
+ constructor();
42
+ }
43
+ /**
44
+ * Error thrown when an operation times out
45
+ */
46
+ export declare class TimeoutError extends CCKitError {
47
+ constructor(operation: string, timeout: number);
48
+ }
49
+ /**
50
+ * Error thrown when file system operation fails
51
+ */
52
+ export declare class FileSystemError extends CCKitError {
53
+ readonly originalError?: Error | undefined;
54
+ constructor(operation: string, filePath: string, originalError?: Error | undefined);
55
+ }
56
+ /**
57
+ * Type guard to check if error is a CCKitError
58
+ */
59
+ export declare function isCCKitError(error: unknown): error is CCKitError;
60
+ /**
61
+ * Gets a user-friendly error message
62
+ */
63
+ export declare function getErrorMessage(error: unknown): string;
64
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAGjB,IAAI,EAAE,MAAM;aACZ,OAAO,CAAC,EAAE,OAAO;gBAFjC,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,OAAO,YAAA;CAMpC;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,UAAU;gBACvC,UAAU,EAAE,MAAM;CAO/B;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,UAAU;gBAC5C,UAAU,EAAE,MAAM;CAO/B;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAOlD;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;aACH,QAAQ,CAAC,EAAE,MAAM;gBAAlD,OAAO,EAAE,MAAM,EAAkB,QAAQ,CAAC,EAAE,MAAM,YAAA;CAO/D;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,UAAU;;CAO1D;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU;gBAC9B,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAO/C;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,UAAU;aAI3B,aAAa,CAAC,EAAE,KAAK;gBAFrC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EACA,aAAa,CAAC,EAAE,KAAK,YAAA;CAQxC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUtD"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Custom error classes
3
+ */
4
+ /**
5
+ * Base error class for application errors
6
+ */
7
+ export class CCKitError extends Error {
8
+ constructor(message, code, details) {
9
+ super(message);
10
+ this.code = code;
11
+ this.details = details;
12
+ this.name = this.constructor.name;
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ }
16
+ /**
17
+ * Error thrown when a provider is not found
18
+ */
19
+ export class ProviderNotFoundError extends CCKitError {
20
+ constructor(providerId) {
21
+ super(`Provider '${providerId}' not found`, 'PROVIDER_NOT_FOUND', { providerId });
22
+ }
23
+ }
24
+ /**
25
+ * Error thrown when a provider is not configured
26
+ */
27
+ export class ProviderNotConfiguredError extends CCKitError {
28
+ constructor(providerId) {
29
+ super(`Provider '${providerId}' is not configured with an API key`, 'PROVIDER_NOT_CONFIGURED', { providerId });
30
+ }
31
+ }
32
+ /**
33
+ * Error thrown when a model is not found in provider
34
+ */
35
+ export class ModelNotFoundError extends CCKitError {
36
+ constructor(modelName, providerId) {
37
+ super(`Model '${modelName}' not found in provider '${providerId}'`, 'MODEL_NOT_FOUND', { modelName, providerId });
38
+ }
39
+ }
40
+ /**
41
+ * Error thrown when configuration file is invalid
42
+ */
43
+ export class InvalidConfigError extends CCKitError {
44
+ constructor(message, filePath) {
45
+ super(`Invalid configuration: ${message}`, 'INVALID_CONFIG', { filePath });
46
+ this.filePath = filePath;
47
+ }
48
+ }
49
+ /**
50
+ * Error thrown when Claude Code installation check fails
51
+ */
52
+ export class ClaudeCodeNotInstalledError extends CCKitError {
53
+ constructor() {
54
+ super('Claude Code is not installed', 'CLAUDE_CODE_NOT_INSTALLED');
55
+ }
56
+ }
57
+ /**
58
+ * Error thrown when an operation times out
59
+ */
60
+ export class TimeoutError extends CCKitError {
61
+ constructor(operation, timeout) {
62
+ super(`${operation} timed out after ${timeout}ms`, 'TIMEOUT', { operation, timeout });
63
+ }
64
+ }
65
+ /**
66
+ * Error thrown when file system operation fails
67
+ */
68
+ export class FileSystemError extends CCKitError {
69
+ constructor(operation, filePath, originalError) {
70
+ super(`Failed to ${operation} file: ${filePath}`, 'FILESYSTEM_ERROR', { filePath, originalError: originalError?.message });
71
+ this.originalError = originalError;
72
+ }
73
+ }
74
+ /**
75
+ * Type guard to check if error is a CCKitError
76
+ */
77
+ export function isCCKitError(error) {
78
+ return error instanceof CCKitError;
79
+ }
80
+ /**
81
+ * Gets a user-friendly error message
82
+ */
83
+ export function getErrorMessage(error) {
84
+ if (isCCKitError(error)) {
85
+ return error.message;
86
+ }
87
+ if (error instanceof Error) {
88
+ return error.message;
89
+ }
90
+ return String(error);
91
+ }
92
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YACE,OAAe,EACC,IAAY,EACZ,OAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAU;QAGjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IACnD,YAAY,UAAkB;QAC5B,KAAK,CACH,aAAa,UAAU,aAAa,EACpC,oBAAoB,EACpB,EAAE,UAAU,EAAE,CACf,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,UAAU;IACxD,YAAY,UAAkB;QAC5B,KAAK,CACH,aAAa,UAAU,qCAAqC,EAC5D,yBAAyB,EACzB,EAAE,UAAU,EAAE,CACf,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAChD,YAAY,SAAiB,EAAE,UAAkB;QAC/C,KAAK,CACH,UAAU,SAAS,4BAA4B,UAAU,GAAG,EAC5D,iBAAiB,EACjB,EAAE,SAAS,EAAE,UAAU,EAAE,CAC1B,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAm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
+ */
4
+ import type { ModelProvider } from '../types.js';
5
+ /**
6
+ * Masks an API key for secure display
7
+ * @param apiKey - The API key to mask
8
+ * @param visibleChars - Number of characters to show at the beginning (default: 8)
9
+ * @returns Masked API key string
10
+ */
11
+ export declare function maskApiKey(apiKey: string, visibleChars?: number): string;
12
+ /**
13
+ * Finds a provider by ID, name, or type
14
+ * @param providers - Array of providers to search
15
+ * @param identifier - Provider ID, name, or type
16
+ * @returns Found provider or undefined
17
+ */
18
+ export declare function findProvider(providers: ModelProvider[], identifier: string): ModelProvider | undefined;
19
+ /**
20
+ * Provider type mapping configuration
21
+ */
22
+ export declare const PROVIDER_TYPE_MAP: Record<string, [string, string]>;
23
+ /**
24
+ * Gets provider type and display name from identifier
25
+ * @param identifier - Provider identifier
26
+ * @returns Tuple of [providerType, displayName] or null
27
+ */
28
+ export declare function getProviderTypeInfo(identifier: string): [string, string] | null;
29
+ /**
30
+ * Formats file size for display
31
+ * @param bytes - Size in bytes
32
+ * @returns Formatted size string
33
+ */
34
+ export declare function formatBytes(bytes: number): string;
35
+ /**
36
+ * Safely executes a function and handles errors
37
+ * @param fn - Function to execute
38
+ * @param errorHandler - Error handler function
39
+ * @returns Result or undefined if error occurred
40
+ */
41
+ export declare function safeExecute<T>(fn: () => T, errorHandler?: (error: Error) => void): T | undefined;
42
+ /**
43
+ * Creates a promise that resolves after a delay
44
+ * @param ms - Milliseconds to delay
45
+ * @returns Promise that resolves after delay
46
+ */
47
+ export declare function delay(ms: number): Promise<void>;
48
+ /**
49
+ * Checks if a value is defined and not null
50
+ * @param value - Value to check
51
+ * @returns True if value is defined and not null
52
+ */
53
+ export declare function isDefined<T>(value: T | null | undefined): value is T;
54
+ /**
55
+ * Gets the active model for a provider
56
+ * @param provider - Provider configuration
57
+ * @returns Active model name or undefined
58
+ */
59
+ export declare function getActiveModel(provider: ModelProvider): string | undefined;
60
+ /**
61
+ * Wraps an async function with timeout
62
+ * @param promise - Promise to wrap
63
+ * @param timeoutMs - Timeout in milliseconds
64
+ * @param errorMessage - Error message on timeout
65
+ * @returns Promise that rejects on timeout
66
+ */
67
+ export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, errorMessage?: string): Promise<T>;
68
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,GAAE,MAAU,GAAG,MAAM,CAK3E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,aAAa,EAAE,EAC1B,UAAU,EAAE,MAAM,GACjB,aAAa,GAAG,SAAS,CAI3B;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAU9D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GACjB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAEzB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,EAAE,EAAE,MAAM,CAAC,EACX,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GACpC,CAAC,GAAG,SAAS,CAUf;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,CAAC,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,GAAE,MAA8B,GAC3C,OAAO,CAAC,CAAC,CAAC,CAOZ"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Helper utility functions
3
+ */
4
+ /**
5
+ * Masks an API key for secure display
6
+ * @param apiKey - The API key to mask
7
+ * @param visibleChars - Number of characters to show at the beginning (default: 8)
8
+ * @returns Masked API key string
9
+ */
10
+ export function maskApiKey(apiKey, visibleChars = 8) {
11
+ if (!apiKey || apiKey.length <= visibleChars) {
12
+ return apiKey ? apiKey.substring(0, 4) + '***' : '***';
13
+ }
14
+ return apiKey.substring(0, visibleChars) + '***';
15
+ }
16
+ /**
17
+ * Finds a provider by ID, name, or type
18
+ * @param providers - Array of providers to search
19
+ * @param identifier - Provider ID, name, or type
20
+ * @returns Found provider or undefined
21
+ */
22
+ export function findProvider(providers, identifier) {
23
+ return providers.find((p) => p.id === identifier || p.name === identifier || p.provider_type === identifier);
24
+ }
25
+ /**
26
+ * Provider type mapping configuration
27
+ */
28
+ export const PROVIDER_TYPE_MAP = {
29
+ zhipu: ['zhipu', '智谱LLM (Zhipu)'],
30
+ '智谱': ['zhipu', '智谱LLM (Zhipu)'],
31
+ minimax: ['minimax', 'MiniMax'],
32
+ kimi: ['kimi', 'Kimi (Moonshot)'],
33
+ claude: ['claude', 'Claude (Official)'],
34
+ zenmux: ['zenmux', 'ZenMux.ai'],
35
+ streamlake: ['streamlake', 'Kuaishou StreamLake'],
36
+ kuaishou: ['streamlake', 'Kuaishou StreamLake'],
37
+ '快手': ['streamlake', 'Kuaishou StreamLake'],
38
+ };
39
+ /**
40
+ * Gets provider type and display name from identifier
41
+ * @param identifier - Provider identifier
42
+ * @returns Tuple of [providerType, displayName] or null
43
+ */
44
+ export function getProviderTypeInfo(identifier) {
45
+ return PROVIDER_TYPE_MAP[identifier] || null;
46
+ }
47
+ /**
48
+ * Formats file size for display
49
+ * @param bytes - Size in bytes
50
+ * @returns Formatted size string
51
+ */
52
+ export function formatBytes(bytes) {
53
+ if (bytes === 0)
54
+ return '0 B';
55
+ const k = 1024;
56
+ const sizes = ['B', 'KB', 'MB', 'GB'];
57
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
58
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
59
+ }
60
+ /**
61
+ * Safely executes a function and handles errors
62
+ * @param fn - Function to execute
63
+ * @param errorHandler - Error handler function
64
+ * @returns Result or undefined if error occurred
65
+ */
66
+ export function safeExecute(fn, errorHandler) {
67
+ try {
68
+ return fn();
69
+ }
70
+ catch (error) {
71
+ const err = error instanceof Error ? error : new Error(String(error));
72
+ if (errorHandler) {
73
+ errorHandler(err);
74
+ }
75
+ return undefined;
76
+ }
77
+ }
78
+ /**
79
+ * Creates a promise that resolves after a delay
80
+ * @param ms - Milliseconds to delay
81
+ * @returns Promise that resolves after delay
82
+ */
83
+ export function delay(ms) {
84
+ return new Promise((resolve) => setTimeout(resolve, ms));
85
+ }
86
+ /**
87
+ * Checks if a value is defined and not null
88
+ * @param value - Value to check
89
+ * @returns True if value is defined and not null
90
+ */
91
+ export function isDefined(value) {
92
+ return value !== null && value !== undefined;
93
+ }
94
+ /**
95
+ * Gets the active model for a provider
96
+ * @param provider - Provider configuration
97
+ * @returns Active model name or undefined
98
+ */
99
+ export function getActiveModel(provider) {
100
+ return provider.current_model || provider.models[0];
101
+ }
102
+ /**
103
+ * Wraps an async function with timeout
104
+ * @param promise - Promise to wrap
105
+ * @param timeoutMs - Timeout in milliseconds
106
+ * @param errorMessage - Error message on timeout
107
+ * @returns Promise that rejects on timeout
108
+ */
109
+ export function withTimeout(promise, timeoutMs, errorMessage = 'Operation timed out') {
110
+ return Promise.race([
111
+ promise,
112
+ new Promise((_, reject) => setTimeout(() => reject(new Error(errorMessage)), timeoutMs)),
113
+ ]);
114
+ }
115
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,eAAuB,CAAC;IACjE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,YAAY,EAAE,CAAC;QAC7C,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,SAA0B,EAC1B,UAAkB;IAElB,OAAO,SAAS,CAAC,IAAI,CACnB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,CAAC,aAAa,KAAK,UAAU,CACtF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC;IACjE,KAAK,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC;IACjC,IAAI,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC;IAChC,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;IAC/B,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACjC,MAAM,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,MAAM,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,UAAU,EAAE,CAAC,Y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;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAI,KAA2B;IACtD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAuB;IACpD,OAAO,QAAQ,CAAC,aAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,OAAmB,EACnB,SAAiB,EACjB,eAAuB,qBAAqB;IAE5C,OAAO,OAAO,CAAC,IAAI,CAAC;QAClB,OAAO;QACP,IAAI,OAAO,CAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAC3B,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,SAAS,CAAC,CAC7D;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Utilities index
3
+ */
4
+ export * from './helpers.js';
5
+ export * from './constants.js';
6
+ export * from './errors.js';
7
+ export * from './logger.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Utilities index
3
+ */
4
+ export * from './helpers.js';
5
+ export * from './constants.js';
6
+ export * from './errors.js';
7
+ export * from './logger.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Logging utilities
3
+ */
4
+ /**
5
+ * Log levels
6
+ */
7
+ export declare enum LogLevel {
8
+ DEBUG = 0,
9
+ INFO = 1,
10
+ WARN = 2,
11
+ ERROR = 3,
12
+ SUCCESS = 4
13
+ }
14
+ /**
15
+ * Simple logger class
16
+ */
17
+ export declare class Logger {
18
+ private level;
19
+ setLevel(level: LogLevel): void;
20
+ debug(message: string, ...args: unknown[]): void;
21
+ info(message: string, ...args: unknown[]): void;
22
+ warn(message: string, ...args: unknown[]): void;
23
+ error(message: string, ...args: unknown[]): void;
24
+ success(message: string, ...args: unknown[]): void;
25
+ }
26
+ /**
27
+ * Global logger instance
28
+ */
29
+ export declare const logger: Logger;
30
+ /**
31
+ * Sets the log level
32
+ */
33
+ export declare function setLogLevel(level: LogLevel): void;
34
+ /**
35
+ * Enables debug mode
36
+ */
37
+ export declare function enableDebugMode(): void;
38
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;IACT,OAAO,IAAI;CACZ;AAED;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,KAAK,CAA2B;IAExC,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMhD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMhD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAKnD;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,QAAe,CAAC;AAEnC;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Logging utilities
3
+ */
4
+ import chalk from 'chalk';
5
+ /**
6
+ * Log levels
7
+ */
8
+ export var LogLevel;
9
+ (function (LogLevel) {
10
+ LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
11
+ LogLevel[LogLevel["INFO"] = 1] = "INFO";
12
+ LogLevel[LogLevel["WARN"] = 2] = "WARN";
13
+ LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
14
+ LogLevel[LogLevel["SUCCESS"] = 4] = "SUCCESS";
15
+ })(LogLevel || (LogLevel = {}));
16
+ /**
17
+ * Simple logger class
18
+ */
19
+ export class Logger {
20
+ constructor() {
21
+ this.level = LogLevel.INFO;
22
+ }
23
+ setLevel(level) {
24
+ this.level = level;
25
+ }
26
+ debug(message, ...args) {
27
+ if (this.level <= LogLevel.DEBUG) {
28
+ console.log(chalk.gray('[DEBUG]'), message, ...args);
29
+ }
30
+ }
31
+ info(message, ...args) {
32
+ if (this.level <= LogLevel.INFO) {
33
+ console.log(chalk.blue('[INFO]'), message, ...args);
34
+ }
35
+ }
36
+ warn(message, ...args) {
37
+ if (this.level <= LogLevel.WARN) {
38
+ console.log(chalk.yellow('[WARN]'), message, ...args);
39
+ }
40
+ }
41
+ error(message, ...args) {
42
+ if (this.level <= LogLevel.ERROR) {
43
+ console.error(chalk.red('[ERROR]'), message, ...args);
44
+ }
45
+ }
46
+ success(message, ...args) {
47
+ if (this.level <= LogLevel.SUCCESS) {
48
+ console.log(chalk.green('[SUCCESS]'), message, ...args);
49
+ }
50
+ }
51
+ }
52
+ /**
53
+ * Global logger instance
54
+ */
55
+ export const logger = new Logger();
56
+ /**
57
+ * Sets the log level
58
+ */
59
+ export function setLogLevel(level) {
60
+ logger.setLevel(level);
61
+ }
62
+ /**
63
+ * Enables debug mode
64
+ */
65
+ export function enableDebugMode() {
66
+ logger.setLevel(LogLevel.DEBUG);
67
+ }
68
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,6CAAW,CAAA;AACb,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAED;;GAEG;AACH,MAAM,OAAO,MAAM;IAAnB;QACU,UAAK,GAAa,QAAQ,CAAC,IAAI,CAAC;IAmC1C,CAAC;IAjCC,QAAQ,CAAC,KAAe;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,IAAI,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC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