replicas-cli 0.2.456 → 0.2.457
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.mjs +39 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10078,7 +10078,7 @@ function formatTurnElapsed(ms) {
|
|
|
10078
10078
|
}
|
|
10079
10079
|
|
|
10080
10080
|
// ../shared/src/cli-version.ts
|
|
10081
|
-
var CLI_VERSION = "0.2.
|
|
10081
|
+
var CLI_VERSION = "0.2.457";
|
|
10082
10082
|
|
|
10083
10083
|
// ../shared/src/version.ts
|
|
10084
10084
|
function compareVersions(v1, v2) {
|
|
@@ -25076,8 +25076,25 @@ function parseSkillName(tool, input) {
|
|
|
25076
25076
|
const skillName = parsedInput.skill ?? parsedInput.name;
|
|
25077
25077
|
return typeof skillName === "string" && skillName ? skillName : null;
|
|
25078
25078
|
}
|
|
25079
|
+
function parseSkillFilePath(input) {
|
|
25080
|
+
const parsedInput = typeof input === "string" ? safeJsonParse(input, null) : input;
|
|
25081
|
+
if (!isRecord(parsedInput)) return null;
|
|
25082
|
+
const path6 = [parsedInput.path, parsedInput.filePath, parsedInput.file_path].find((value) => typeof value === "string" && value.length > 0);
|
|
25083
|
+
if (!path6) return null;
|
|
25084
|
+
const parts = path6.split(/[\\/]+/).filter(Boolean);
|
|
25085
|
+
if (parts.length < 2) return null;
|
|
25086
|
+
if (parts[parts.length - 1].toLowerCase() !== "skill.md") return null;
|
|
25087
|
+
const skillName = parts[parts.length - 2];
|
|
25088
|
+
return skillName && skillName.toLowerCase() !== "skills" ? skillName : null;
|
|
25089
|
+
}
|
|
25090
|
+
function skillNameFromToolCall(tool, input) {
|
|
25091
|
+
const directSkillName = parseSkillName(tool, input);
|
|
25092
|
+
if (directSkillName) return directSkillName;
|
|
25093
|
+
if (typeof tool !== "string" || !["read", "read_file", "readfile"].includes(tool.toLowerCase())) return null;
|
|
25094
|
+
return parseSkillFilePath(input);
|
|
25095
|
+
}
|
|
25079
25096
|
function createCallDisplayMessage(message) {
|
|
25080
|
-
const skillName = message.server.toLowerCase() === "skills" ? message.tool :
|
|
25097
|
+
const skillName = message.server.toLowerCase() === "skills" ? message.tool : skillNameFromToolCall(message.tool, message.input);
|
|
25081
25098
|
if (skillName === null) return { ...message, type: "tool_call" };
|
|
25082
25099
|
return {
|
|
25083
25100
|
id: message.id,
|
|
@@ -25722,6 +25739,15 @@ function parsePiEvents(events) {
|
|
|
25722
25739
|
for (const event of events) {
|
|
25723
25740
|
if (event.type === "event_msg" && event.payload.type === "user_message" && typeof event.payload.message === "string") {
|
|
25724
25741
|
messages.push({ id: `pi-user-${event.timestamp}-${messages.length}`, type: "user", content: event.payload.message, timestamp: event.timestamp });
|
|
25742
|
+
if (typeof event.payload.skillName === "string" && event.payload.skillName) {
|
|
25743
|
+
messages.push({
|
|
25744
|
+
id: `pi-skill-${event.timestamp}-${messages.length}`,
|
|
25745
|
+
type: "skill",
|
|
25746
|
+
skillName: event.payload.skillName,
|
|
25747
|
+
status: "completed",
|
|
25748
|
+
timestamp: event.timestamp
|
|
25749
|
+
});
|
|
25750
|
+
}
|
|
25725
25751
|
continue;
|
|
25726
25752
|
}
|
|
25727
25753
|
if (event.type === "pi-error") {
|
|
@@ -26550,6 +26576,16 @@ function messageForItem(item) {
|
|
|
26550
26576
|
timestamp: item.timestamp
|
|
26551
26577
|
};
|
|
26552
26578
|
}
|
|
26579
|
+
function skillMessagesForItem(item) {
|
|
26580
|
+
if (item.type !== "userMessage" || !item.skillNames) return [];
|
|
26581
|
+
return item.skillNames.filter((skillName) => skillName.trim().length > 0).map((skillName, index) => ({
|
|
26582
|
+
id: `skill-${item.id}-${index}`,
|
|
26583
|
+
type: "skill",
|
|
26584
|
+
skillName,
|
|
26585
|
+
status: "completed",
|
|
26586
|
+
timestamp: item.timestamp
|
|
26587
|
+
}));
|
|
26588
|
+
}
|
|
26553
26589
|
function stableString(value) {
|
|
26554
26590
|
if (value === void 0) return "";
|
|
26555
26591
|
if (typeof value !== "object" || value === null) return String(value);
|
|
@@ -26607,6 +26643,7 @@ function parseCodexAspTranscript(transcript) {
|
|
|
26607
26643
|
if (message) {
|
|
26608
26644
|
messages.push(message);
|
|
26609
26645
|
}
|
|
26646
|
+
messages.push(...skillMessagesForItem(item));
|
|
26610
26647
|
}
|
|
26611
26648
|
return messages;
|
|
26612
26649
|
}
|