@cephalization/phoenix-insight 1.0.2 → 1.0.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/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(metadata.snapshotTime)} from ${metadata.phoenixUrl}`
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 /phoenix/projects/index.jsonl 2>/dev/null || true"
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 /phoenix/projects/${project.name}/spans/metadata.json 2>/dev/null || echo "{}"`
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 /phoenix/datasets/index.jsonl 2>/dev/null || true"
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 < /phoenix/datasets/${dataset.name}/examples.jsonl 2>/dev/null || echo "0"`
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 /phoenix/experiments/index.jsonl 2>/dev/null || true"
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 /phoenix/prompts/index.jsonl 2>/dev/null || true"
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 < /phoenix/prompts/${prompt.name}/versions/index.jsonl 2>/dev/null || echo "0"`
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(0, 8)}..." ${exp.status} ${timeAgo}`
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(
@@ -3396,16 +3401,17 @@ Configuration:
3396
3401
  Set PHOENIX_INSIGHT_CONFIG env var to override the default config location.
3397
3402
 
3398
3403
  Examples:
3399
- $ phoenix-insight # Start interactive mode
3400
- $ phoenix-insight "What are the slowest traces?" # Single query (sandbox mode)
3401
- $ phoenix-insight --interactive # Explicitly start interactive mode
3402
- $ phoenix-insight --local "Show me error patterns" # Local mode with persistence
3403
- $ phoenix-insight --local --stream "Analyze recent experiments" # Local mode with streaming
3404
- $ phoenix-insight --config ./my-config.json "Analyze traces" # Use custom config file
3405
- $ phoenix-insight ui # Start web UI on localhost:6007
3406
- $ phoenix-insight ui --port 8080 # Start web UI on custom port
3407
- $ phoenix-insight ui --no-open # Start web UI without opening browser
3408
- $ phoenix-insight help # Show this help message
3404
+ $ phoenix-insight # Start interactive mode
3405
+ $ phoenix-insight "What are the slowest traces?" # Single query (sandbox mode)
3406
+ $ phoenix-insight --interactive # Explicitly start interactive mode
3407
+ $ phoenix-insight --local "Show me error patterns" # Local mode with persistence
3408
+ $ phoenix-insight --local --stream "Analyze recent experiments" # Local mode with streaming
3409
+ $ phoenix-insight --config ./my-config.json "Analyze traces" # Use custom config file
3410
+ $ phoenix-insight ui # Start web UI on localhost:6007
3411
+ $ phoenix-insight ui --port 8080 # Start web UI on custom port
3412
+ $ phoenix-insight ui --no-open # Start web UI without opening browser
3413
+ $ opencode run "Analyze my spans" -f $(pxi snapshot latest)/_context.md # Analyze phoenix data with OpenCode agent
3414
+ $ phoenix-insight help # Show this help message
3409
3415
  `
3410
3416
  ).hook("preAction", async (thisCommand) => {
3411
3417
  const opts = thisCommand.opts();