fix(coding): tighten Pi Data Service schemas

This commit is contained in:
2026-08-26 20:03:07 +08:00
parent 1d63233cd0
commit f61990f3a7
3 changed files with 28 additions and 5 deletions

View File

@@ -243,6 +243,15 @@ describe('Makelore Pi extension bundle', () => {
expect(Object.keys(tool?.parameters?.properties ?? {})).not.toEqual(
expect.arrayContaining(['owner', 'project', 'path', 'token', 'endpoint', 'url', 'handle']),
);
const properties = tool?.parameters?.properties as Record<string, Record<string, unknown>>;
if (name === 'data_service_get_document'
|| name === 'data_service_put_document'
|| name === 'data_service_delete_document') {
expect(properties.document_id?.not).toEqual({ enum: ['.', '..'] });
}
if (name === 'data_service_put_document' || name === 'data_service_delete_document') {
expect(properties.if_revision?.maximum).toBe(Number.MAX_SAFE_INTEGER);
}
}
const updates: unknown[] = [];