wangchuan 2.9.0 → 2.11.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.
- package/dist/bin/wangchuan.js +18 -1
- package/dist/bin/wangchuan.js.map +1 -1
- package/dist/src/agents/claude.d.ts +6 -0
- package/dist/src/agents/claude.d.ts.map +1 -0
- package/dist/src/agents/claude.js +27 -0
- package/dist/src/agents/claude.js.map +1 -0
- package/dist/src/agents/codebuddy.d.ts +6 -0
- package/dist/src/agents/codebuddy.d.ts.map +1 -0
- package/dist/src/agents/codebuddy.js +33 -0
- package/dist/src/agents/codebuddy.js.map +1 -0
- package/dist/src/agents/cursor.d.ts +6 -0
- package/dist/src/agents/cursor.d.ts.map +1 -0
- package/dist/src/agents/cursor.js +32 -0
- package/dist/src/agents/cursor.js.map +1 -0
- package/dist/src/agents/gemini.d.ts +6 -0
- package/dist/src/agents/gemini.d.ts.map +1 -0
- package/dist/src/agents/gemini.js +22 -0
- package/dist/src/agents/gemini.js.map +1 -0
- package/dist/src/agents/index.d.ts +26 -0
- package/dist/src/agents/index.d.ts.map +1 -0
- package/dist/src/agents/index.js +56 -0
- package/dist/src/agents/index.js.map +1 -0
- package/dist/src/agents/openclaw.d.ts +6 -0
- package/dist/src/agents/openclaw.d.ts.map +1 -0
- package/dist/src/agents/openclaw.js +25 -0
- package/dist/src/agents/openclaw.js.map +1 -0
- package/dist/src/agents/types.d.ts +15 -0
- package/dist/src/agents/types.d.ts.map +1 -0
- package/dist/src/agents/types.js +5 -0
- package/dist/src/agents/types.js.map +1 -0
- package/dist/src/agents/workbuddy.d.ts +6 -0
- package/dist/src/agents/workbuddy.d.ts.map +1 -0
- package/dist/src/agents/workbuddy.js +34 -0
- package/dist/src/agents/workbuddy.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +14 -0
- package/dist/src/commands/doctor.d.ts.map +1 -0
- package/dist/src/commands/doctor.js +194 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/init.d.ts +7 -0
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +47 -13
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/pull.d.ts.map +1 -1
- package/dist/src/commands/pull.js +11 -1
- package/dist/src/commands/pull.js.map +1 -1
- package/dist/src/commands/push.d.ts.map +1 -1
- package/dist/src/commands/push.js +11 -0
- package/dist/src/commands/push.js.map +1 -1
- package/dist/src/commands/report.d.ts +11 -0
- package/dist/src/commands/report.d.ts.map +1 -0
- package/dist/src/commands/report.js +141 -0
- package/dist/src/commands/report.js.map +1 -0
- package/dist/src/commands/sync.d.ts.map +1 -1
- package/dist/src/commands/sync.js +11 -1
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/core/config.d.ts +3 -3
- package/dist/src/core/config.d.ts.map +1 -1
- package/dist/src/core/config.js +5 -143
- package/dist/src/core/config.js.map +1 -1
- package/dist/src/core/sync-lock.d.ts +31 -0
- package/dist/src/core/sync-lock.d.ts.map +1 -0
- package/dist/src/core/sync-lock.js +95 -0
- package/dist/src/core/sync-lock.js.map +1 -0
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/i18n.js +53 -0
- package/dist/src/i18n.js.map +1 -1
- package/dist/src/types.d.ts +5 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +5 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/logger.d.ts +10 -1
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/logger.js +43 -10
- package/dist/src/utils/logger.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* logger.ts —
|
|
2
|
+
* logger.ts — Structured logging with level filtering, timestamps, and JSON output
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* WANGCHUAN_LOG_LEVEL env: silent | error | warn | info | debug (default: info)
|
|
6
|
+
* WANGCHUAN_LOG_FORMAT env: json — outputs JSON lines for machine parsing
|
|
7
|
+
* Timestamp prefix in debug mode: [ISO8601] [LEVEL] message
|
|
8
|
+
* trace() method for very verbose output (only emitted in debug level)
|
|
3
9
|
*/
|
|
10
|
+
export type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'debug';
|
|
4
11
|
export declare const logger: {
|
|
5
12
|
readonly info: (...a: unknown[]) => void;
|
|
6
13
|
readonly ok: (...a: unknown[]) => void;
|
|
@@ -8,6 +15,8 @@ export declare const logger: {
|
|
|
8
15
|
readonly error: (...a: unknown[]) => void;
|
|
9
16
|
readonly debug: (...a: unknown[]) => void;
|
|
10
17
|
readonly step: (...a: unknown[]) => void;
|
|
18
|
+
/** Very verbose tracing — only emitted when log level is debug */
|
|
19
|
+
readonly trace: (...a: unknown[]) => void;
|
|
11
20
|
readonly banner: (text: string) => void;
|
|
12
21
|
};
|
|
13
22
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AA4CtE,eAAO,MAAM,MAAM;0BACH,OAAO,EAAE;wBACT,OAAO,EAAE;0BACT,OAAO,EAAE;2BACT,OAAO,EAAE;2BACT,OAAO,EAAE;0BACT,OAAO,EAAE;IAEvB,kEAAkE;2BACpD,OAAO,EAAE;4BAEV,MAAM,KAAG,IAAI;CAUlB,CAAC"}
|
package/dist/src/utils/logger.js
CHANGED
|
@@ -1,21 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* logger.ts —
|
|
2
|
+
* logger.ts — Structured logging with level filtering, timestamps, and JSON output
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* WANGCHUAN_LOG_LEVEL env: silent | error | warn | info | debug (default: info)
|
|
6
|
+
* WANGCHUAN_LOG_FORMAT env: json — outputs JSON lines for machine parsing
|
|
7
|
+
* Timestamp prefix in debug mode: [ISO8601] [LEVEL] message
|
|
8
|
+
* trace() method for very verbose output (only emitted in debug level)
|
|
3
9
|
*/
|
|
4
10
|
import chalk from 'chalk';
|
|
5
|
-
const LEVELS = {
|
|
6
|
-
const rawLevel = process.env['WANGCHUAN_LOG_LEVEL'] ?? 'info';
|
|
11
|
+
const LEVELS = { silent: -1, error: 3, warn: 2, info: 1, debug: 0 };
|
|
12
|
+
const rawLevel = (process.env['WANGCHUAN_LOG_LEVEL'] ?? 'info');
|
|
7
13
|
const currentLevel = LEVELS[rawLevel] ?? LEVELS.info;
|
|
14
|
+
const isJsonFormat = process.env['WANGCHUAN_LOG_FORMAT'] === 'json';
|
|
15
|
+
const isDebugLevel = currentLevel === LEVELS.debug;
|
|
8
16
|
const prefix = {
|
|
9
|
-
info: chalk.cyan('
|
|
10
|
-
ok: chalk.green('
|
|
11
|
-
warn: chalk.yellow('
|
|
12
|
-
error: chalk.red('
|
|
13
|
-
debug: chalk.gray('
|
|
14
|
-
step: chalk.blue('
|
|
17
|
+
info: chalk.cyan('\u2139'),
|
|
18
|
+
ok: chalk.green('\u2714'),
|
|
19
|
+
warn: chalk.yellow('\u26A0'),
|
|
20
|
+
error: chalk.red('\u2716'),
|
|
21
|
+
debug: chalk.gray('\u00B7'),
|
|
22
|
+
step: chalk.blue('\u203A'),
|
|
23
|
+
trace: chalk.gray('\u2026'),
|
|
15
24
|
};
|
|
25
|
+
/** Emit a JSON line to stdout */
|
|
26
|
+
function emitJson(level, args) {
|
|
27
|
+
const msg = args.map(a => (typeof a === 'string' ? a : JSON.stringify(a))).join(' ');
|
|
28
|
+
const line = JSON.stringify({ level, msg, ts: new Date().toISOString() });
|
|
29
|
+
console.log(line);
|
|
30
|
+
}
|
|
16
31
|
function log(level, symbol, ...args) {
|
|
17
32
|
if (LEVELS[level] < currentLevel)
|
|
18
33
|
return;
|
|
34
|
+
if (isJsonFormat) {
|
|
35
|
+
emitJson(level, args);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (isDebugLevel) {
|
|
39
|
+
const ts = chalk.gray(`[${new Date().toISOString()}]`);
|
|
40
|
+
const tag = chalk.gray(`[${level.toUpperCase()}]`);
|
|
41
|
+
console.log(ts, tag, symbol, ...args);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
19
44
|
console.log(symbol, ...args);
|
|
20
45
|
}
|
|
21
46
|
export const logger = {
|
|
@@ -25,9 +50,17 @@ export const logger = {
|
|
|
25
50
|
error: (...a) => log('error', prefix['error'], chalk.red(String(a[0])), ...a.slice(1)),
|
|
26
51
|
debug: (...a) => log('debug', prefix['debug'], chalk.gray(String(a[0])), ...a.slice(1)),
|
|
27
52
|
step: (...a) => log('info', prefix['step'], ...a),
|
|
53
|
+
/** Very verbose tracing — only emitted when log level is debug */
|
|
54
|
+
trace: (...a) => log('debug', prefix['trace'], chalk.gray(String(a[0])), ...a.slice(1)),
|
|
28
55
|
banner(text) {
|
|
56
|
+
if (currentLevel === LEVELS.silent)
|
|
57
|
+
return;
|
|
58
|
+
if (isJsonFormat) {
|
|
59
|
+
emitJson('info', [`\u2554\u2550\u2550 ${text} \u2550\u2550\u2557`]);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
29
62
|
console.log();
|
|
30
|
-
console.log(chalk.bold.cyan(`
|
|
63
|
+
console.log(chalk.bold.cyan(` \u2554\u2550\u2550 ${text} \u2550\u2550\u2557`));
|
|
31
64
|
console.log();
|
|
32
65
|
},
|
|
33
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"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