import { describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../../config/config.js"; import { buildCommandContext } from "./commands-context.js"; import { stripStructuralPrefixes } from "./mentions.js"; import { buildTestCtx } from "./test-ctx.js";
describe("buildCommandContext", () => {
it("canonicalizes registered aliases like /id to their primary command", () => { const ctx = buildTestCtx({
Provider: "webchat",
Surface: "webchat",
From: "user",
To: "bot",
Body: "/id",
RawBody: "/id",
CommandBody: "/id",
BodyForCommands: "/id",
});
const result = buildCommandContext({
ctx,
cfg: {} as OpenClawConfig,
isGroup: false,
triggerBodyNormalized: "/id",
commandAuthorized: true,
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.