@ai-sdk/harness 1.0.50 → 1.0.52

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @ai-sdk/harness
2
2
 
3
+ ## 1.0.52
4
+
5
+ ### Patch Changes
6
+
7
+ - ai@7.0.46
8
+
9
+ ## 1.0.51
10
+
11
+ ### Patch Changes
12
+
13
+ - 226a679: fix(harness): emit the final result or error after an approved host tool continuation executes.
14
+ - Updated dependencies [d6ce0ee]
15
+ - Updated dependencies [fa95504]
16
+ - Updated dependencies [349afe7]
17
+ - ai@7.0.45
18
+ - @ai-sdk/provider-utils@5.0.17
19
+
3
20
  ## 1.0.50
4
21
 
5
22
  ### Patch Changes
@@ -1589,6 +1589,34 @@ function runPrompt(input) {
1589
1589
  isError: continuation.isError
1590
1590
  });
1591
1591
  };
1592
+ const enqueueHostToolOutcome = (options) => {
1593
+ if (options.outcome.ok) {
1594
+ const stripped = stripWorkDir(
1595
+ {
1596
+ type: "tool-result",
1597
+ toolCallId: options.toolCall.toolCallId,
1598
+ toolName: options.toolCall.toolName,
1599
+ result: options.outcome.output
1600
+ },
1601
+ input.sessionWorkDir
1602
+ );
1603
+ result.enqueueContinuation({
1604
+ type: "tool-result",
1605
+ toolCallId: options.toolCall.toolCallId,
1606
+ toolName: options.toolCall.toolName,
1607
+ input: options.toolCall.input,
1608
+ output: stripped.result
1609
+ });
1610
+ return;
1611
+ }
1612
+ result.enqueueContinuation({
1613
+ type: "tool-error",
1614
+ toolCallId: options.toolCall.toolCallId,
1615
+ toolName: options.toolCall.toolName,
1616
+ input: options.toolCall.input,
1617
+ error: options.outcome.error
1618
+ });
1619
+ };
1592
1620
  const processPendingApprovalContinuation = async (approval, continuation) => {
1593
1621
  var _a5;
1594
1622
  enqueueApprovalResponse(approval, continuation);
@@ -1663,6 +1691,10 @@ function runPrompt(input) {
1663
1691
  await finishForHostInputPause({ completeCurrentStep: false });
1664
1692
  return "awaiting-tool-result";
1665
1693
  }
1694
+ enqueueHostToolOutcome({
1695
+ toolCall: continuation.toolCall,
1696
+ outcome: execution.outcome
1697
+ });
1666
1698
  await telemetry.toolEnd(rawToolCall.toolCallId, execution.outcome);
1667
1699
  return "continued";
1668
1700
  };