fix(marketplace): close client contract gaps

This commit is contained in:
2026-08-29 23:21:26 +08:00
parent e4676977b9
commit c4120dd847
9 changed files with 236 additions and 29 deletions

View File

@@ -121,6 +121,16 @@ describe('Marketplace Release A package contract', () => {
expect(Object.isFrozen(definition.tools[0]?.outputSchema)).toBe(true);
});
it('accepts only the canonical asynchronous job execution mode', () => {
const job = structuredClone(HOSTED_CAPABILITY) as Record<string, unknown>;
(job.tools as Array<Record<string, unknown>>)[0]!.executionMode = 'job';
expect(parse(job).tools[0]?.executionMode).toBe('job');
const accepted = structuredClone(HOSTED_CAPABILITY) as Record<string, unknown>;
(accepted.tools as Array<Record<string, unknown>>)[0]!.executionMode = 'accepted';
expect(() => parse(accepted)).toThrow(CodingPluginManifestError);
});
it('requires the exact capability manifest path even for direct parsing', () => {
const root = structuredClone(ROOT) as Record<string, unknown>;
const extensions = root.extensions as Record<string, unknown>;