Move all Signal channel implementation files from src/signal/ to extensions/signal/src/ and replace originals with re-export shims. This continues the channel plugin migration pattern used by other extensions, keeping backward compatibility via shims while the real code lives in the extension. - Copy 32 .ts files (source + tests) to extensions/signal/src/ - Transform all relative import paths for the new location - Create 2-line re-export shims in src/signal/ for each moved file - Preserve existing extension files (channel.ts, runtime.ts, etc.) - Change tsconfig.plugin-sdk.dts.json rootDir from "src" to "." to support cross-boundary re-exports from extensions/
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import type { OpenClawConfig } from "../../../src/config/config.js";
|
|
import {
|
|
resolveReactionLevel,
|
|
type ReactionLevel,
|
|
type ResolvedReactionLevel,
|
|
} from "../../../src/utils/reaction-level.js";
|
|
import { resolveSignalAccount } from "./accounts.js";
|
|
|
|
export type SignalReactionLevel = ReactionLevel;
|
|
export type ResolvedSignalReactionLevel = ResolvedReactionLevel;
|
|
|
|
/**
|
|
* Resolve the effective reaction level and its implications for Signal.
|
|
*
|
|
* Levels:
|
|
* - "off": No reactions at all
|
|
* - "ack": Only automatic ack reactions (👀 when processing), no agent reactions
|
|
* - "minimal": Agent can react, but sparingly (default)
|
|
* - "extensive": Agent can react liberally
|
|
*/
|
|
export function resolveSignalReactionLevel(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string;
|
|
}): ResolvedSignalReactionLevel {
|
|
const account = resolveSignalAccount({
|
|
cfg: params.cfg,
|
|
accountId: params.accountId,
|
|
});
|
|
return resolveReactionLevel({
|
|
value: account.config.reactionLevel,
|
|
defaultLevel: "minimal",
|
|
invalidFallback: "minimal",
|
|
});
|
|
}
|