@bluecopa/harness 0.1.0-snapshot.122 → 0.1.0-snapshot.124
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.
|
@@ -115,7 +115,7 @@ function estimateMessagesTokens(messages) {
|
|
|
115
115
|
|
|
116
116
|
// src/arc/types.ts
|
|
117
117
|
function resolveToolChoice(config, turn) {
|
|
118
|
-
if (!config) return "auto";
|
|
118
|
+
if (!config) return turn === 0 ? "required" : "auto";
|
|
119
119
|
return typeof config === "function" ? config(turn) : config;
|
|
120
120
|
}
|
|
121
121
|
function isProfileDeclaration(p) {
|
|
@@ -284,7 +284,13 @@ var Branch = tool({
|
|
|
284
284
|
})).min(2).max(3).describe("Alternative thread dispatches to try in parallel")
|
|
285
285
|
})
|
|
286
286
|
});
|
|
287
|
-
var
|
|
287
|
+
var Reply = tool({
|
|
288
|
+
description: "Respond directly to the user without dispatching threads. Use for greetings, clarifications, or when no work is needed.",
|
|
289
|
+
inputSchema: z.object({
|
|
290
|
+
message: z.string().describe("The response to send to the user")
|
|
291
|
+
})
|
|
292
|
+
});
|
|
293
|
+
var orchestratorTools = { Thread, Check, Cancel, Remember, ReadEpisode, ReadRollup, Branch, Reply };
|
|
288
294
|
var processTools = { ...builtinTools, ReadEpisode };
|
|
289
295
|
tool({
|
|
290
296
|
description: "Ask the user a question and wait for their response.",
|
|
@@ -4021,11 +4027,11 @@ var OrchestratorTurnRunner = class {
|
|
|
4021
4027
|
if (toolCalls.length === 0) {
|
|
4022
4028
|
if (!text.trim()) {
|
|
4023
4029
|
if (!forcedFinalResponseRetry && turn < maxTurns - 1) {
|
|
4024
|
-
const
|
|
4030
|
+
const emptyRetry = "Respond to the user now using the completed thread results. Do not call tools or dispatch threads unless absolutely necessary. Give a direct final answer.";
|
|
4025
4031
|
this.config.ctx.recordTurn({
|
|
4026
4032
|
role: "user",
|
|
4027
|
-
messages: [{ role: "user", content:
|
|
4028
|
-
tokenEstimate: estimateTokens(
|
|
4033
|
+
messages: [{ role: "user", content: emptyRetry }],
|
|
4034
|
+
tokenEstimate: estimateTokens(emptyRetry),
|
|
4029
4035
|
timestamp: Date.now()
|
|
4030
4036
|
});
|
|
4031
4037
|
return { type: "retry_empty" };
|
|
@@ -4181,6 +4187,16 @@ ${proc.result.episode.summary}`;
|
|
|
4181
4187
|
});
|
|
4182
4188
|
continue;
|
|
4183
4189
|
}
|
|
4190
|
+
if (call.toolName === "Reply") {
|
|
4191
|
+
const message = String(call.args.message ?? "");
|
|
4192
|
+
this.config.ctx.recordTurn({
|
|
4193
|
+
role: "orchestrator",
|
|
4194
|
+
messages: [{ role: "assistant", content: message }],
|
|
4195
|
+
tokenEstimate: estimateTokens(message),
|
|
4196
|
+
timestamp: Date.now()
|
|
4197
|
+
});
|
|
4198
|
+
return { type: "done", output: message };
|
|
4199
|
+
}
|
|
4184
4200
|
if (call.toolName === "Remember") {
|
|
4185
4201
|
const memOpts = {};
|
|
4186
4202
|
if (call.args.category != null) memOpts.category = String(call.args.category);
|