@clawtopia/werewolf-evolution 0.1.18 → 0.1.20
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/dist/index.js +7 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -612,11 +612,9 @@ var EvolutionContextStore = class {
|
|
|
612
612
|
beginProposalToolCall(toolCallId, sessionKey, now = Date.now()) {
|
|
613
613
|
const bound = this.beginToolCall(toolCallId, sessionKey, now);
|
|
614
614
|
if (bound.inbound.kind !== "debrief") throw new Error("DEBRIEF_CAPABILITY_REQUIRED");
|
|
615
|
-
if (bound.proposalAttempts >=
|
|
616
|
-
bound.consumed = true;
|
|
617
|
-
throw new Error("CAPABILITY_ALREADY_CONSUMED");
|
|
618
|
-
}
|
|
615
|
+
if (bound.proposalAttempts >= 1) throw new Error("CAPABILITY_ALREADY_CONSUMED");
|
|
619
616
|
bound.proposalAttempts += 1;
|
|
617
|
+
bound.consumed = true;
|
|
620
618
|
return bound;
|
|
621
619
|
}
|
|
622
620
|
beginToolCall(toolCallId, sessionKey, now = Date.now()) {
|
|
@@ -3738,8 +3736,8 @@ var WerewolfEvolutionService = class {
|
|
|
3738
3736
|
"- RETRACT_PUBLIC_JUDGMENT must retract or correct a prior public judgment. CHOOSE_ROLE_CLAIM_TIMING must decide when the actor makes or withholds their own role claim, not infer another seat's role.",
|
|
3739
3737
|
"- Strategy proposals must omit executionOperation. CHOOSE_VOTE_TARGET and CHOOSE_ROLE_CLAIM_TIMING are decision types, never executionOperation values.",
|
|
3740
3738
|
"Call werewolf_debrief_commit after checking the complete proposal against this contract.",
|
|
3741
|
-
"
|
|
3742
|
-
"After
|
|
3739
|
+
"Every debriefId has exactly one werewolf_debrief_commit attempt in this run. The first tool result is terminal: committed, duplicate, duplicate-game, rejected, error, or unavailable. Never call werewolf_debrief_commit a second time, even when retryable is true. Never change the topic, source, or trusted window to bypass a rejection.",
|
|
3740
|
+
"After the tool returns any result, return exactly NO_REPLY. Never use a generic write tool or retry indefinitely.",
|
|
3743
3741
|
"Do not return NO_REPLY before werewolf_debrief_commit returns a result.",
|
|
3744
3742
|
"Never use generic write, edit, patch, shell, or memory-write tools for debrief state."
|
|
3745
3743
|
].join("\n");
|
|
@@ -3824,7 +3822,6 @@ var WerewolfEvolutionService = class {
|
|
|
3824
3822
|
}
|
|
3825
3823
|
commit(toolCallId, ctx, input, hooks = {}) {
|
|
3826
3824
|
const bound = this.contexts.beginProposalToolCall(toolCallId, ctx.sessionKey);
|
|
3827
|
-
let terminal = true;
|
|
3828
3825
|
try {
|
|
3829
3826
|
const workspaceDir = requireToolWorkspace(ctx, bound);
|
|
3830
3827
|
if (bound.inbound.kind !== "debrief") throw new Error("DEBRIEF_CAPABILITY_REQUIRED");
|
|
@@ -3885,14 +3882,8 @@ var WerewolfEvolutionService = class {
|
|
|
3885
3882
|
}
|
|
3886
3883
|
};
|
|
3887
3884
|
}, hooks);
|
|
3888
|
-
} catch (error) {
|
|
3889
|
-
if (error instanceof ProposalError && bound.proposalAttempts < 2) {
|
|
3890
|
-
error.retryable = true;
|
|
3891
|
-
terminal = false;
|
|
3892
|
-
}
|
|
3893
|
-
throw error;
|
|
3894
3885
|
} finally {
|
|
3895
|
-
if (
|
|
3886
|
+
if (!bound.consumed) this.contexts.consume(bound.runId, bound.sessionKey);
|
|
3896
3887
|
}
|
|
3897
3888
|
}
|
|
3898
3889
|
decideSuggestion(toolCallId, ctx, input, hooks = {}) {
|
|
@@ -3937,7 +3928,8 @@ function proposalFailure(error) {
|
|
|
3937
3928
|
status: "rejected",
|
|
3938
3929
|
code: error.code,
|
|
3939
3930
|
message: error.message,
|
|
3940
|
-
|
|
3931
|
+
// Kept for response compatibility; one-shot capabilities never grant a retry.
|
|
3932
|
+
retryable: false
|
|
3941
3933
|
};
|
|
3942
3934
|
}
|
|
3943
3935
|
return { status: "rejected", code: "EVOLUTION_ERROR", message: error instanceof Error ? error.message : String(error) };
|
|
@@ -4082,7 +4074,6 @@ function registerWerewolfEvolution(api, service = getSharedWerewolfEvolutionServ
|
|
|
4082
4074
|
api.registerTool((ctx) => createDebriefCommitTool(service, ctx, ({ diagnostic, details }) => {
|
|
4083
4075
|
if (!diagnostic || details === null || typeof details !== "object" || Array.isArray(details)) return;
|
|
4084
4076
|
const result = details;
|
|
4085
|
-
if (result.status === "rejected" && result.retryable === true) return;
|
|
4086
4077
|
const terminal = {
|
|
4087
4078
|
status: result.status === "rejected" ? "final-rejected" : result.status,
|
|
4088
4079
|
code: result.code ?? result.outcome ?? result.status
|
package/package.json
CHANGED