mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-31 15:13:33 +00:00
refactor: share extension channel status summaries
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
type ChannelPlugin,
|
||||
type ResolvedIMessageAccount,
|
||||
} from "openclaw/plugin-sdk/imessage";
|
||||
import { buildPassiveProbedChannelStatusSummary } from "../../shared/channel-status-summary.js";
|
||||
import { getIMessageRuntime } from "./runtime.js";
|
||||
|
||||
const meta = getChatChannelMeta("imessage");
|
||||
@@ -264,17 +265,11 @@ export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount> = {
|
||||
dbPath: null,
|
||||
},
|
||||
collectStatusIssues: (accounts) => collectStatusIssuesFromLastError("imessage", accounts),
|
||||
buildChannelSummary: ({ snapshot }) => ({
|
||||
configured: snapshot.configured ?? false,
|
||||
running: snapshot.running ?? false,
|
||||
lastStartAt: snapshot.lastStartAt ?? null,
|
||||
lastStopAt: snapshot.lastStopAt ?? null,
|
||||
lastError: snapshot.lastError ?? null,
|
||||
cliPath: snapshot.cliPath ?? null,
|
||||
dbPath: snapshot.dbPath ?? null,
|
||||
probe: snapshot.probe,
|
||||
lastProbeAt: snapshot.lastProbeAt ?? null,
|
||||
}),
|
||||
buildChannelSummary: ({ snapshot }) =>
|
||||
buildPassiveProbedChannelStatusSummary(snapshot, {
|
||||
cliPath: snapshot.cliPath ?? null,
|
||||
dbPath: snapshot.dbPath ?? null,
|
||||
}),
|
||||
probeAccount: async ({ timeoutMs }) =>
|
||||
getIMessageRuntime().channel.imessage.probeIMessage(timeoutMs),
|
||||
buildAccountSnapshot: ({ account, runtime, probe }) => ({
|
||||
|
||||
Reference in New Issue
Block a user