Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
import { useCallback } from 'react';
import { Link } from 'react-router';
import * as api from '../../../services/api';
import { formatDateTime } from '../../../utils/formatters';
import useListResource from '../../../hooks/useListResource';
import ListLoadError from '../../ui/ListLoadError';
/**
* "Used by recent runs" — agent runs whose prompt included this memory, from a
* bounded scan of recent run records (GET /api/memory/:id/runs, #10495).
*/
export default function MemoryRunsUsedBy({ memoryId }) {
const fetchRuns = useCallback(
() => api.getMemoryRuns(memoryId, { silent: true }).then(res => res?.runs || []),
[memoryId],
);
const { items: runs, state, error, retry } = useListResource(fetchRuns);
if (state === 'error') return <ListLoadError what="recent runs that used this memory" error={error} onRetry={retry} />;
if (runs.length === 0) return null;
return (
<div>
<span className="block text-sm text-gray-400 mb-2">Used by recent runs</span>
<ul className="space-y-1 text-xs text-gray-400">
{runs.map(run => (
<li key={run.runId} className="flex flex-wrap items-center gap-2">
{run.agentId
? <Link to={`/cos/agents/${encodeURIComponent(run.agentId)}`} className="font-mono text-port-accent hover:text-port-accent/80">{run.agentId.slice(0, 8)}</Link>
: <span className="font-mono">{run.runId.slice(0, 8)}</span>}
{run.startTime && <span>{formatDateTime(run.startTime)}</span>}
{run.success === false && <span className="text-port-error">failed</span>}
</li>
))}
</ul>
</div>
);
}