@ai-sdk/harness 1.0.49 → 1.0.51
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 +18 -0
- package/dist/agent/index.js +32 -0
- package/dist/agent/index.js.map +1 -1
- package/package.json +4 -4
- package/src/agent/internal/run-prompt.ts +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/harness
|
|
2
2
|
|
|
3
|
+
## 1.0.51
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 226a679: fix(harness): emit the final result or error after an approved host tool continuation executes.
|
|
8
|
+
- Updated dependencies [d6ce0ee]
|
|
9
|
+
- Updated dependencies [fa95504]
|
|
10
|
+
- Updated dependencies [349afe7]
|
|
11
|
+
- ai@7.0.45
|
|
12
|
+
- @ai-sdk/provider-utils@5.0.17
|
|
13
|
+
|
|
14
|
+
## 1.0.50
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [015acb4]
|
|
19
|
+
- ai@7.0.44
|
|
20
|
+
|
|
3
21
|
## 1.0.49
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/agent/index.js
CHANGED
|
@@ -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
|
};
|