lunel-cli 0.1.50 → 0.1.51
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/ai/codex.js +28 -12
- package/package.json +1 -1
package/dist/ai/codex.js
CHANGED
|
@@ -969,11 +969,20 @@ export class CodexProvider {
|
|
|
969
969
|
extractItemId(payload) {
|
|
970
970
|
return (this.readString(payload.itemId)
|
|
971
971
|
?? this.readString(payload.item_id)
|
|
972
|
+
?? this.readString(payload.call_id)
|
|
973
|
+
?? this.readString(payload.callId)
|
|
974
|
+
?? this.readString(payload.id)
|
|
972
975
|
?? this.readString(payload.messageId)
|
|
973
976
|
?? this.readString(payload.message_id)
|
|
974
977
|
?? this.readString(this.asRecord(payload.item).id)
|
|
975
978
|
?? this.readString(this.asRecord(payload.item).itemId)
|
|
979
|
+
?? this.readString(this.asRecord(payload.item).call_id)
|
|
980
|
+
?? this.readString(this.asRecord(payload.item).callId)
|
|
976
981
|
?? this.readString(this.asRecord(payload.item).messageId)
|
|
982
|
+
?? this.readString(this.asRecord(payload.event).itemId)
|
|
983
|
+
?? this.readString(this.asRecord(payload.event).item_id)
|
|
984
|
+
?? this.readString(this.asRecord(payload.event).call_id)
|
|
985
|
+
?? this.readString(this.asRecord(payload.event).callId)
|
|
977
986
|
?? this.readString(this.asRecord(payload.event).id)
|
|
978
987
|
?? this.readString(this.asRecord(this.asRecord(payload.event).item).id));
|
|
979
988
|
}
|
|
@@ -1111,6 +1120,24 @@ export class CodexProvider {
|
|
|
1111
1120
|
"unified_diff",
|
|
1112
1121
|
"unifiedDiff",
|
|
1113
1122
|
"patch",
|
|
1123
|
+
]);
|
|
1124
|
+
if (direct)
|
|
1125
|
+
return direct;
|
|
1126
|
+
}
|
|
1127
|
+
const changes = this.readArray(item.changes ?? params.changes ?? event.changes ?? nestedItem.changes);
|
|
1128
|
+
if (changes.length > 0) {
|
|
1129
|
+
return changes
|
|
1130
|
+
.map((change) => {
|
|
1131
|
+
const obj = this.asRecord(change);
|
|
1132
|
+
const path = this.readString(obj.path) ?? this.readString(obj.filePath) ?? this.readString(obj.file_path) ?? "file";
|
|
1133
|
+
const kind = this.readString(obj.kind) ?? "change";
|
|
1134
|
+
const diff = this.firstString(obj, ["diff", "unified_diff", "unifiedDiff", "patch"]) ?? "";
|
|
1135
|
+
return diff ? `Path: ${path}\nKind: ${kind}\n\n\`\`\`diff\n${diff}\n\`\`\`` : `Path: ${path}\nKind: ${kind}`;
|
|
1136
|
+
})
|
|
1137
|
+
.join("\n\n---\n\n");
|
|
1138
|
+
}
|
|
1139
|
+
for (const source of sources) {
|
|
1140
|
+
const direct = this.firstString(source, [
|
|
1114
1141
|
"text",
|
|
1115
1142
|
"message",
|
|
1116
1143
|
"summary",
|
|
@@ -1121,18 +1148,7 @@ export class CodexProvider {
|
|
|
1121
1148
|
if (direct)
|
|
1122
1149
|
return direct;
|
|
1123
1150
|
}
|
|
1124
|
-
|
|
1125
|
-
if (changes.length === 0)
|
|
1126
|
-
return undefined;
|
|
1127
|
-
return changes
|
|
1128
|
-
.map((change) => {
|
|
1129
|
-
const obj = this.asRecord(change);
|
|
1130
|
-
const path = this.readString(obj.path) ?? this.readString(obj.filePath) ?? this.readString(obj.file_path) ?? "file";
|
|
1131
|
-
const kind = this.readString(obj.kind) ?? "change";
|
|
1132
|
-
const diff = this.firstString(obj, ["diff", "unified_diff", "unifiedDiff", "patch"]) ?? "";
|
|
1133
|
-
return diff ? `Path: ${path}\nKind: ${kind}\n\n\`\`\`diff\n${diff}\n\`\`\`` : `Path: ${path}\nKind: ${kind}`;
|
|
1134
|
-
})
|
|
1135
|
-
.join("\n\n---\n\n");
|
|
1151
|
+
return undefined;
|
|
1136
1152
|
}
|
|
1137
1153
|
extractToolInput(item, params) {
|
|
1138
1154
|
return item.input ?? item.command ?? item.path ?? item.args ?? params.command ?? params.path ?? undefined;
|