fix(web): accept unknown stream payload when binding spoken prompts
Publish next build failed because the spoken-bind helper required result/output on chunk payload, which the runner stream type does not have. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -48,12 +48,15 @@ export function readOpenQuestionPrompt(value: unknown): string | null {
|
||||
|
||||
export function openQuestionPromptFromToolResult(chunk: {
|
||||
type?: string;
|
||||
payload?: { result?: unknown; output?: unknown };
|
||||
payload?: unknown;
|
||||
object?: unknown;
|
||||
}): string | null {
|
||||
if (chunk.type !== "tool-result") return null;
|
||||
return readOpenQuestionPrompt(chunk.payload?.result)
|
||||
?? readOpenQuestionPrompt(chunk.payload?.output)
|
||||
const payload = chunk.payload && typeof chunk.payload === "object" && !Array.isArray(chunk.payload)
|
||||
? chunk.payload as Record<string, unknown>
|
||||
: null;
|
||||
return readOpenQuestionPrompt(payload?.result)
|
||||
?? readOpenQuestionPrompt(payload?.output)
|
||||
?? readOpenQuestionPrompt(chunk.object)
|
||||
?? readOpenQuestionPrompt(chunk.payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user