@skyelight/mcp 0.1.3 → 0.1.4
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 +1 -1
- package/src/tools.js +13 -4
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -410,6 +410,9 @@ export function renderItem(item) {
|
|
|
410
410
|
const where = item.source.line
|
|
411
411
|
? `${item.source.file}, line ${item.source.line}`
|
|
412
412
|
: item.source.file;
|
|
413
|
+
// Named before located: "the DoseRow component" is what someone would say,
|
|
414
|
+
// and it stays true after the line has moved.
|
|
415
|
+
const rendered = item.sourcePath?.target?.component;
|
|
413
416
|
// The build too, when the page carried one. Which commit was on the
|
|
414
417
|
// screen is the difference between a live bug and a stale pin — and the
|
|
415
418
|
// branch is what makes that commit findable when the page was a preview
|
|
@@ -417,10 +420,11 @@ export function renderItem(item) {
|
|
|
417
420
|
const from = [];
|
|
418
421
|
if (item.source.build) from.push(`build ${item.source.build}`);
|
|
419
422
|
if (item.source.branch) from.push(`branch ${item.source.branch}`);
|
|
423
|
+
const by = rendered ? `the ${rendered} component, ${where}` : where;
|
|
420
424
|
lines.push(
|
|
421
425
|
from.length
|
|
422
|
-
? `Written by ${
|
|
423
|
-
: `Written by ${
|
|
426
|
+
? `Written by ${by}, in ${from.join(" on ")}.`
|
|
427
|
+
: `Written by ${by}.`,
|
|
424
428
|
);
|
|
425
429
|
// The permalink, when the project names a repository. Pinned to the
|
|
426
430
|
// commit the page carried rather than to a branch, so it opens the code
|
|
@@ -443,7 +447,11 @@ export function renderItem(item) {
|
|
|
443
447
|
// Outermost first, so a repeated file reads as one component and a
|
|
444
448
|
// change of file reads as a boundary between two.
|
|
445
449
|
for (const step of path.above) {
|
|
446
|
-
|
|
450
|
+
// The component first when there is one: it is what a person would
|
|
451
|
+
// call this part of the page, and the one identifier that survives
|
|
452
|
+
// the lines below it moving.
|
|
453
|
+
const who = step.component ? `${step.component} ` : "";
|
|
454
|
+
lines.push(` ${who}${step.file}:${step.line ?? "?"} <${step.tag}>`);
|
|
447
455
|
}
|
|
448
456
|
}
|
|
449
457
|
if (path.below.length) {
|
|
@@ -452,8 +460,9 @@ export function renderItem(item) {
|
|
|
452
460
|
for (const step of path.below) {
|
|
453
461
|
const indent = " ".repeat((step.depth ?? 0) + 1);
|
|
454
462
|
const text = step.text ? ` "${step.text}"` : "";
|
|
463
|
+
const who = step.component ? ` ${step.component}` : "";
|
|
455
464
|
lines.push(
|
|
456
|
-
`${indent}<${step.tag}
|
|
465
|
+
`${indent}<${step.tag}>${who} ${step.file}:${step.line ?? "?"}${text}`,
|
|
457
466
|
);
|
|
458
467
|
}
|
|
459
468
|
}
|