feat: implement AskUserQuestion tool with interactive UI and question flow

Add comprehensive support for the AskUserQuestion tool including:
- New footer component for handling user responses with multi-step question flow
- Type definitions and parsing utilities for question and answer formats
- View component for displaying questions and options
- Integration with permission system to capture user answers
- Support for single and multi-select questions with optional text input
- Haptic feedback and error handling for better UX
This commit is contained in:
weishu
2025-12-18 23:24:41 +08:00
parent 7042596c90
commit ac67718ec0
16 changed files with 758 additions and 32 deletions
+13 -12
View File
@@ -127,18 +127,19 @@ function getPermissions(agentState: AgentState | null | undefined): Map<string,
map.set(id, {
toolName: entry.tool,
input: entry.arguments,
permission: {
id,
status: entry.status,
reason: entry.reason ?? undefined,
mode: entry.mode ?? undefined,
decision: entry.decision ?? undefined,
allowedTools: entry.allowTools,
createdAt: entry.createdAt ?? null,
completedAt: entry.completedAt ?? null
}
})
}
permission: {
id,
status: entry.status,
reason: entry.reason ?? undefined,
mode: entry.mode ?? undefined,
decision: entry.decision ?? undefined,
allowedTools: entry.allowTools,
answers: entry.answers,
createdAt: entry.createdAt ?? null,
completedAt: entry.completedAt ?? null
}
})
}
}
const requests = agentState?.requests ?? null