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