42077c1aab
- Removed the selectSkill method from prepareService and adjusted related logic in the Run method of Service. - Updated tool catalog to parse agent allowed tool codes directly. - Simplified Request and RunInput structures by removing unnecessary fields. - Enhanced the RuntimeTraceCollector to manage skill activation and visibility. - Introduced a new databaseSkillBackend to manage skill definitions and their metadata. - Added tests for skill backend functionalities to ensure correct behavior. - Updated various factory methods to accommodate changes in skill handling. - Improved documentation and descriptions for better clarity.
38 lines
756 B
Go
38 lines
756 B
Go
package runtime
|
|
|
|
func newPrepareService(catalog *toolCatalog) *prepareService {
|
|
return &prepareService{catalog: catalog}
|
|
}
|
|
|
|
type prepareService struct {
|
|
catalog *toolCatalog
|
|
}
|
|
|
|
func (s *prepareService) prepareToolsForRun(req *Request) error {
|
|
if req == nil || req.ToolSet != nil || s.catalog == nil {
|
|
return nil
|
|
}
|
|
toolSet, err := s.catalog.resolveForRun(req)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if toolSet != nil {
|
|
req.ToolSet = toolSet
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (s *prepareService) prepareToolsForResume(req *ResumeRequest) error {
|
|
if req == nil || req.ToolSet != nil || s.catalog == nil {
|
|
return nil
|
|
}
|
|
toolSet, err := s.catalog.resolveForResume(req)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if toolSet != nil {
|
|
req.ToolSet = toolSet
|
|
}
|
|
return nil
|
|
}
|