@howaboua/pi-codex-conversion 1.5.2 → 1.5.3-dev.18.ffc51f4
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/package.json
CHANGED
|
@@ -70,7 +70,7 @@ function formatCommandPreview(command: string | undefined): string | undefined {
|
|
|
70
70
|
|
|
71
71
|
function formatActionLine(action: ShellAction): { title: string; body: string } {
|
|
72
72
|
if (action.kind === "read") {
|
|
73
|
-
return { title: "Read", body: action
|
|
73
|
+
return { title: "Read", body: formatReadLabel(action) };
|
|
74
74
|
}
|
|
75
75
|
if (action.kind === "list") {
|
|
76
76
|
return { title: "List", body: action.path ?? action.command };
|
|
@@ -87,6 +87,19 @@ function formatActionLine(action: ShellAction): { title: string; body: string }
|
|
|
87
87
|
return { title: "Run", body: action.command };
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
function formatReadLabel(action: Extract<ShellAction, { kind: "read" }>): string {
|
|
91
|
+
const skillName = skillNameFromSkillPath(action.path);
|
|
92
|
+
return skillName ? `${skillName} skill` : action.name;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function skillNameFromSkillPath(path: string): string | undefined {
|
|
96
|
+
const normalized = path.replace(/\\/g, "/");
|
|
97
|
+
const parts = normalized.split("/").filter(Boolean);
|
|
98
|
+
if (parts.at(-1) !== "SKILL.md") return undefined;
|
|
99
|
+
const skillDir = parts.at(-2);
|
|
100
|
+
return skillDir && skillDir !== ".system" ? skillDir : undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
90
103
|
function coalesceReadGroups(actionGroups: ShellAction[][]): ShellAction[] {
|
|
91
104
|
const flattened: ShellAction[] = [];
|
|
92
105
|
|
|
@@ -115,21 +128,25 @@ function coalesceReadGroups(actionGroups: ShellAction[][]): ShellAction[] {
|
|
|
115
128
|
}
|
|
116
129
|
|
|
117
130
|
if (lastRead) {
|
|
118
|
-
const
|
|
119
|
-
const
|
|
131
|
+
const duplicateLabels = new Set<string>();
|
|
132
|
+
const seenLabels = new Set<string>();
|
|
120
133
|
for (const read of reads) {
|
|
121
|
-
|
|
122
|
-
|
|
134
|
+
const label = formatReadLabel(read);
|
|
135
|
+
if (seenLabels.has(label)) {
|
|
136
|
+
duplicateLabels.add(label);
|
|
123
137
|
continue;
|
|
124
138
|
}
|
|
125
|
-
|
|
139
|
+
seenLabels.add(label);
|
|
126
140
|
}
|
|
127
|
-
const labels = reads.map((read) =>
|
|
141
|
+
const labels = reads.map((read) => {
|
|
142
|
+
const label = formatReadLabel(read);
|
|
143
|
+
return duplicateLabels.has(label) ? read.path : label;
|
|
144
|
+
});
|
|
128
145
|
flattened.push({
|
|
129
146
|
kind: "read",
|
|
130
147
|
command: labels.join(" && "),
|
|
131
148
|
name: labels.join(", "),
|
|
132
|
-
path:
|
|
149
|
+
path: "",
|
|
133
150
|
});
|
|
134
151
|
}
|
|
135
152
|
continue;
|
|
Binary file
|
|
Binary file
|