fix: remove dup definitions + add reaction config
This commit is contained in:
committed by
Peter Steinberger
parent
eb7656d68c
commit
dfb6630de1
@@ -76,6 +76,20 @@ export type TelegramAccountConfig = {
|
|||||||
webhookPath?: string;
|
webhookPath?: string;
|
||||||
/** Per-action tool gating (default: true for all). */
|
/** Per-action tool gating (default: true for all). */
|
||||||
actions?: TelegramActionConfig;
|
actions?: TelegramActionConfig;
|
||||||
|
/**
|
||||||
|
* Controls which user reactions trigger notifications:
|
||||||
|
* - "off" (default): ignore all reactions
|
||||||
|
* - "all": notify agent of all reactions
|
||||||
|
*/
|
||||||
|
reactionNotifications?: "off" | "all";
|
||||||
|
/**
|
||||||
|
* Controls agent's reaction capability:
|
||||||
|
* - "off": agent cannot react
|
||||||
|
* - "ack" (default): bot sends acknowledgment reactions (👀 while processing)
|
||||||
|
* - "minimal": agent can react sparingly (guideline: 1 per 5-10 exchanges)
|
||||||
|
* - "extensive": agent can react liberally when appropriate
|
||||||
|
*/
|
||||||
|
reactionLevel?: "off" | "ack" | "minimal" | "extensive";
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TelegramTopicConfig = {
|
export type TelegramTopicConfig = {
|
||||||
|
|||||||
1823
src/config/types.ts
1823
src/config/types.ts
File diff suppressed because it is too large
Load Diff
@@ -63,8 +63,12 @@ export const TelegramAccountSchemaBase = z.object({
|
|||||||
actions: z
|
actions: z
|
||||||
.object({
|
.object({
|
||||||
reactions: z.boolean().optional(),
|
reactions: z.boolean().optional(),
|
||||||
|
sendMessage: z.boolean().optional(),
|
||||||
|
deleteMessage: z.boolean().optional(),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
|
reactionNotifications: z.enum(["off", "all"]).optional(),
|
||||||
|
reactionLevel: z.enum(["off", "ack", "minimal", "extensive"]).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const TelegramAccountSchema = TelegramAccountSchemaBase.superRefine((value, ctx) => {
|
export const TelegramAccountSchema = TelegramAccountSchemaBase.superRefine((value, ctx) => {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -114,6 +114,8 @@ export async function monitorTelegramProvider(opts: MonitorTelegramOpts = {}) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const log = opts.runtime?.log ?? console.log;
|
||||||
|
|
||||||
// When using polling mode, ensure no webhook is active
|
// When using polling mode, ensure no webhook is active
|
||||||
if (!opts.useWebhook) {
|
if (!opts.useWebhook) {
|
||||||
try {
|
try {
|
||||||
@@ -146,7 +148,6 @@ export async function monitorTelegramProvider(opts: MonitorTelegramOpts = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use grammyjs/runner for concurrent update processing
|
// Use grammyjs/runner for concurrent update processing
|
||||||
const log = opts.runtime?.log ?? console.log;
|
|
||||||
let restartAttempts = 0;
|
let restartAttempts = 0;
|
||||||
|
|
||||||
while (!opts.abortSignal?.aborted) {
|
while (!opts.abortSignal?.aborted) {
|
||||||
|
|||||||
Reference in New Issue
Block a user