ylib-syim 0.0.16 → 0.0.18
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/bridges/dingtalk-stdio-bridge.ts +3 -0
- package/bridges/lark-stdio-bridge.ts +3 -0
- package/bridges/main.ts +1304 -204
- package/bridges/runtime-event-reporter.ts +294 -21
- package/bridges/weixin-stdio-bridge.ts +3 -0
- package/package.json +3 -3
- package/scripts/dingtalk-stdio-bridge.ts +116 -6
- package/scripts/lark-stdio-bridge.ts +111 -7
- package/scripts/weixin-stdio-bridge.ts +118 -8
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
reportRuntimeEvent,
|
|
10
10
|
} from "./runtime-event-reporter.ts";
|
|
11
11
|
|
|
12
|
+
// formatErr: 统一异常格式化输出。
|
|
12
13
|
function formatErr(err: unknown): string {
|
|
14
|
+
// 统一异常格式,确保进程级错误日志可读。
|
|
13
15
|
if (err instanceof Error) {
|
|
14
16
|
return `${err.message}\n${err.stack || ""}`.trim();
|
|
15
17
|
}
|
|
@@ -44,6 +46,7 @@ process.on("unhandledRejection", (reason) => {
|
|
|
44
46
|
| "error";
|
|
45
47
|
lastError?: string | null;
|
|
46
48
|
}) => {
|
|
49
|
+
// 将 bridge 内部状态信号转发给 main.ts 的 runtime event 接口。
|
|
47
50
|
return reportRuntimeEvent(
|
|
48
51
|
"dingtalk",
|
|
49
52
|
payload.accountId,
|
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
reportRuntimeEvent,
|
|
10
10
|
} from "./runtime-event-reporter.ts";
|
|
11
11
|
|
|
12
|
+
// formatErr: 统一异常格式化输出。
|
|
12
13
|
function formatErr(err: unknown): string {
|
|
14
|
+
// 统一异常格式,确保进程级错误日志可读。
|
|
13
15
|
if (err instanceof Error) {
|
|
14
16
|
return `${err.message}\n${err.stack || ""}`.trim();
|
|
15
17
|
}
|
|
@@ -44,6 +46,7 @@ process.on("unhandledRejection", (reason) => {
|
|
|
44
46
|
| "error";
|
|
45
47
|
lastError?: string | null;
|
|
46
48
|
}) => {
|
|
49
|
+
// 将 bridge 内部状态信号转发给 main.ts 的 runtime event 接口。
|
|
47
50
|
return reportRuntimeEvent(
|
|
48
51
|
"feishu",
|
|
49
52
|
payload.accountId,
|