@codex-native/sdk 0.0.32 → 0.0.34
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/{chunk-AE45ZXXD.mjs → chunk-CD5HFQTZ.mjs} +4 -1
- package/dist/chunk-CD5HFQTZ.mjs.map +1 -0
- package/dist/cli.cjs +12 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +10 -10
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/chunk-AE45ZXXD.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -282,6 +282,8 @@ type TurnOptions = {
|
|
|
282
282
|
oss?: boolean;
|
|
283
283
|
/** Override the model provider for this specific turn. */
|
|
284
284
|
modelProvider?: string;
|
|
285
|
+
/** Optional tool choice override (passed through to the provider payload). */
|
|
286
|
+
toolChoice?: unknown;
|
|
285
287
|
};
|
|
286
288
|
|
|
287
289
|
type NativeUserInputItem = {
|
|
@@ -309,6 +311,7 @@ type NativeRunRequest = {
|
|
|
309
311
|
workingDirectory?: string;
|
|
310
312
|
skipGitRepoCheck?: boolean;
|
|
311
313
|
outputSchema?: unknown;
|
|
314
|
+
toolChoice?: unknown;
|
|
312
315
|
baseUrl?: string;
|
|
313
316
|
apiKey?: string;
|
|
314
317
|
linuxSandboxPath?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -282,6 +282,8 @@ type TurnOptions = {
|
|
|
282
282
|
oss?: boolean;
|
|
283
283
|
/** Override the model provider for this specific turn. */
|
|
284
284
|
modelProvider?: string;
|
|
285
|
+
/** Optional tool choice override (passed through to the provider payload). */
|
|
286
|
+
toolChoice?: unknown;
|
|
285
287
|
};
|
|
286
288
|
|
|
287
289
|
type NativeUserInputItem = {
|
|
@@ -309,6 +311,7 @@ type NativeRunRequest = {
|
|
|
309
311
|
workingDirectory?: string;
|
|
310
312
|
skipGitRepoCheck?: boolean;
|
|
311
313
|
outputSchema?: unknown;
|
|
314
|
+
toolChoice?: unknown;
|
|
312
315
|
baseUrl?: string;
|
|
313
316
|
apiKey?: string;
|
|
314
317
|
linuxSandboxPath?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
tokenizerCount,
|
|
28
28
|
tokenizerDecode,
|
|
29
29
|
tokenizerEncode
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CD5HFQTZ.mjs";
|
|
31
31
|
|
|
32
32
|
// src/agents/toolRegistry.ts
|
|
33
33
|
var executors = /* @__PURE__ */ new Map();
|
|
@@ -186,9 +186,11 @@ var CodexModel = class {
|
|
|
186
186
|
this.registerRequestTools(request.tools);
|
|
187
187
|
}
|
|
188
188
|
const input = await this.convertRequestToInput(request);
|
|
189
|
+
const toolChoice = request.modelSettings?.toolChoice ?? void 0;
|
|
189
190
|
const turn = await thread.run(input, {
|
|
190
191
|
outputSchema: normalizeAgentsOutputType(request.outputType),
|
|
191
|
-
oss: this.options.oss
|
|
192
|
+
oss: this.options.oss,
|
|
193
|
+
toolChoice
|
|
192
194
|
});
|
|
193
195
|
const planItem = turn.items.filter((item) => item.type === "todo_list").slice(-1)[0];
|
|
194
196
|
const response = {
|
|
@@ -212,9 +214,11 @@ var CodexModel = class {
|
|
|
212
214
|
this.registerRequestTools(request.tools);
|
|
213
215
|
}
|
|
214
216
|
const input = await this.convertRequestToInput(request);
|
|
217
|
+
const toolChoice = request.modelSettings?.toolChoice ?? void 0;
|
|
215
218
|
const { events } = await thread.runStreamed(input, {
|
|
216
219
|
outputSchema: normalizeAgentsOutputType(request.outputType),
|
|
217
|
-
oss: this.options.oss
|
|
220
|
+
oss: this.options.oss,
|
|
221
|
+
toolChoice
|
|
218
222
|
});
|
|
219
223
|
const textAccumulator = /* @__PURE__ */ new Map();
|
|
220
224
|
for await (const event of events) {
|