ylib-syim 0.0.18 → 0.0.20

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.
@@ -47,6 +47,23 @@ process.on("unhandledRejection", (reason) => {
47
47
  lastError?: string | null;
48
48
  }) => {
49
49
  // 将 bridge 内部状态信号转发给 main.ts 的 runtime event 接口。
50
+ try {
51
+ const sink = (globalThis as any).__IM_RUNTIME_SET_CHANNEL_STATUS__ as
52
+ | ((payload: Record<string, unknown>) => void)
53
+ | undefined;
54
+ const nowIso = new Date().toISOString();
55
+ sink?.({
56
+ platform: "dingtalk",
57
+ bot_account_id: payload.accountId,
58
+ link_status: payload.linkStatus,
59
+ last_error: payload.lastError || null,
60
+ status_source: "event",
61
+ last_event_at: nowIso,
62
+ last_heartbeat_at: nowIso,
63
+ });
64
+ } catch {
65
+ // ignore
66
+ }
50
67
  return reportRuntimeEvent(
51
68
  "dingtalk",
52
69
  payload.accountId,
@@ -47,6 +47,23 @@ process.on("unhandledRejection", (reason) => {
47
47
  lastError?: string | null;
48
48
  }) => {
49
49
  // 将 bridge 内部状态信号转发给 main.ts 的 runtime event 接口。
50
+ try {
51
+ const sink = (globalThis as any).__IM_RUNTIME_SET_CHANNEL_STATUS__ as
52
+ | ((payload: Record<string, unknown>) => void)
53
+ | undefined;
54
+ const nowIso = new Date().toISOString();
55
+ sink?.({
56
+ platform: "feishu",
57
+ bot_account_id: payload.accountId,
58
+ link_status: payload.linkStatus,
59
+ last_error: payload.lastError || null,
60
+ status_source: "event",
61
+ last_event_at: nowIso,
62
+ last_heartbeat_at: nowIso,
63
+ });
64
+ } catch {
65
+ // ignore
66
+ }
50
67
  return reportRuntimeEvent(
51
68
  "feishu",
52
69
  payload.accountId,