devez-vibe 1.8.30 → 1.8.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dvz.exe +0 -0
- package/bridge/claude-agent-sdk-bridge.mjs +48 -0
- package/package.json +1 -1
package/bin/dvz.exe
CHANGED
|
Binary file
|
|
@@ -3006,6 +3006,22 @@ function isInternalHistoryText(message, text) {
|
|
|
3006
3006
|
return text.trim().startsWith("[Request interrupted by user");
|
|
3007
3007
|
}
|
|
3008
3008
|
|
|
3009
|
+
/**
|
|
3010
|
+
* The answered questions of one `AskUserQuestion` call, in the order they were
|
|
3011
|
+
* asked. A cancelled question carries no answers, so it restores nothing — the
|
|
3012
|
+
* same as the live session, which leaves no card behind either.
|
|
3013
|
+
*/
|
|
3014
|
+
function questionAnswerPairs(input, result) {
|
|
3015
|
+
const answers = result?.answers;
|
|
3016
|
+
if (!answers || typeof answers !== "object") return [];
|
|
3017
|
+
return (input?.questions || [])
|
|
3018
|
+
.map((entry) => ({
|
|
3019
|
+
question: String(entry?.question || "").trim(),
|
|
3020
|
+
answer: String(answers[entry?.question] ?? "").trim(),
|
|
3021
|
+
}))
|
|
3022
|
+
.filter((pair) => pair.question && pair.answer);
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3009
3025
|
function historyState(messages) {
|
|
3010
3026
|
const turns = [];
|
|
3011
3027
|
let turn = null;
|
|
@@ -3060,6 +3076,7 @@ function historyState(messages) {
|
|
|
3060
3076
|
} else if (block.name === "TaskUpdate") {
|
|
3061
3077
|
applyTaskUpdate(tasks, block.input || {}, turn.id, undefined, messageTime(message));
|
|
3062
3078
|
} else if (!["TaskGet", "TaskList", "AskUserQuestion"].includes(block.name)) turn.items.push(pending.item);
|
|
3079
|
+
// 질문 도구는 답변이 실려 오는 결과를 기다렸다가 질문·답변 항목으로 남긴다.
|
|
3063
3080
|
}
|
|
3064
3081
|
}
|
|
3065
3082
|
} else if (message.type === "user") {
|
|
@@ -3094,6 +3111,9 @@ function historyState(messages) {
|
|
|
3094
3111
|
const current = latestTaskPlan(tasks);
|
|
3095
3112
|
tasks.clear();
|
|
3096
3113
|
for (const [id, task] of current) tasks.set(id, task);
|
|
3114
|
+
} else if (pending.name === "AskUserQuestion") {
|
|
3115
|
+
const pairs = questionAnswerPairs(pending.input, message.tool_use_result);
|
|
3116
|
+
if (pairs.length) turn.items.push({ id: block.tool_use_id, type: "questionAnswers", pairs });
|
|
3097
3117
|
} else if (pending.item) {
|
|
3098
3118
|
const output = toolOutput(block.content, message.tool_use_result);
|
|
3099
3119
|
Object.assign(pending.item, pending.item.type === "commandExecution"
|
|
@@ -3958,6 +3978,34 @@ async function runSelfTest() {
|
|
|
3958
3978
|
message: { role: "user", content: [{ type: "tool_result", tool_use_id: id, content }] },
|
|
3959
3979
|
tool_use_result: toolUseResult,
|
|
3960
3980
|
});
|
|
3981
|
+
// 재개한 대화의 질문·답변은 항목으로 남고, 답변 없이 취소된 질문은 남지 않는다.
|
|
3982
|
+
const askQuestions = {
|
|
3983
|
+
questions: [
|
|
3984
|
+
{ question: "어떤 방법인가요?", options: [{ label: "첫 번째" }] },
|
|
3985
|
+
{ question: "언제 할까요?", options: [{ label: "지금" }], multiSelect: true },
|
|
3986
|
+
],
|
|
3987
|
+
};
|
|
3988
|
+
const answeredQuestions = historyTurns([
|
|
3989
|
+
user("q-user", "선택지 띄워"),
|
|
3990
|
+
taskUse("q-assistant", "ask-1", "AskUserQuestion", askQuestions),
|
|
3991
|
+
taskResult("q-result", "ask-1", { answers: { "어떤 방법인가요?": "첫 번째", "언제 할까요?": "지금, 나중" } }, "answered"),
|
|
3992
|
+
assistant("q-answer", "claude-opus-5", "적용했습니다."),
|
|
3993
|
+
]);
|
|
3994
|
+
const answerItem = answeredQuestions[0]?.items.find((item) => item.type === "questionAnswers");
|
|
3995
|
+
if (answerItem?.pairs?.length !== 2
|
|
3996
|
+
|| answerItem.pairs[0].question !== "어떤 방법인가요?"
|
|
3997
|
+
|| answerItem.pairs[1].answer !== "지금, 나중") {
|
|
3998
|
+
throw new Error(`Claude question history self-test failed: ${JSON.stringify(answeredQuestions)}`);
|
|
3999
|
+
}
|
|
4000
|
+
const cancelledQuestion = historyTurns([
|
|
4001
|
+
user("c-user", "선택지 띄워"),
|
|
4002
|
+
taskUse("c-assistant", "ask-2", "AskUserQuestion", askQuestions),
|
|
4003
|
+
taskResult("c-result", "ask-2", undefined, "사용자가 질문을 취소하고 작업을 중단했습니다."),
|
|
4004
|
+
assistant("c-answer", "claude-opus-5", "중단했습니다."),
|
|
4005
|
+
]);
|
|
4006
|
+
if (cancelledQuestion.some((turn) => turn.items.some((item) => item.type === "questionAnswers"))) {
|
|
4007
|
+
throw new Error(`Claude cancelled question self-test failed: ${JSON.stringify(cancelledQuestion)}`);
|
|
4008
|
+
}
|
|
3961
4009
|
const resumedProgress = historyTurns([
|
|
3962
4010
|
user("progress-user", "환자 변경 동기화를 수정해"),
|
|
3963
4011
|
{
|