Go SDK: Align hooks with SEP (#23)
The SEP spec and C# SDK use hooks (plural, JSON array) but the Go SDK
had hook (singular, single object). This meant the wire formats were
incompatible — Go would send `{"hook": {...}}` while everything else
expects `{"hooks": [...]}`.
Signed-off-by: Ukjae Jeong <jeongukjae@gmail.com>
This commit is contained in:
parent
2b1d10093e
commit
23d889254b
1 changed files with 110 additions and 92 deletions
|
|
@ -181,8 +181,10 @@ func (e *Extension) enrichInitResult(result mcp.Result) (mcp.Result, error) {
|
|||
all := e.getInterceptors()
|
||||
supportedEvents := map[string]bool{}
|
||||
for _, ri := range all {
|
||||
for _, ev := range ri.GetMetadata().Hook.Events {
|
||||
supportedEvents[ev] = true
|
||||
for _, h := range ri.GetMetadata().Hooks {
|
||||
for _, ev := range h.Events {
|
||||
supportedEvents[ev] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue