fix: add object capabilities coverage (#1071) (thanks @danielz1z)
This commit is contained in:
parent
be6536a635
commit
3ab4c3a3c4
@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Sub-agents: normalize announce delivery origin + queue bucketing by accountId to keep multi-account routing stable. (#1061, #1058) — thanks @adam91holt.
|
- Sub-agents: normalize announce delivery origin + queue bucketing by accountId to keep multi-account routing stable. (#1061, #1058) — thanks @adam91holt.
|
||||||
|
- Config: handle object-format Telegram capabilities in channel capability resolution. (#1071) — thanks @danielz1z.
|
||||||
- Sessions: include deliveryContext in sessions.list and reuse normalized delivery routing for announce/restart fallbacks. (#1058)
|
- Sessions: include deliveryContext in sessions.list and reuse normalized delivery routing for announce/restart fallbacks. (#1058)
|
||||||
- Sessions: propagate deliveryContext into last-route updates to keep account/channel routing stable. (#1058)
|
- Sessions: propagate deliveryContext into last-route updates to keep account/channel routing stable. (#1058)
|
||||||
- Gateway: honor explicit delivery targets without implicit accountId fallback; preserve lastAccountId for implicit routing.
|
- Gateway: honor explicit delivery targets without implicit accountId fallback; preserve lastAccountId for implicit routing.
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const DSR_PATTERN = /\x1b\[\??6n/g;
|
const ESC = String.fromCharCode(0x1b);
|
||||||
|
const DSR_PATTERN = new RegExp(`${ESC}\\[\\??6n`, "g");
|
||||||
|
|
||||||
export function stripDsrRequests(input: string): { cleaned: string; requests: number } {
|
export function stripDsrRequests(input: string): { cleaned: string; requests: number } {
|
||||||
let requests = 0;
|
let requests = 0;
|
||||||
|
|||||||
@ -679,15 +679,15 @@ export function registerHooksCli(program: Command): void {
|
|||||||
for (const hookId of targets) {
|
for (const hookId of targets) {
|
||||||
const record = installs[hookId];
|
const record = installs[hookId];
|
||||||
if (!record) {
|
if (!record) {
|
||||||
defaultRuntime.log(chalk.yellow(`No install record for \"${hookId}\".`));
|
defaultRuntime.log(chalk.yellow(`No install record for "${hookId}".`));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (record.source !== "npm") {
|
if (record.source !== "npm") {
|
||||||
defaultRuntime.log(chalk.yellow(`Skipping \"${hookId}\" (source: ${record.source}).`));
|
defaultRuntime.log(chalk.yellow(`Skipping "${hookId}" (source: ${record.source}).`));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!record.spec) {
|
if (!record.spec) {
|
||||||
defaultRuntime.log(chalk.yellow(`Skipping \"${hookId}\" (missing npm spec).`));
|
defaultRuntime.log(chalk.yellow(`Skipping "${hookId}" (missing npm spec).`));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -125,6 +125,29 @@ describe("resolveChannelCapabilities", () => {
|
|||||||
}),
|
}),
|
||||||
).toBeUndefined();
|
).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("falls back to channel capabilities when account capabilities use object format", () => {
|
||||||
|
const cfg = {
|
||||||
|
channels: {
|
||||||
|
telegram: {
|
||||||
|
capabilities: ["inlineButtons"],
|
||||||
|
accounts: {
|
||||||
|
default: {
|
||||||
|
capabilities: { inlineButtons: "dm" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} satisfies Partial<ClawdbotConfig>;
|
||||||
|
|
||||||
|
expect(
|
||||||
|
resolveChannelCapabilities({
|
||||||
|
cfg: cfg as ClawdbotConfig,
|
||||||
|
channel: "telegram",
|
||||||
|
accountId: "default",
|
||||||
|
}),
|
||||||
|
).toEqual(["inlineButtons"]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({
|
const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user