feat(telegram/acp): Topic Binding, Pin Binding Message, Fix Spawn Param Parsing (#36683)

* fix(acp): normalize unicode flags and Telegram topic binding

* feat(telegram/acp): restore topic-bound ACP and session bindings

* fix(acpx): clarify permission-denied guidance

* feat(telegram/acp): pin spawn bind notice in topics

* docs(telegram): document ACP topic thread binding behavior

* refactor(reply): share Telegram conversation-id resolver

* fix(telegram/acp): preserve bound session routing semantics

* fix(telegram): respect binding persistence and expiry reporting

* refactor(telegram): simplify binding lifecycle persistence

* fix(telegram): bind acp spawns in direct messages

* fix: document telegram ACP topic binding changelog (#36683) (thanks @huntharo)

---------

Co-authored-by: Onur <2453968+osolmaz@users.noreply.github.com>
This commit is contained in:
Harold Hunt
2026-03-05 20:17:50 -05:00
committed by GitHub
parent 92b4892127
commit d58dafae88
35 changed files with 2397 additions and 453 deletions

View File

@@ -0,0 +1,45 @@
type DiscordSurfaceParams = {
ctx: {
OriginatingChannel?: string;
Surface?: string;
Provider?: string;
AccountId?: string;
};
command: {
channel?: string;
};
};
type DiscordAccountParams = {
ctx: {
AccountId?: string;
};
};
export function isDiscordSurface(params: DiscordSurfaceParams): boolean {
return resolveCommandSurfaceChannel(params) === "discord";
}
export function isTelegramSurface(params: DiscordSurfaceParams): boolean {
return resolveCommandSurfaceChannel(params) === "telegram";
}
export function resolveCommandSurfaceChannel(params: DiscordSurfaceParams): string {
const channel =
params.ctx.OriginatingChannel ??
params.command.channel ??
params.ctx.Surface ??
params.ctx.Provider;
return String(channel ?? "")
.trim()
.toLowerCase();
}
export function resolveDiscordAccountId(params: DiscordAccountParams): string {
return resolveChannelAccountId(params);
}
export function resolveChannelAccountId(params: DiscordAccountParams): string {
const accountId = typeof params.ctx.AccountId === "string" ? params.ctx.AccountId.trim() : "";
return accountId || "default";
}