agent-reference.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. export type AgentReferenceResolutionSource =
  2. | 'stable_name'
  3. | 'display_name_compat'
  4. | 'canonical_name'
  5. | 'explicit_agent';
  6. /**
  7. * Neutral read scope shared by the local Agent capability and V1 consumers.
  8. * It contains no persistence or HTTP types, so consumers can be migrated
  9. * without importing either runtime's concrete Agent implementation.
  10. */
  11. export interface AgentReferenceReadScope {
  12. readonly requestedName: string;
  13. readonly canonicalName: string;
  14. readonly primaryName: string;
  15. readonly compatibleNames: readonly string[];
  16. readonly exact: boolean;
  17. readonly source: AgentReferenceResolutionSource;
  18. readonly trustedBuiltin?: boolean;
  19. /** Persisted owner selected by the resolver, when the implementation knows it. */
  20. readonly exactOwnerName?: string;
  21. }
  22. /**
  23. * Narrow Agent reference port. Management callers may use the individual
  24. * methods; execution callers compose a private TaskTargetFacts object from
  25. * the same four methods without widening the public port.
  26. */
  27. export interface AgentReferenceResolver {
  28. resolveAgentReadScope(requestedName: string): Promise<AgentReferenceReadScope>;
  29. resolveAgentWriteTarget(requestedName: string): Promise<string>;
  30. requireExactAgentKey(requestedName: string): Promise<string>;
  31. resolveAgentExecutionTarget(exactOwnerName: string): Promise<string>;
  32. }