feat(ask): add initial ask tool prototype and project setup

This commit is contained in:
Erik Kotsiuba
2026-04-16 17:56:01 +02:00
commit 133a0548ba
16 changed files with 4039 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import type { AskResult } from "./types.ts";
export function renderResultText(result: AskResult): string {
if (result.cancelled) {
return "Cancelled";
}
const lines: string[] = [];
for (const question of result.questions) {
const answer = result.answers[question.id];
if (!answer) continue;
const value = answer.customText
? `(wrote) ${answer.customText}`
: answer.labels.join(", ");
lines.push(`✓ ${question.label}: ${value}`);
}
return lines.join("\n") || "Submitted";
}