@janole/ai-sdk-provider-codex-asp 0.3.3 → 0.3.4

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/index.js CHANGED
@@ -956,7 +956,7 @@ var DynamicToolsDispatcher = class {
956
956
  // package.json
957
957
  var package_default = {
958
958
  name: "@janole/ai-sdk-provider-codex-asp",
959
- version: "0.3.3"};
959
+ version: "0.3.4"};
960
960
 
961
961
  // src/package-info.ts
962
962
  var PACKAGE_NAME = package_default.name;
@@ -1859,16 +1859,28 @@ function extractToolResults(prompt, callId) {
1859
1859
  if (callId && part.toolCallId !== callId) {
1860
1860
  continue;
1861
1861
  }
1862
- if (part.output.type === "text") {
1862
+ if (part.output.type === "text" || part.output.type === "error-text") {
1863
1863
  contentItems.push({ type: "inputText", text: part.output.value });
1864
- } else if (part.output.type === "json") {
1864
+ if (part.output.type === "error-text") {
1865
+ success = false;
1866
+ }
1867
+ } else if (part.output.type === "json" || part.output.type === "error-json") {
1865
1868
  contentItems.push({ type: "inputText", text: JSON.stringify(part.output.value) });
1869
+ if (part.output.type === "error-json") {
1870
+ success = false;
1871
+ }
1866
1872
  } else if (part.output.type === "execution-denied") {
1867
1873
  success = false;
1868
1874
  contentItems.push({
1869
1875
  type: "inputText",
1870
1876
  text: part.output.reason ?? "Tool execution was denied."
1871
1877
  });
1878
+ } else if (part.output.type === "content") {
1879
+ for (const item of part.output.value) {
1880
+ if (item.type === "text") {
1881
+ contentItems.push({ type: "inputText", text: item.text });
1882
+ }
1883
+ }
1872
1884
  }
1873
1885
  }
1874
1886
  }