@cephalization/phoenix-insight 1.0.2 → 1.0.3
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/cli.js +14 -9
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1695,7 +1695,9 @@ function buildWhatsHereSection(stats, metadata) {
|
|
|
1695
1695
|
lines.push("- **No prompts found**");
|
|
1696
1696
|
}
|
|
1697
1697
|
lines.push(
|
|
1698
|
-
`- **Snapshot**: Created ${formatRelativeTime(
|
|
1698
|
+
`- **Snapshot**: Created ${formatRelativeTime(
|
|
1699
|
+
metadata.snapshotTime
|
|
1700
|
+
)} from ${metadata.phoenixUrl}`
|
|
1699
1701
|
);
|
|
1700
1702
|
lines.push("");
|
|
1701
1703
|
return lines.join("\n");
|
|
@@ -1723,7 +1725,7 @@ async function collectSnapshotStats(mode) {
|
|
|
1723
1725
|
};
|
|
1724
1726
|
try {
|
|
1725
1727
|
const projectsExec = await mode.exec(
|
|
1726
|
-
"cat
|
|
1728
|
+
"cat projects/index.jsonl 2>/dev/null || true"
|
|
1727
1729
|
);
|
|
1728
1730
|
if (projectsExec.stdout) {
|
|
1729
1731
|
const projectLines = projectsExec.stdout.trim().split("\n").filter((line) => line.length > 0);
|
|
@@ -1735,7 +1737,7 @@ async function collectSnapshotStats(mode) {
|
|
|
1735
1737
|
spanCount: 0
|
|
1736
1738
|
};
|
|
1737
1739
|
const spansMetaExec = await mode.exec(
|
|
1738
|
-
`cat
|
|
1740
|
+
`cat projects/${project.name}/spans/metadata.json 2>/dev/null || echo "{}"`
|
|
1739
1741
|
);
|
|
1740
1742
|
if (spansMetaExec.stdout) {
|
|
1741
1743
|
try {
|
|
@@ -1753,7 +1755,7 @@ async function collectSnapshotStats(mode) {
|
|
|
1753
1755
|
}
|
|
1754
1756
|
try {
|
|
1755
1757
|
const datasetsExec = await mode.exec(
|
|
1756
|
-
"cat
|
|
1758
|
+
"cat datasets/index.jsonl 2>/dev/null || true"
|
|
1757
1759
|
);
|
|
1758
1760
|
if (datasetsExec.stdout) {
|
|
1759
1761
|
const datasetLines = datasetsExec.stdout.trim().split("\n").filter((line) => line.length > 0);
|
|
@@ -1761,7 +1763,7 @@ async function collectSnapshotStats(mode) {
|
|
|
1761
1763
|
try {
|
|
1762
1764
|
const dataset = JSON.parse(line);
|
|
1763
1765
|
const examplesExec = await mode.exec(
|
|
1764
|
-
`wc -l <
|
|
1766
|
+
`wc -l < datasets/${dataset.name}/examples.jsonl 2>/dev/null || echo "0"`
|
|
1765
1767
|
);
|
|
1766
1768
|
const exampleCount = parseInt(examplesExec.stdout.trim()) || 0;
|
|
1767
1769
|
result.datasets.push({
|
|
@@ -1777,7 +1779,7 @@ async function collectSnapshotStats(mode) {
|
|
|
1777
1779
|
}
|
|
1778
1780
|
try {
|
|
1779
1781
|
const experimentsExec = await mode.exec(
|
|
1780
|
-
"cat
|
|
1782
|
+
"cat experiments/index.jsonl 2>/dev/null || true"
|
|
1781
1783
|
);
|
|
1782
1784
|
if (experimentsExec.stdout) {
|
|
1783
1785
|
const experimentLines = experimentsExec.stdout.trim().split("\n").filter((line) => line.length > 0);
|
|
@@ -1805,7 +1807,7 @@ async function collectSnapshotStats(mode) {
|
|
|
1805
1807
|
}
|
|
1806
1808
|
try {
|
|
1807
1809
|
const promptsExec = await mode.exec(
|
|
1808
|
-
"cat
|
|
1810
|
+
"cat prompts/index.jsonl 2>/dev/null || true"
|
|
1809
1811
|
);
|
|
1810
1812
|
if (promptsExec.stdout) {
|
|
1811
1813
|
const promptLines = promptsExec.stdout.trim().split("\n").filter((line) => line.length > 0);
|
|
@@ -1813,7 +1815,7 @@ async function collectSnapshotStats(mode) {
|
|
|
1813
1815
|
try {
|
|
1814
1816
|
const prompt = JSON.parse(line);
|
|
1815
1817
|
const versionsExec = await mode.exec(
|
|
1816
|
-
`wc -l <
|
|
1818
|
+
`wc -l < prompts/${prompt.name}/versions/index.jsonl 2>/dev/null || echo "0"`
|
|
1817
1819
|
);
|
|
1818
1820
|
const versionCount = parseInt(versionsExec.stdout.trim()) || 0;
|
|
1819
1821
|
result.prompts.push({
|
|
@@ -1851,7 +1853,10 @@ function getRecentActivity(stats) {
|
|
|
1851
1853
|
for (const exp of recentExperiments.slice(0, 2)) {
|
|
1852
1854
|
const timeAgo = formatRelativeTime(new Date(exp.updatedAt));
|
|
1853
1855
|
activities.push(
|
|
1854
|
-
`${exp.projectName || exp.datasetName}: experiment "${exp.id.slice(
|
|
1856
|
+
`${exp.projectName || exp.datasetName}: experiment "${exp.id.slice(
|
|
1857
|
+
0,
|
|
1858
|
+
8
|
|
1859
|
+
)}..." ${exp.status} ${timeAgo}`
|
|
1855
1860
|
);
|
|
1856
1861
|
}
|
|
1857
1862
|
const recentDatasets = stats.datasets.filter((d) => d.updatedAt && isRecent(new Date(d.updatedAt), 24)).sort(
|