Chancellor / knowledgeArcheologyService.ts
VoidBreach's picture
Upload 62 files
35b8b9c verified
Raw History Blame Contribute Delete
958 Bytes
import { ArcheologicalArtifact } from '../types';
export async function performArcheologicalInference(
topic: string,
_apiKey?: string, // Kept for signature compatibility but not used
): Promise<{ artifacts: ArcheologicalArtifact[]; report: string }> {
try {
const response = await fetch('/api/scholastic/archeology', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ topic }),
});
if (!response.ok) {
throw new Error(`Synthesis protocol status: ${response.status}`);
}
const data = await response.json();
return {
artifacts: data.artifacts || [],
report: data.report || 'Extraction complete. The substrate reveals its debt.',
};
} catch (error) {
console.error('[ARCHEOLOGY_FAILURE]', error);
return {
artifacts: [],
report: 'The digging was halted by a cognitive collapse. The Chancellor demands a retry.',
};
}
}