refAsItemRef dispatches cmdPath with the catalog's `ref` under `item_ref`, the name `pad github link [item-ref]` / `unlink ` give their positional (TASK-3611): every other pad_item action takes `ref`, so the catalog keeps that name and translates here, for both transports.
(cmdPath []string)
| 94 | // positional (TASK-3611): every other pad_item action takes `ref`, so the |
| 95 | // catalog keeps that name and translates here, for both transports. |
| 96 | func refAsItemRef(cmdPath []string) ActionFn { |
| 97 | return func(ctx context.Context, input map[string]any, env ActionEnv) (*CallToolResult, error) { |
| 98 | out := make(map[string]any, len(input)) |
| 99 | for k, v := range input { |
| 100 | out[k] = v |
| 101 | } |
| 102 | if v, ok := out["ref"]; ok { |
| 103 | out["item_ref"] = v |
| 104 | delete(out, "ref") |
| 105 | } |
| 106 | return env.Dispatch(ctx, cmdPath, out) |
| 107 | } |
| 108 | } |
no test coverage detected