cckit 0.1.4 → 0.1.5

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.
@@ -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,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,IAAI,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAAe,EAAE,GAAG,IAAe;QACzC,IAAI,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAe;IACzC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cckit",
3
- "version": "0.1.4",
4
- "description": "Code Kit for Claude Model Switching - Support 智谱LLM, MiniMax, Kimi, ZenMux.ai",
3
+ "version": "0.1.5",
4
+ "description": "Code Kit for Claude Model Switching - Support 智谱LLM, MiniMax, Kimi, Kuaishou StreamLake, ZenMux.ai",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -14,11 +14,17 @@
14
14
  "LICENSE"
15
15
  ],
16
16
  "scripts": {
17
- "build": "tsc",
18
- "build:minify": "tsc && node scripts/minify.js",
19
- "build:prod": "tsc && node scripts/minify.js",
17
+ "prebuild": "node scripts/inject-version.js",
18
+ "build": "node scripts/inject-version.js && tsc",
19
+ "build:minify": "node scripts/inject-version.js && tsc && node scripts/minify.js",
20
+ "build:prod": "node scripts/inject-version.js && tsc && node scripts/minify.js",
20
21
  "build:info": "node scripts/build-info.js",
21
22
  "dev": "ts-node src/index.ts",
23
+ "release": "standard-version",
24
+ "release:patch": "standard-version --release-as patch",
25
+ "release:minor": "standard-version --release-as minor",
26
+ "release:major": "standard-version --release-as major",
27
+ "postrelease": "npm run build:prod && git push --follow-tags && npm publish",
22
28
  "test": "echo \"Error: no test specified\" && exit 1",
23
29
  "prepublishOnly": "npm run build:prod",
24
30
  "prepare": "npm run build"
@@ -31,6 +37,8 @@
31
37
  "zhipu",
32
38
  "minimax",
33
39
  "kimi",
40
+ "kuaishou",
41
+ "streamlake",
34
42
  "zenmux",
35
43
  "anthropic",
36
44
  "cli",
@@ -54,7 +62,8 @@
54
62
  "@types/yargs": "^17.0.35",
55
63
  "terser": "^5.36.0",
56
64
  "ts-node": "^10.9.2",
57
- "typescript": "^5.9.3"
65
+ "typescript": "^5.9.3",
66
+ "standard-version": "^9.5.0"
58
67
  },
59
68
  "dependencies": {
60
69
  "axios": "^1.13.2",