feat(open-protocol): add OpenProtocol v1 discovery and slash-command support

This commit is contained in:
Dr1mH4X committed 2026-11-14 18:43:00 +08:00
1 parent 17008ae52e
commit 263c1ba6da
16 files changed
+1359 -183

No files matched your search

+5 -1
View File
@@ -29,7 +29,11 @@ function withFakeClient(
): string[] {
const calls: string[] = [];
const fake = {
execCommandWithResponse: vi.fn(async (cmd: string) => {
send: vi.fn(async (req: { command: string; params?: readonly (readonly [string, unknown])[] }) => {
const paramPairs = (req.params ?? [])
.filter(([, v]) => v !== undefined)
.map(([k, v]) => `${k}=${String(v)}`);
const cmd = paramPairs.length > 0 ? `${req.command} ${paramPairs.join(" ")}` : req.command;
calls.push(cmd);
return respond(cmd);
}),