@ycodium-ai/agent-codex 0.2.3614 → 0.2.3635
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 +17 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1761,10 +1761,11 @@ function decodeThreadOpen(result) {
|
|
|
1761
1761
|
const thread = isRecord2(result) ? isRecord2(result["thread"]) ? result["thread"] : result : null;
|
|
1762
1762
|
const id = thread ? asString(thread["id"]) : null;
|
|
1763
1763
|
if (!id) throw new Error("codex thread/start|resume returned no thread id");
|
|
1764
|
+
const openedModel = asString(thread?.["model"]) ?? (isRecord2(result) ? asString(result["model"]) : null);
|
|
1764
1765
|
return {
|
|
1765
1766
|
threadId: id,
|
|
1766
1767
|
...asString(thread?.["cwd"]) ? { cwd: asString(thread["cwd"]) } : {},
|
|
1767
|
-
...
|
|
1768
|
+
...openedModel ? { model: openedModel } : {}
|
|
1768
1769
|
};
|
|
1769
1770
|
}
|
|
1770
1771
|
function decodeTurnStart(result) {
|
|
@@ -5528,12 +5529,13 @@ var CodexSessionRuntime = class {
|
|
|
5528
5529
|
const opened = decodeThreadOpen(result);
|
|
5529
5530
|
this.nativeThreadId = opened.threadId;
|
|
5530
5531
|
this.model = opened.model ?? requestedModel;
|
|
5532
|
+
const modelSource = opened.model !== void 0 ? "reported" : "echo";
|
|
5531
5533
|
this.session = {
|
|
5532
5534
|
...this.session,
|
|
5533
5535
|
status: "idle",
|
|
5534
5536
|
resumeCursor: { threadId: this.nativeThreadId },
|
|
5535
5537
|
updatedAt: nowIso(),
|
|
5536
|
-
...this.model ? { model: this.model } : {}
|
|
5538
|
+
...this.model ? { model: this.model, modelSource } : {}
|
|
5537
5539
|
};
|
|
5538
5540
|
this.emit({
|
|
5539
5541
|
eventId: nextEventId(),
|
|
@@ -5642,8 +5644,7 @@ var CodexSessionRuntime = class {
|
|
|
5642
5644
|
...this.session,
|
|
5643
5645
|
status: "running",
|
|
5644
5646
|
activeTurnId: started.turnId,
|
|
5645
|
-
updatedAt: nowIso()
|
|
5646
|
-
...requestedModel ? { model: requestedModel } : {}
|
|
5647
|
+
updatedAt: nowIso()
|
|
5647
5648
|
};
|
|
5648
5649
|
return {
|
|
5649
5650
|
threadId: this.threadId,
|
|
@@ -5851,14 +5852,18 @@ var reasoningEffortLabel = (effort) => reasoningEffortShortLabel(effort) ?? effo
|
|
|
5851
5852
|
function codexModelDisplayName(displayName) {
|
|
5852
5853
|
return displayName.replace(/^gpt/i, "GPT").replace(/-([a-z])/g, (_, c) => `-${c.toUpperCase()}`);
|
|
5853
5854
|
}
|
|
5855
|
+
function reasoningEffortId(entry) {
|
|
5856
|
+
if (!isRecord2(entry)) return null;
|
|
5857
|
+
const id = asString(entry["reasoningEffort"])?.trim();
|
|
5858
|
+
return id ? id : null;
|
|
5859
|
+
}
|
|
5854
5860
|
function reasoningDescriptor(row) {
|
|
5855
5861
|
const supported = row["supportedReasoningEfforts"];
|
|
5856
5862
|
if (!Array.isArray(supported) || supported.length === 0) return null;
|
|
5857
5863
|
const defaultEffort = asString(row["defaultReasoningEffort"]);
|
|
5858
5864
|
const options = supported.flatMap((entry) => {
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
if (!id) return [];
|
|
5865
|
+
const id = reasoningEffortId(entry);
|
|
5866
|
+
if (id === null || !isRecord2(entry)) return [];
|
|
5862
5867
|
const description = asString(entry["description"]);
|
|
5863
5868
|
return [
|
|
5864
5869
|
{
|
|
@@ -5921,6 +5926,8 @@ function codexProbeModel(row) {
|
|
|
5921
5926
|
const slug = asString(row["model"]);
|
|
5922
5927
|
if (!slug) return null;
|
|
5923
5928
|
const displayName = asString(row["displayName"]);
|
|
5929
|
+
const supported = row["supportedReasoningEfforts"];
|
|
5930
|
+
const effortsKnown = Array.isArray(supported) && supported.every((entry) => reasoningEffortId(entry) !== null);
|
|
5924
5931
|
const optionDescriptors = [reasoningDescriptor(row), serviceTierDescriptor(row)].filter(
|
|
5925
5932
|
(descriptor) => descriptor !== null
|
|
5926
5933
|
);
|
|
@@ -5929,9 +5936,8 @@ function codexProbeModel(row) {
|
|
|
5929
5936
|
...displayName ? { name: codexModelDisplayName(displayName) } : {},
|
|
5930
5937
|
...row["isDefault"] === true ? { isDefault: true } : {},
|
|
5931
5938
|
...row["hidden"] === true ? { hidden: true } : {},
|
|
5932
|
-
//
|
|
5933
|
-
|
|
5934
|
-
capabilities: { optionDescriptors }
|
|
5939
|
+
// 答过就给 `capabilities`(空表 = 这个模型没有档位,宿主清掉旧档位);说不出就不给。
|
|
5940
|
+
...effortsKnown ? { capabilities: { optionDescriptors } } : {}
|
|
5935
5941
|
};
|
|
5936
5942
|
}
|
|
5937
5943
|
async function listCodexModels(rpc) {
|
|
@@ -7869,7 +7875,7 @@ var executors = [
|
|
|
7869
7875
|
];
|
|
7870
7876
|
var index_default = definePlugin({
|
|
7871
7877
|
id: "agent-codex",
|
|
7872
|
-
apiVersion:
|
|
7878
|
+
apiVersion: 50,
|
|
7873
7879
|
executors,
|
|
7874
7880
|
activate(ctx) {
|
|
7875
7881
|
capturedAttachments = ctx.attachments;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-codex",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3635",
|
|
4
4
|
"description": "Codex executor: Codex CLI over the app-server JSON-RPC protocol.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tailwindcss": "^4.0.0",
|
|
30
30
|
"typescript": "~6.0.3",
|
|
31
31
|
"vite-plus": "0.2.2",
|
|
32
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
32
|
+
"@ycodium-ai/plugin-api": "0.2.3635",
|
|
33
33
|
"ycodium-executor-testing": "0.0.0",
|
|
34
34
|
"ycodium-jsonl-stream": "0.0.0"
|
|
35
35
|
},
|