ai-sdk-provider-codex-cli 1.2.0 → 1.2.1
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 +18 -8
- package/dist/index.js +18 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1623,7 +1623,13 @@ var ExecLanguageModel = class {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
emitToolInvocation(controller, toolCallId, toolName, inputPayload) {
|
|
1625
1625
|
const inputString = safeStringify(inputPayload);
|
|
1626
|
-
controller.enqueue({
|
|
1626
|
+
controller.enqueue({
|
|
1627
|
+
type: "tool-input-start",
|
|
1628
|
+
id: toolCallId,
|
|
1629
|
+
toolName,
|
|
1630
|
+
providerExecuted: true,
|
|
1631
|
+
dynamic: true
|
|
1632
|
+
});
|
|
1627
1633
|
if (inputString) {
|
|
1628
1634
|
controller.enqueue({ type: "tool-input-delta", id: toolCallId, delta: inputString });
|
|
1629
1635
|
}
|
|
@@ -1633,7 +1639,8 @@ var ExecLanguageModel = class {
|
|
|
1633
1639
|
toolCallId,
|
|
1634
1640
|
toolName,
|
|
1635
1641
|
input: inputString,
|
|
1636
|
-
providerExecuted: true
|
|
1642
|
+
providerExecuted: true,
|
|
1643
|
+
dynamic: true
|
|
1637
1644
|
});
|
|
1638
1645
|
}
|
|
1639
1646
|
emitToolResult(controller, toolCallId, toolName, item, resultPayload, metadata) {
|
|
@@ -1661,6 +1668,7 @@ var ExecLanguageModel = class {
|
|
|
1661
1668
|
toolCallId,
|
|
1662
1669
|
toolName,
|
|
1663
1670
|
result: resultPayload ?? {},
|
|
1671
|
+
dynamic: true,
|
|
1664
1672
|
...isError ? { isError: true } : {},
|
|
1665
1673
|
...Object.keys(providerMetadataEntries).length ? { providerMetadata: { "codex-cli": providerMetadataEntries } } : {}
|
|
1666
1674
|
});
|
|
@@ -2319,10 +2327,10 @@ function normalizeItemType(type) {
|
|
|
2319
2327
|
function mapTool(item) {
|
|
2320
2328
|
const type = normalizeItemType(item.type);
|
|
2321
2329
|
if (type === "commandexecution") {
|
|
2322
|
-
return { toolName: "exec" };
|
|
2330
|
+
return { toolName: "exec", dynamic: true };
|
|
2323
2331
|
}
|
|
2324
2332
|
if (type === "filechange") {
|
|
2325
|
-
return { toolName: "patch" };
|
|
2333
|
+
return { toolName: "patch", dynamic: true };
|
|
2326
2334
|
}
|
|
2327
2335
|
if (type === "mcptoolcall") {
|
|
2328
2336
|
const server = typeof item.server === "string" ? item.server || "server" : "server";
|
|
@@ -2333,7 +2341,7 @@ function mapTool(item) {
|
|
|
2333
2341
|
};
|
|
2334
2342
|
}
|
|
2335
2343
|
if (type === "websearch") {
|
|
2336
|
-
return { toolName: "web_search" };
|
|
2344
|
+
return { toolName: "web_search", dynamic: true };
|
|
2337
2345
|
}
|
|
2338
2346
|
return void 0;
|
|
2339
2347
|
}
|
|
@@ -2400,7 +2408,8 @@ function createNotificationHandlers(context) {
|
|
|
2400
2408
|
context.emitter.emitToolOutputDelta(
|
|
2401
2409
|
itemId,
|
|
2402
2410
|
tracked?.toolName ?? defaultToolName,
|
|
2403
|
-
params.delta
|
|
2411
|
+
params.delta,
|
|
2412
|
+
tracked?.dynamic ?? true
|
|
2404
2413
|
);
|
|
2405
2414
|
};
|
|
2406
2415
|
return {
|
|
@@ -2732,7 +2741,7 @@ var AppServerStreamEmitter = class {
|
|
|
2732
2741
|
...dynamic ? { dynamic: true } : {}
|
|
2733
2742
|
});
|
|
2734
2743
|
}
|
|
2735
|
-
emitToolOutputDelta(toolCallId, toolName, delta) {
|
|
2744
|
+
emitToolOutputDelta(toolCallId, toolName, delta, dynamic) {
|
|
2736
2745
|
this.safeEnqueue({
|
|
2737
2746
|
type: "tool-result",
|
|
2738
2747
|
toolCallId,
|
|
@@ -2741,7 +2750,8 @@ var AppServerStreamEmitter = class {
|
|
|
2741
2750
|
result: {
|
|
2742
2751
|
type: "output-delta",
|
|
2743
2752
|
delta
|
|
2744
|
-
}
|
|
2753
|
+
},
|
|
2754
|
+
...dynamic ? { dynamic: true } : {}
|
|
2745
2755
|
});
|
|
2746
2756
|
}
|
|
2747
2757
|
emitToolResult(toolCallId, toolName, result, dynamic, isError) {
|
package/dist/index.js
CHANGED
|
@@ -1615,7 +1615,13 @@ var ExecLanguageModel = class {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
emitToolInvocation(controller, toolCallId, toolName, inputPayload) {
|
|
1617
1617
|
const inputString = safeStringify(inputPayload);
|
|
1618
|
-
controller.enqueue({
|
|
1618
|
+
controller.enqueue({
|
|
1619
|
+
type: "tool-input-start",
|
|
1620
|
+
id: toolCallId,
|
|
1621
|
+
toolName,
|
|
1622
|
+
providerExecuted: true,
|
|
1623
|
+
dynamic: true
|
|
1624
|
+
});
|
|
1619
1625
|
if (inputString) {
|
|
1620
1626
|
controller.enqueue({ type: "tool-input-delta", id: toolCallId, delta: inputString });
|
|
1621
1627
|
}
|
|
@@ -1625,7 +1631,8 @@ var ExecLanguageModel = class {
|
|
|
1625
1631
|
toolCallId,
|
|
1626
1632
|
toolName,
|
|
1627
1633
|
input: inputString,
|
|
1628
|
-
providerExecuted: true
|
|
1634
|
+
providerExecuted: true,
|
|
1635
|
+
dynamic: true
|
|
1629
1636
|
});
|
|
1630
1637
|
}
|
|
1631
1638
|
emitToolResult(controller, toolCallId, toolName, item, resultPayload, metadata) {
|
|
@@ -1653,6 +1660,7 @@ var ExecLanguageModel = class {
|
|
|
1653
1660
|
toolCallId,
|
|
1654
1661
|
toolName,
|
|
1655
1662
|
result: resultPayload ?? {},
|
|
1663
|
+
dynamic: true,
|
|
1656
1664
|
...isError ? { isError: true } : {},
|
|
1657
1665
|
...Object.keys(providerMetadataEntries).length ? { providerMetadata: { "codex-cli": providerMetadataEntries } } : {}
|
|
1658
1666
|
});
|
|
@@ -2311,10 +2319,10 @@ function normalizeItemType(type) {
|
|
|
2311
2319
|
function mapTool(item) {
|
|
2312
2320
|
const type = normalizeItemType(item.type);
|
|
2313
2321
|
if (type === "commandexecution") {
|
|
2314
|
-
return { toolName: "exec" };
|
|
2322
|
+
return { toolName: "exec", dynamic: true };
|
|
2315
2323
|
}
|
|
2316
2324
|
if (type === "filechange") {
|
|
2317
|
-
return { toolName: "patch" };
|
|
2325
|
+
return { toolName: "patch", dynamic: true };
|
|
2318
2326
|
}
|
|
2319
2327
|
if (type === "mcptoolcall") {
|
|
2320
2328
|
const server = typeof item.server === "string" ? item.server || "server" : "server";
|
|
@@ -2325,7 +2333,7 @@ function mapTool(item) {
|
|
|
2325
2333
|
};
|
|
2326
2334
|
}
|
|
2327
2335
|
if (type === "websearch") {
|
|
2328
|
-
return { toolName: "web_search" };
|
|
2336
|
+
return { toolName: "web_search", dynamic: true };
|
|
2329
2337
|
}
|
|
2330
2338
|
return void 0;
|
|
2331
2339
|
}
|
|
@@ -2392,7 +2400,8 @@ function createNotificationHandlers(context) {
|
|
|
2392
2400
|
context.emitter.emitToolOutputDelta(
|
|
2393
2401
|
itemId,
|
|
2394
2402
|
tracked?.toolName ?? defaultToolName,
|
|
2395
|
-
params.delta
|
|
2403
|
+
params.delta,
|
|
2404
|
+
tracked?.dynamic ?? true
|
|
2396
2405
|
);
|
|
2397
2406
|
};
|
|
2398
2407
|
return {
|
|
@@ -2724,7 +2733,7 @@ var AppServerStreamEmitter = class {
|
|
|
2724
2733
|
...dynamic ? { dynamic: true } : {}
|
|
2725
2734
|
});
|
|
2726
2735
|
}
|
|
2727
|
-
emitToolOutputDelta(toolCallId, toolName, delta) {
|
|
2736
|
+
emitToolOutputDelta(toolCallId, toolName, delta, dynamic) {
|
|
2728
2737
|
this.safeEnqueue({
|
|
2729
2738
|
type: "tool-result",
|
|
2730
2739
|
toolCallId,
|
|
@@ -2733,7 +2742,8 @@ var AppServerStreamEmitter = class {
|
|
|
2733
2742
|
result: {
|
|
2734
2743
|
type: "output-delta",
|
|
2735
2744
|
delta
|
|
2736
|
-
}
|
|
2745
|
+
},
|
|
2746
|
+
...dynamic ? { dynamic: true } : {}
|
|
2737
2747
|
});
|
|
2738
2748
|
}
|
|
2739
2749
|
emitToolResult(toolCallId, toolName, result, dynamic, isError) {
|