@evalops/maestro 0.10.40 → 0.10.41
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/agent/transport/reusable-tool-results.d.ts +3 -1
- package/dist/agent/transport/reusable-tool-results.d.ts.map +1 -1
- package/dist/agent/transport/reusable-tool-results.js +32 -4
- package/dist/agent/transport/reusable-tool-results.js.map +1 -1
- package/dist/agent/transport/tool-execution.d.ts.map +1 -1
- package/dist/agent/transport/tool-execution.js +38 -14
- package/dist/agent/transport/tool-execution.js.map +1 -1
- package/dist/agent/transport.d.ts.map +1 -1
- package/dist/agent/transport.js +6 -26
- package/dist/agent/transport.js.map +1 -1
- package/dist/cli.js +62 -45
- package/dist/node_modules/@evalops/contracts/package.json +1 -1
- package/dist/node_modules/@evalops/tui/package.json +1 -1
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -73409,16 +73409,37 @@ function cloneToolResultForCache(message) {
|
|
|
73409
73409
|
content: message.content.map((item) => ({ ...item }))
|
|
73410
73410
|
};
|
|
73411
73411
|
}
|
|
73412
|
-
function
|
|
73412
|
+
function localToolExecutionIdForCall(toolCall) {
|
|
73413
|
+
return `local-tool-exec-${toolCall.id}`;
|
|
73414
|
+
}
|
|
73415
|
+
function attachToolExecutionMetadata(message, metadata, options = {}) {
|
|
73416
|
+
const details = message.details && typeof message.details === "object" ? { ...message.details } : {};
|
|
73417
|
+
if (metadata.toolExecutionId) {
|
|
73418
|
+
details.toolExecutionId = metadata.toolExecutionId;
|
|
73419
|
+
}
|
|
73420
|
+
if (metadata.approvalRequestId) {
|
|
73421
|
+
details.approvalRequestId = metadata.approvalRequestId;
|
|
73422
|
+
} else if (options.replaceApprovalRequestId) {
|
|
73423
|
+
delete details.approvalRequestId;
|
|
73424
|
+
}
|
|
73413
73425
|
return {
|
|
73414
|
-
message
|
|
73426
|
+
...message,
|
|
73427
|
+
details
|
|
73428
|
+
};
|
|
73429
|
+
}
|
|
73430
|
+
function cloneToolOutcomeForCall(outcome, toolCall, timestamp3, metadata = {}) {
|
|
73431
|
+
const toolExecutionId = localToolExecutionIdForCall(toolCall);
|
|
73432
|
+
return {
|
|
73433
|
+
message: attachToolExecutionMetadata({
|
|
73415
73434
|
...outcome.message,
|
|
73416
73435
|
toolCallId: toolCall.id,
|
|
73417
73436
|
toolName: toolCall.name,
|
|
73418
73437
|
content: outcome.message.content.map((item) => ({ ...item })),
|
|
73419
73438
|
timestamp: timestamp3
|
|
73420
|
-
},
|
|
73421
|
-
isError: outcome.isError
|
|
73439
|
+
}, { toolExecutionId, approvalRequestId: metadata.approvalRequestId }, { replaceApprovalRequestId: true }),
|
|
73440
|
+
isError: outcome.isError,
|
|
73441
|
+
toolExecutionId,
|
|
73442
|
+
...metadata.approvalRequestId ? { approvalRequestId: metadata.approvalRequestId } : {}
|
|
73422
73443
|
};
|
|
73423
73444
|
}
|
|
73424
73445
|
function resolvePlatformToolExecutionBridge(option) {
|
|
@@ -73439,9 +73460,11 @@ async function recordReusableToolExecutionBridgeOutput({
|
|
|
73439
73460
|
}
|
|
73440
73461
|
const observed = plan.kind === "observe" ? await bridge.recordObservation(plan, outcome.message, signal) : void 0;
|
|
73441
73462
|
const governedOutput = plan.kind === "governed" ? await bridge.recordGovernedOutput(plan, outcome.message, durationMs, signal) : void 0;
|
|
73463
|
+
const metadata = buildObservedResultMetadata(plan, observed ?? governedOutput);
|
|
73442
73464
|
return {
|
|
73443
73465
|
...outcome,
|
|
73444
|
-
...
|
|
73466
|
+
...metadata,
|
|
73467
|
+
message: attachToolExecutionMetadata(outcome.message, metadata)
|
|
73445
73468
|
};
|
|
73446
73469
|
}
|
|
73447
73470
|
function hasReusableToolResultState(cacheKey, cache4, pending, policyCheckedKeys, pendingSafetyChecks) {
|
|
@@ -82771,6 +82794,7 @@ function createToolExecutionPromise(ctx) {
|
|
|
82771
82794
|
const autoMaxAttempts = isClientTool ? 1 : toolHasRetryConfig ? (tool.maxRetries ?? resolvedRetryConfig.maxAutoRetries) + 1 : allowAutoRetries ? resolvedRetryConfig.maxAutoRetries + 1 : 1;
|
|
82772
82795
|
const retryDelay = toolHasRetryConfig ? tool.retryDelayMs ?? resolvedRetryConfig.initialDelayMs : resolvedRetryConfig.initialDelayMs;
|
|
82773
82796
|
const shouldRetryFn = tool.shouldRetry ?? isRetryableToolError;
|
|
82797
|
+
const fallbackToolExecutionId = `local-tool-exec-${toolCall.id}`;
|
|
82774
82798
|
const context2 = cfg.sandbox ? { sandbox: cfg.sandbox } : void 0;
|
|
82775
82799
|
const onUpdate = (partialResult) => {
|
|
82776
82800
|
toolUpdateQueue.push({
|
|
@@ -82798,20 +82822,25 @@ function createToolExecutionPromise(ctx) {
|
|
|
82798
82822
|
}
|
|
82799
82823
|
return runWithMcpClientToolService(clientToolService2, () => tool.execute(toolCall.id, validatedArgs, signal, context2, onUpdate));
|
|
82800
82824
|
};
|
|
82801
|
-
const
|
|
82802
|
-
|
|
82803
|
-
|
|
82804
|
-
}
|
|
82805
|
-
const details = message.details && typeof message.details === "object" ? { ...message.details } : {};
|
|
82806
|
-
if (typeof details.approvalRequestId !== "string") {
|
|
82807
|
-
details.approvalRequestId = approvalRequestId;
|
|
82808
|
-
}
|
|
82809
|
-
message.details = details;
|
|
82825
|
+
const toolExecutionIdFromMessage = (message) => {
|
|
82826
|
+
const details = message.details && typeof message.details === "object" ? message.details : {};
|
|
82827
|
+
return typeof details.toolExecutionId === "string" && details.toolExecutionId.length > 0 ? details.toolExecutionId : void 0;
|
|
82810
82828
|
};
|
|
82811
|
-
const
|
|
82829
|
+
const withLocalExecutionMetadata = (metadata, message) => ({
|
|
82812
82830
|
...metadata,
|
|
82831
|
+
toolExecutionId: metadata.toolExecutionId ?? (message ? toolExecutionIdFromMessage(message) : void 0) ?? fallbackToolExecutionId,
|
|
82813
82832
|
...approvalRequestId && !metadata.approvalRequestId ? { approvalRequestId } : {}
|
|
82814
82833
|
});
|
|
82834
|
+
const attachToolResultLinkage = (message, metadata) => {
|
|
82835
|
+
const resolvedMetadata = withLocalExecutionMetadata(metadata, message);
|
|
82836
|
+
const details = message.details && typeof message.details === "object" ? { ...message.details } : {};
|
|
82837
|
+
details.toolExecutionId = resolvedMetadata.toolExecutionId;
|
|
82838
|
+
if (resolvedMetadata.approvalRequestId && typeof details.approvalRequestId !== "string") {
|
|
82839
|
+
details.approvalRequestId = resolvedMetadata.approvalRequestId;
|
|
82840
|
+
}
|
|
82841
|
+
message.details = details;
|
|
82842
|
+
return resolvedMetadata;
|
|
82843
|
+
};
|
|
82815
82844
|
const executeWithRetry = async () => {
|
|
82816
82845
|
let totalAttempts = 0;
|
|
82817
82846
|
let userRetryRounds = 0;
|
|
@@ -82905,7 +82934,10 @@ function createToolExecutionPromise(ctx) {
|
|
|
82905
82934
|
isError: result2.isError || false,
|
|
82906
82935
|
timestamp: clock.now()
|
|
82907
82936
|
};
|
|
82908
|
-
|
|
82937
|
+
attachToolResultLinkage(toolResultMsg, {
|
|
82938
|
+
toolExecutionId: result2.toolExecutionId ?? toolExecutionBridgePlan?.metadata.toolExecutionId,
|
|
82939
|
+
approvalRequestId: result2.approvalRequestId ?? toolExecutionBridgePlan?.metadata.approvalRequestId
|
|
82940
|
+
});
|
|
82909
82941
|
if (hookService && !result2.isError) {
|
|
82910
82942
|
const postHookResult = await hookService.runPostToolUseHooks(effectiveToolCall, toolResultMsg, signal);
|
|
82911
82943
|
if (postHookResult.additionalContext) {
|
|
@@ -82978,10 +83010,11 @@ function createToolExecutionPromise(ctx) {
|
|
|
82978
83010
|
}
|
|
82979
83011
|
const observed = toolExecutionBridge && toolExecutionBridgePlan?.kind === "observe" ? await toolExecutionBridge.recordObservation(toolExecutionBridgePlan, toolResultMsg, signal) : void 0;
|
|
82980
83012
|
const governedOutput = toolExecutionBridge && toolExecutionBridgePlan?.kind === "governed" ? await toolExecutionBridge.recordGovernedOutput(toolExecutionBridgePlan, toolResultMsg, clock.now() - startTime, signal) : void 0;
|
|
83013
|
+
const linkageMetadata = attachToolResultLinkage(toolResultMsg, buildObservedResultMetadata(toolExecutionBridgePlan, observed ?? governedOutput));
|
|
82981
83014
|
return {
|
|
82982
83015
|
message: toolResultMsg,
|
|
82983
83016
|
isError: toolResultMsg.isError,
|
|
82984
|
-
...
|
|
83017
|
+
...linkageMetadata
|
|
82985
83018
|
};
|
|
82986
83019
|
} catch (error) {
|
|
82987
83020
|
if (error instanceof Error && error.name === "AbortError") {
|
|
@@ -83006,7 +83039,10 @@ function createToolExecutionPromise(ctx) {
|
|
|
83006
83039
|
isError: true,
|
|
83007
83040
|
timestamp: clock.now()
|
|
83008
83041
|
};
|
|
83009
|
-
|
|
83042
|
+
attachToolResultLinkage(toolResultMsg, {
|
|
83043
|
+
toolExecutionId: toolExecutionBridgePlan?.metadata.toolExecutionId,
|
|
83044
|
+
approvalRequestId: toolExecutionBridgePlan?.metadata.approvalRequestId
|
|
83045
|
+
});
|
|
83010
83046
|
if (hookService) {
|
|
83011
83047
|
const failureHookResult = await hookService.runPostToolUseFailureHooks(effectiveToolCall, baseErrorMessage, signal);
|
|
83012
83048
|
if (failureHookResult.additionalContext) {
|
|
@@ -83022,10 +83058,11 @@ function createToolExecutionPromise(ctx) {
|
|
|
83022
83058
|
}
|
|
83023
83059
|
const observed = toolExecutionBridge && toolExecutionBridgePlan?.kind === "observe" ? await toolExecutionBridge.recordObservation(toolExecutionBridgePlan, toolResultMsg, signal) : void 0;
|
|
83024
83060
|
const governedOutput = toolExecutionBridge && toolExecutionBridgePlan?.kind === "governed" ? await toolExecutionBridge.recordGovernedOutput(toolExecutionBridgePlan, toolResultMsg, clock.now() - startTime, signal) : void 0;
|
|
83061
|
+
const linkageMetadata = attachToolResultLinkage(toolResultMsg, buildObservedResultMetadata(toolExecutionBridgePlan, observed ?? governedOutput));
|
|
83025
83062
|
return {
|
|
83026
83063
|
message: toolResultMsg,
|
|
83027
83064
|
isError: true,
|
|
83028
|
-
...
|
|
83065
|
+
...linkageMetadata
|
|
83029
83066
|
};
|
|
83030
83067
|
}
|
|
83031
83068
|
})();
|
|
@@ -84240,18 +84277,7 @@ var ProviderTransport = class _ProviderTransport {
|
|
|
84240
84277
|
const cachedOutcome = await recordReusableToolExecutionBridgeOutput({
|
|
84241
84278
|
bridge: platformToolExecutionBridge,
|
|
84242
84279
|
plan: safetyVerdict.toolExecutionBridgePlan,
|
|
84243
|
-
outcome: {
|
|
84244
|
-
message: {
|
|
84245
|
-
...cachedEntry.message,
|
|
84246
|
-
toolCallId: toolCall.id,
|
|
84247
|
-
toolName: toolCall.name,
|
|
84248
|
-
content: cachedEntry.message.content.map((item) => ({
|
|
84249
|
-
...item
|
|
84250
|
-
})),
|
|
84251
|
-
timestamp: this.clock.now()
|
|
84252
|
-
},
|
|
84253
|
-
isError: false
|
|
84254
|
-
},
|
|
84280
|
+
outcome: cloneToolOutcomeForCall({ message: cachedEntry.message, isError: false }, toolCall, this.clock.now(), { approvalRequestId: safetyVerdict.approvalRequestId }),
|
|
84255
84281
|
durationMs: this.clock.now() - cacheHitStart,
|
|
84256
84282
|
signal
|
|
84257
84283
|
});
|
|
@@ -84267,7 +84293,7 @@ var ProviderTransport = class _ProviderTransport {
|
|
|
84267
84293
|
const cachedOutcome = await recordReusableToolExecutionBridgeOutput({
|
|
84268
84294
|
bridge: platformToolExecutionBridge,
|
|
84269
84295
|
plan: safetyVerdict.toolExecutionBridgePlan,
|
|
84270
|
-
outcome: cloneToolOutcomeForCall(await pendingReusable, toolCall, this.clock.now()),
|
|
84296
|
+
outcome: cloneToolOutcomeForCall(await pendingReusable, toolCall, this.clock.now(), { approvalRequestId: safetyVerdict.approvalRequestId }),
|
|
84271
84297
|
durationMs: this.clock.now() - cacheHitStart,
|
|
84272
84298
|
signal
|
|
84273
84299
|
});
|
|
@@ -85189,18 +85215,7 @@ var ProviderTransport = class _ProviderTransport {
|
|
|
85189
85215
|
const cachedOutcome = await recordReusableToolExecutionBridgeOutput({
|
|
85190
85216
|
bridge: platformToolExecutionBridge,
|
|
85191
85217
|
plan: safetyVerdict.toolExecutionBridgePlan,
|
|
85192
|
-
outcome: {
|
|
85193
|
-
message: {
|
|
85194
|
-
...cachedEntry.message,
|
|
85195
|
-
toolCallId: toolCall.id,
|
|
85196
|
-
toolName: toolCall.name,
|
|
85197
|
-
content: cachedEntry.message.content.map((item) => ({
|
|
85198
|
-
...item
|
|
85199
|
-
})),
|
|
85200
|
-
timestamp: this.clock.now()
|
|
85201
|
-
},
|
|
85202
|
-
isError: false
|
|
85203
|
-
},
|
|
85218
|
+
outcome: cloneToolOutcomeForCall({ message: cachedEntry.message, isError: false }, toolCall, this.clock.now(), { approvalRequestId: safetyVerdict.approvalRequestId }),
|
|
85204
85219
|
durationMs: this.clock.now() - cacheHitStart,
|
|
85205
85220
|
signal
|
|
85206
85221
|
});
|
|
@@ -85254,7 +85269,9 @@ var ProviderTransport = class _ProviderTransport {
|
|
|
85254
85269
|
return recordReusableToolExecutionBridgeOutput({
|
|
85255
85270
|
bridge: platformToolExecutionBridge,
|
|
85256
85271
|
plan: safetyVerdict.toolExecutionBridgePlan,
|
|
85257
|
-
outcome: cloneToolOutcomeForCall(await pendingReusable, toolCall, this.clock.now()
|
|
85272
|
+
outcome: cloneToolOutcomeForCall(await pendingReusable, toolCall, this.clock.now(), {
|
|
85273
|
+
approvalRequestId: safetyVerdict.approvalRequestId
|
|
85274
|
+
}),
|
|
85258
85275
|
durationMs: this.clock.now() - cacheHitStart,
|
|
85259
85276
|
signal
|
|
85260
85277
|
});
|
package/dist/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.10.
|
|
3
|
-
"notes": "Maestro by EvalOps - Deterministic coding agent with TUI/CLI and Web UI for AI-assisted development v0.10.
|
|
2
|
+
"version": "0.10.41",
|
|
3
|
+
"notes": "Maestro by EvalOps - Deterministic coding agent with TUI/CLI and Web UI for AI-assisted development v0.10.41 is now available."
|
|
4
4
|
}
|
package/package.json
CHANGED