helpers.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * Experimental task capability assertion helpers.
  3. * WARNING: These APIs are experimental and may change without notice.
  4. *
  5. * @experimental
  6. */
  7. /**
  8. * Type representing the task requests capability structure.
  9. * This is derived from ClientTasksCapability.requests and ServerTasksCapability.requests.
  10. */
  11. interface TaskRequestsCapability {
  12. tools?: {
  13. call?: object;
  14. };
  15. sampling?: {
  16. createMessage?: object;
  17. };
  18. elicitation?: {
  19. create?: object;
  20. };
  21. }
  22. /**
  23. * Asserts that task creation is supported for tools/call.
  24. * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability.
  25. *
  26. * @param requests - The task requests capability object
  27. * @param method - The method being checked
  28. * @param entityName - 'Server' or 'Client' for error messages
  29. * @throws Error if the capability is not supported
  30. *
  31. * @experimental
  32. */
  33. export declare function assertToolsCallTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void;
  34. /**
  35. * Asserts that task creation is supported for sampling/createMessage or elicitation/create.
  36. * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability.
  37. *
  38. * @param requests - The task requests capability object
  39. * @param method - The method being checked
  40. * @param entityName - 'Server' or 'Client' for error messages
  41. * @throws Error if the capability is not supported
  42. *
  43. * @experimental
  44. */
  45. export declare function assertClientRequestTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void;
  46. export {};
  47. //# sourceMappingURL=helpers.d.ts.map