clawgram 2.23.0 → 2.24.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/helpers.js CHANGED
@@ -47,6 +47,8 @@ exports.resolveReplyParseMode = resolveReplyParseMode;
47
47
  exports.resolveOutboundParseMode = resolveOutboundParseMode;
48
48
  exports.resolveDryRun = resolveDryRun;
49
49
  exports.parseOptionalThreadId = parseOptionalThreadId;
50
+ exports.readAccountReactionLevel = readAccountReactionLevel;
51
+ exports.readAccountReactionModel = readAccountReactionModel;
50
52
  const node_fs_1 = require("node:fs");
51
53
  const node_path_1 = __importDefault(require("node:path"));
52
54
  const core_1 = require("openclaw/plugin-sdk/core");
@@ -904,3 +906,27 @@ function parseOptionalThreadId(value) {
904
906
  const parsed = Number.parseInt(trimmed, 10);
905
907
  return Number.isFinite(parsed) ? parsed : undefined;
906
908
  }
909
+ /** Reads the configured reaction level for an account, tolerating a missing config. */
910
+ function readAccountReactionLevel(cfg, accountId) {
911
+ const resolvedAccountId = resolveConfiguredAccountId(cfg, accountId);
912
+ if (!resolvedAccountId) {
913
+ return undefined;
914
+ }
915
+ return cfg?.channels?.[constants_1.CHANNEL_ID]?.accounts?.[resolvedAccountId]?.reactionLevel;
916
+ }
917
+ /**
918
+ * Model ref for the emoji pick, when the account names one.
919
+ *
920
+ * Picking one emoji out of a fixed list of 68 is the cheapest judgement this
921
+ * channel makes and the only model call it makes on its own; running it on the
922
+ * agent's own head spends the expensive quota on a decision a small model
923
+ * makes just as well.
924
+ */
925
+ function readAccountReactionModel(cfg, accountId) {
926
+ const resolvedAccountId = resolveConfiguredAccountId(cfg, accountId);
927
+ if (!resolvedAccountId) {
928
+ return undefined;
929
+ }
930
+ const raw = cfg?.channels?.[constants_1.CHANNEL_ID]?.accounts?.[resolvedAccountId]?.reactionModel;
931
+ return typeof raw === "string" && raw.trim() ? raw.trim() : undefined;
932
+ }