fix: sync Node Codex hook integration

This commit is contained in:
ZacharyZhang-NY committed 2026-07-19 05:24:01 -04:00
1 parent 40030c0bd2
commit b6a5678e9f
6 files changed
+702

No files matched your search

+32
View File
@@ -24,6 +24,11 @@ const expectedProviderIds = [
const expectedCustomIntegrationIds = ['enterprise', 'gui', 'other', 'sdk'];
const expectedAdapterKeys = ['go', 'node', 'python'];
const adapterSourcePaths = {
go: (id) => `sdks/go/cmd/elydora/plugins/${id}.go`,
node: (id) => `sdks/node/src/plugins/${id}.ts`,
python: (id) => `sdks/python/elydora/plugins/${id}.py`,
};
const requiredProviderFields = [
'id',
'name',
@@ -43,6 +48,16 @@ async function readJson(path) {
return JSON.parse(await readFile(new URL(path, root), 'utf8'));
}
async function sourceExists(path) {
try {
await readFile(new URL(path, root));
return true;
} catch (error) {
if (error?.code === 'ENOENT') return false;
throw error;
}
}
function deliveryState(adapters) {
const availableCount = Object.values(adapters).filter(Boolean).length;
if (availableCount === expectedAdapterKeys.length) return 'available';
@@ -142,6 +157,23 @@ test('schema freezes the provider contract and supported enums', async () => {
]);
});
test('adapter delivery claims resolve to source files in every SDK mirror', async () => {
const catalog = await readJson('integrations/catalog.json');
for (const provider of catalog.providers) {
for (const [language, delivered] of Object.entries(provider.adapters)) {
const resolveSourcePath = adapterSourcePaths[language];
assert.ok(resolveSourcePath, `unknown adapter language: ${language}`);
const sourcePath = resolveSourcePath(provider.id);
assert.equal(
await sourceExists(sourcePath),
delivered,
`${provider.id} ${language} delivery state disagrees with ${sourcePath}`,
);
}
}
});
test('high-drift providers retain their verified hook contracts', async () => {
const catalog = await readJson('integrations/catalog.json');
const providers = new Map(catalog.providers.map((provider) => [provider.id, provider]));