feat(ask): add initial ask tool prototype and project setup
This commit is contained in:
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user