shariq-pi-extensions 0.3.5 → 0.3.6
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.
|
@@ -137,12 +137,13 @@ export async function formatDeveloperSearchOutput(payload: Record<string, unknow
|
|
|
137
137
|
|
|
138
138
|
for (const [index, rawResult] of results.entries()) {
|
|
139
139
|
const item = record(rawResult);
|
|
140
|
-
const type = valueText(item.type) ?? "artifact";
|
|
141
|
-
const title = valueText(item.title) ?? valueText(item.id) ?? valueText(item.url) ?? "Untitled";
|
|
142
|
-
const url = valueText(item.url);
|
|
143
140
|
const id = valueText(item.id);
|
|
141
|
+
const idKind = id ? id.match(/^([a-z_]+):/i)?.[1]?.replace(/_/g, " ") : undefined;
|
|
142
|
+
const type = (valueText(item.type) ?? idKind ?? "artifact").toUpperCase();
|
|
143
|
+
const title = valueText(item.title) ?? id ?? valueText(item.url) ?? "Untitled";
|
|
144
|
+
const url = valueText(item.url);
|
|
144
145
|
|
|
145
|
-
lines.push("", `### ${index + 1}. [${type
|
|
146
|
+
lines.push("", `### ${index + 1}. [${type}] ${title}`);
|
|
146
147
|
if (url) lines.push(`URL: ${url}`);
|
|
147
148
|
if (id && id !== title) lines.push(`ID: ${id}`);
|
|
148
149
|
|