mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-22 16:51:28 +02:00
Initialize the operational skill for legacy continuation fixtures, verify task attachment bytes, allow Claude’s optional custom-answer field, and distinguish unstarted dependency-blocked wakes from failed provider executions. Co-Authored-By: Paperclip <noreply@paperclip.ing>
15 lines
953 B
TypeScript
15 lines
953 B
TypeScript
/** Provider-native questions pause inside a turn; they need an answer, not a
|
|
* terminal run. Plain semantic questions instead wake a subsequent run. */
|
|
export function answerableRuntimeRunIds(interactions: ReadonlyArray<Record<string, any>>): Set<string> {
|
|
return new Set(interactions.filter((i) => i.kind === "ask_user_questions" && i.status === "pending" &&
|
|
typeof i.sourceRunId === "string" && typeof i.payload?.runtimeRequestId === "string")
|
|
.map((i) => i.sourceRunId));
|
|
}
|
|
|
|
/** Claude's one question includes the ACP adapter's optional custom-answer
|
|
* companion field. It is not a second user question. */
|
|
export function isSingleClaudeQuestion(questions: ReadonlyArray<Record<string, any>>) {
|
|
return questions.length >= 1 && questions.length <= 2 && questions[0]?.answerMode === "single_select" &&
|
|
questions.slice(1).every(q => q.answerMode === "text" && q.required === false && q.header === "Other" && /_custom-/.test(q.id));
|
|
}
|