@botbotgo/agent-harness 0.0.439 → 0.0.441
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.441";
|
|
2
2
|
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
package/dist/package-version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.441";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
|
@@ -230,7 +230,6 @@ function resolveCommittedPlanEvidenceTools(primaryTools, planToolOutput) {
|
|
|
230
230
|
if (todoContents.length === 0) {
|
|
231
231
|
return [];
|
|
232
232
|
}
|
|
233
|
-
const toolsByName = new Map(primaryTools.map((tool) => [tool.name, tool]));
|
|
234
233
|
const resolved = [];
|
|
235
234
|
const seen = new Set();
|
|
236
235
|
for (const content of todoContents) {
|
|
@@ -241,11 +240,9 @@ function resolveCommittedPlanEvidenceTools(primaryTools, planToolOutput) {
|
|
|
241
240
|
continue;
|
|
242
241
|
}
|
|
243
242
|
seen.add(selectedName);
|
|
244
|
-
const matchedTool = toolsByName.get(selectedName);
|
|
245
|
-
const args = buildCommittedPlanEvidenceToolArgs(matchedTool, content);
|
|
246
243
|
resolved.push({
|
|
247
244
|
name: selectedName,
|
|
248
|
-
args,
|
|
245
|
+
args: {},
|
|
249
246
|
id: `stream-committed-plan-evidence-tool-${resolved.length + 1}`,
|
|
250
247
|
});
|
|
251
248
|
}
|
|
@@ -260,16 +257,6 @@ function hasExplicitToolNameReference(todoText, toolName) {
|
|
|
260
257
|
const escapedName = normalizedToolName.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
261
258
|
return new RegExp(`(?:^|[^\\p{L}\\p{N}_-])${escapedName}(?:$|[^\\p{L}\\p{N}_-])`, "iu").test(todoText);
|
|
262
259
|
}
|
|
263
|
-
function buildCommittedPlanEvidenceToolArgs(tool, todoText) {
|
|
264
|
-
const properties = typeof tool?.modelSchema === "object" && tool.modelSchema !== null
|
|
265
|
-
? tool.modelSchema.properties
|
|
266
|
-
: undefined;
|
|
267
|
-
if (typeof properties !== "object" || properties === null) {
|
|
268
|
-
return {};
|
|
269
|
-
}
|
|
270
|
-
const queryLikeField = ["query", "question", "prompt", "input", "text"].find((field) => Object.prototype.hasOwnProperty.call(properties, field));
|
|
271
|
-
return queryLikeField ? { [queryLikeField]: todoText } : {};
|
|
272
|
-
}
|
|
273
260
|
function normalizePlanToolName(toolName) {
|
|
274
261
|
return typeof toolName === "string" ? toolName.trim().toLowerCase().replace(/[\s-]+/gu, "_") : "";
|
|
275
262
|
}
|
|
@@ -125,42 +125,6 @@ function buildContextualFollowUpInstruction(inputText, hasDurableMemory) {
|
|
|
125
125
|
}
|
|
126
126
|
return "Answer the user's current follow-up directly from the recalled context when it remains relevant. If recalled memory conflicts with the current system prompt, runtime policy, recovery instruction, available tool evidence, or the user's current request, ignore the recalled memory for this turn. If the current user turn corrects, revokes, deletes, or replaces recalled memory, treat the user's latest statement as newer than the recalled memory for this turn. Do not frame the reply as a fresh URL or page summary unless the current user turn explicitly includes a new resource to inspect.";
|
|
127
127
|
}
|
|
128
|
-
function isIncidentFollowUpTurn(inputText) {
|
|
129
|
-
const normalized = inputText.trim().toLowerCase();
|
|
130
|
-
if (!normalized || hasExplicitResourceReference(normalized)) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
return /(the rca|deep research.*rca|root cause|go deeper|those issues|these issues|that issue|current incident)/i.test(normalized);
|
|
134
|
-
}
|
|
135
|
-
function findLastAssistantText(history) {
|
|
136
|
-
for (let index = history.length - 1; index >= 0; index -= 1) {
|
|
137
|
-
const message = history[index];
|
|
138
|
-
if (message?.role !== "assistant") {
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
const text = extractMessageText(message.content).trim();
|
|
142
|
-
if (text) {
|
|
143
|
-
return compactHistoryText(text);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return undefined;
|
|
147
|
-
}
|
|
148
|
-
function buildIncidentFollowUpInstruction(history, inputText) {
|
|
149
|
-
if (!isIncidentFollowUpTurn(inputText)) {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
const priorAssistantText = findLastAssistantText(history);
|
|
153
|
-
if (!priorAssistantText) {
|
|
154
|
-
return undefined;
|
|
155
|
-
}
|
|
156
|
-
return [
|
|
157
|
-
"Treat the user's current turn as a follow-up on the current incident, not as a generic background-knowledge request.",
|
|
158
|
-
"Use the immediately prior assistant findings below as the default incident context unless the user explicitly overrides it.",
|
|
159
|
-
"",
|
|
160
|
-
"Prior assistant findings:",
|
|
161
|
-
priorAssistantText,
|
|
162
|
-
].join("\n");
|
|
163
|
-
}
|
|
164
128
|
export function buildSlashCommandSkillInstruction(binding, input) {
|
|
165
129
|
const inputText = extractMessageText(input).trim();
|
|
166
130
|
const match = inputText.match(/^\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\s+([\s\S]*))?$/i);
|
|
@@ -198,7 +162,6 @@ export function buildInvocationRequest(binding, history, input, options = {}) {
|
|
|
198
162
|
suppressHistoryTurns: Boolean(memoryInstruction) && !hasExplicitResourceReference(inputText),
|
|
199
163
|
});
|
|
200
164
|
const contextualFollowUpInstruction = buildContextualFollowUpInstruction(inputText, Boolean(memoryInstruction));
|
|
201
|
-
const incidentFollowUpInstruction = buildIncidentFollowUpInstruction(history, inputText);
|
|
202
165
|
const conversationLanguage = resolveConversationLanguage(history, inputText);
|
|
203
166
|
const languageInstruction = !inferMessageLanguage(inputText) && conversationLanguage
|
|
204
167
|
? {
|
|
@@ -212,7 +175,6 @@ export function buildInvocationRequest(binding, history, input, options = {}) {
|
|
|
212
175
|
messages: [
|
|
213
176
|
...(memoryInstruction ? [{ role: "system", content: memoryInstruction }] : []),
|
|
214
177
|
...(contextualFollowUpInstruction ? [{ role: "system", content: contextualFollowUpInstruction }] : []),
|
|
215
|
-
...(incidentFollowUpInstruction ? [{ role: "system", content: incidentFollowUpInstruction }] : []),
|
|
216
178
|
...(languageInstruction ? [{ role: "system", content: languageInstruction }] : []),
|
|
217
179
|
...(userInvocableInstruction ? [{ role: "system", content: userInvocableInstruction }] : []),
|
|
218
180
|
...messages,
|